google_cloud_bigquery_analyticshub_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// A data exchange is a container that lets you share data. Along with the
39/// descriptive information about the data exchange, it contains listings that
40/// reference shared datasets.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct DataExchange {
44 /// Output only. The resource name of the data exchange.
45 /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
46 pub name: std::string::String,
47
48 /// Required. Human-readable display name of the data exchange. The display
49 /// name must contain only Unicode letters, numbers (0-9), underscores (_),
50 /// dashes (-), spaces ( ), ampersands (&) and must not start or end with
51 /// spaces. Default value is an empty string. Max length: 63 bytes.
52 pub display_name: std::string::String,
53
54 /// Optional. Description of the data exchange. The description must not
55 /// contain Unicode non-characters as well as C0 and C1 control codes except
56 /// tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF).
57 /// Default value is an empty string.
58 /// Max length: 2000 bytes.
59 pub description: std::string::String,
60
61 /// Optional. Email or URL of the primary point of contact of the data
62 /// exchange. Max Length: 1000 bytes.
63 pub primary_contact: std::string::String,
64
65 /// Optional. Documentation describing the data exchange.
66 pub documentation: std::string::String,
67
68 /// Output only. Number of listings contained in the data exchange.
69 pub listing_count: i32,
70
71 /// Optional. Base64 encoded image representing the data exchange. Max
72 /// Size: 3.0MiB Expected image dimensions are 512x512 pixels, however the API
73 /// only performs validation on size of the encoded data. Note: For byte
74 /// fields, the content of the fields are base64-encoded (which increases the
75 /// size of the data by 33-36%) when using JSON on the wire.
76 pub icon: ::bytes::Bytes,
77
78 /// Optional. Configurable data sharing environment option for a data exchange.
79 pub sharing_environment_config: std::option::Option<crate::model::SharingEnvironmentConfig>,
80
81 /// Optional. Type of discovery on the discovery page for all the listings
82 /// under this exchange. Updating this field also updates (overwrites) the
83 /// discovery_type field for all the listings under this exchange.
84 pub discovery_type: std::option::Option<crate::model::DiscoveryType>,
85
86 /// Optional. By default, false.
87 /// If true, the DataExchange has an email sharing mandate enabled.
88 pub log_linked_dataset_query_user_email: std::option::Option<bool>,
89
90 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
91}
92
93impl DataExchange {
94 /// Creates a new default instance.
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 project_id = "project_id";
105 /// # let location_id = "location_id";
106 /// # let data_exchange_id = "data_exchange_id";
107 /// let x = DataExchange::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
108 /// ```
109 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
110 self.name = v.into();
111 self
112 }
113
114 /// Sets the value of [display_name][crate::model::DataExchange::display_name].
115 ///
116 /// # Example
117 /// ```ignore,no_run
118 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
119 /// let x = DataExchange::new().set_display_name("example");
120 /// ```
121 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
122 self.display_name = v.into();
123 self
124 }
125
126 /// Sets the value of [description][crate::model::DataExchange::description].
127 ///
128 /// # Example
129 /// ```ignore,no_run
130 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
131 /// let x = DataExchange::new().set_description("example");
132 /// ```
133 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
134 self.description = v.into();
135 self
136 }
137
138 /// Sets the value of [primary_contact][crate::model::DataExchange::primary_contact].
139 ///
140 /// # Example
141 /// ```ignore,no_run
142 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
143 /// let x = DataExchange::new().set_primary_contact("example");
144 /// ```
145 pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
146 self.primary_contact = v.into();
147 self
148 }
149
150 /// Sets the value of [documentation][crate::model::DataExchange::documentation].
151 ///
152 /// # Example
153 /// ```ignore,no_run
154 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
155 /// let x = DataExchange::new().set_documentation("example");
156 /// ```
157 pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
158 self.documentation = v.into();
159 self
160 }
161
162 /// Sets the value of [listing_count][crate::model::DataExchange::listing_count].
163 ///
164 /// # Example
165 /// ```ignore,no_run
166 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
167 /// let x = DataExchange::new().set_listing_count(42);
168 /// ```
169 pub fn set_listing_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
170 self.listing_count = v.into();
171 self
172 }
173
174 /// Sets the value of [icon][crate::model::DataExchange::icon].
175 ///
176 /// # Example
177 /// ```ignore,no_run
178 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
179 /// let x = DataExchange::new().set_icon(bytes::Bytes::from_static(b"example"));
180 /// ```
181 pub fn set_icon<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
182 self.icon = v.into();
183 self
184 }
185
186 /// Sets the value of [sharing_environment_config][crate::model::DataExchange::sharing_environment_config].
187 ///
188 /// # Example
189 /// ```ignore,no_run
190 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
191 /// use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
192 /// let x = DataExchange::new().set_sharing_environment_config(SharingEnvironmentConfig::default()/* use setters */);
193 /// ```
194 pub fn set_sharing_environment_config<T>(mut self, v: T) -> Self
195 where
196 T: std::convert::Into<crate::model::SharingEnvironmentConfig>,
197 {
198 self.sharing_environment_config = std::option::Option::Some(v.into());
199 self
200 }
201
202 /// Sets or clears the value of [sharing_environment_config][crate::model::DataExchange::sharing_environment_config].
203 ///
204 /// # Example
205 /// ```ignore,no_run
206 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
207 /// use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
208 /// let x = DataExchange::new().set_or_clear_sharing_environment_config(Some(SharingEnvironmentConfig::default()/* use setters */));
209 /// let x = DataExchange::new().set_or_clear_sharing_environment_config(None::<SharingEnvironmentConfig>);
210 /// ```
211 pub fn set_or_clear_sharing_environment_config<T>(mut self, v: std::option::Option<T>) -> Self
212 where
213 T: std::convert::Into<crate::model::SharingEnvironmentConfig>,
214 {
215 self.sharing_environment_config = v.map(|x| x.into());
216 self
217 }
218
219 /// Sets the value of [discovery_type][crate::model::DataExchange::discovery_type].
220 ///
221 /// # Example
222 /// ```ignore,no_run
223 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
224 /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
225 /// let x0 = DataExchange::new().set_discovery_type(DiscoveryType::Private);
226 /// let x1 = DataExchange::new().set_discovery_type(DiscoveryType::Public);
227 /// ```
228 pub fn set_discovery_type<T>(mut self, v: T) -> Self
229 where
230 T: std::convert::Into<crate::model::DiscoveryType>,
231 {
232 self.discovery_type = std::option::Option::Some(v.into());
233 self
234 }
235
236 /// Sets or clears the value of [discovery_type][crate::model::DataExchange::discovery_type].
237 ///
238 /// # Example
239 /// ```ignore,no_run
240 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
241 /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
242 /// let x0 = DataExchange::new().set_or_clear_discovery_type(Some(DiscoveryType::Private));
243 /// let x1 = DataExchange::new().set_or_clear_discovery_type(Some(DiscoveryType::Public));
244 /// let x_none = DataExchange::new().set_or_clear_discovery_type(None::<DiscoveryType>);
245 /// ```
246 pub fn set_or_clear_discovery_type<T>(mut self, v: std::option::Option<T>) -> Self
247 where
248 T: std::convert::Into<crate::model::DiscoveryType>,
249 {
250 self.discovery_type = v.map(|x| x.into());
251 self
252 }
253
254 /// Sets the value of [log_linked_dataset_query_user_email][crate::model::DataExchange::log_linked_dataset_query_user_email].
255 ///
256 /// # Example
257 /// ```ignore,no_run
258 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
259 /// let x = DataExchange::new().set_log_linked_dataset_query_user_email(true);
260 /// ```
261 pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
262 where
263 T: std::convert::Into<bool>,
264 {
265 self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
266 self
267 }
268
269 /// Sets or clears the value of [log_linked_dataset_query_user_email][crate::model::DataExchange::log_linked_dataset_query_user_email].
270 ///
271 /// # Example
272 /// ```ignore,no_run
273 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
274 /// let x = DataExchange::new().set_or_clear_log_linked_dataset_query_user_email(Some(false));
275 /// let x = DataExchange::new().set_or_clear_log_linked_dataset_query_user_email(None::<bool>);
276 /// ```
277 pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
278 mut self,
279 v: std::option::Option<T>,
280 ) -> Self
281 where
282 T: std::convert::Into<bool>,
283 {
284 self.log_linked_dataset_query_user_email = v.map(|x| x.into());
285 self
286 }
287}
288
289impl wkt::message::Message for DataExchange {
290 fn typename() -> &'static str {
291 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DataExchange"
292 }
293}
294
295/// A query template is a container for sharing table-valued functions defined by
296/// contributors in a data clean room.
297#[derive(Clone, Default, PartialEq)]
298#[non_exhaustive]
299pub struct QueryTemplate {
300 /// Output only. The resource name of the QueryTemplate.
301 /// e.g. `projects/myproject/locations/us/dataExchanges/123/queryTemplates/456`
302 pub name: std::string::String,
303
304 /// Required. Human-readable display name of the QueryTemplate. The display
305 /// name must contain only Unicode letters, numbers (0-9), underscores (_),
306 /// dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces.
307 /// Default value is an empty string. Max length: 63 bytes.
308 pub display_name: std::string::String,
309
310 /// Optional. Short description of the QueryTemplate. The description must not
311 /// contain Unicode non-characters and C0 and C1 control codes except tabs
312 /// (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
313 /// value is an empty string. Max length: 2000 bytes.
314 pub description: std::string::String,
315
316 /// Optional. Will be deprecated.
317 /// Email or URL of the primary point of contact of the QueryTemplate.
318 /// Max Length: 1000 bytes.
319 pub proposer: std::string::String,
320
321 /// Optional. Email or URL of the primary point of contact of the
322 /// QueryTemplate. Max Length: 1000 bytes.
323 pub primary_contact: std::string::String,
324
325 /// Optional. Documentation describing the QueryTemplate.
326 pub documentation: std::string::String,
327
328 /// Output only. The QueryTemplate lifecycle state.
329 pub state: crate::model::query_template::State,
330
331 /// Optional. The routine associated with the QueryTemplate.
332 pub routine: std::option::Option<crate::model::Routine>,
333
334 /// Output only. Timestamp when the QueryTemplate was created.
335 pub create_time: std::option::Option<wkt::Timestamp>,
336
337 /// Output only. Timestamp when the QueryTemplate was last modified.
338 pub update_time: std::option::Option<wkt::Timestamp>,
339
340 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
341}
342
343impl QueryTemplate {
344 /// Creates a new default instance.
345 pub fn new() -> Self {
346 std::default::Default::default()
347 }
348
349 /// Sets the value of [name][crate::model::QueryTemplate::name].
350 ///
351 /// # Example
352 /// ```ignore,no_run
353 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
354 /// # let project_id = "project_id";
355 /// # let location_id = "location_id";
356 /// # let data_exchange_id = "data_exchange_id";
357 /// # let query_template_id = "query_template_id";
358 /// let x = QueryTemplate::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/queryTemplates/{query_template_id}"));
359 /// ```
360 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
361 self.name = v.into();
362 self
363 }
364
365 /// Sets the value of [display_name][crate::model::QueryTemplate::display_name].
366 ///
367 /// # Example
368 /// ```ignore,no_run
369 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
370 /// let x = QueryTemplate::new().set_display_name("example");
371 /// ```
372 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
373 self.display_name = v.into();
374 self
375 }
376
377 /// Sets the value of [description][crate::model::QueryTemplate::description].
378 ///
379 /// # Example
380 /// ```ignore,no_run
381 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
382 /// let x = QueryTemplate::new().set_description("example");
383 /// ```
384 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
385 self.description = v.into();
386 self
387 }
388
389 /// Sets the value of [proposer][crate::model::QueryTemplate::proposer].
390 ///
391 /// # Example
392 /// ```ignore,no_run
393 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
394 /// let x = QueryTemplate::new().set_proposer("example");
395 /// ```
396 pub fn set_proposer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
397 self.proposer = v.into();
398 self
399 }
400
401 /// Sets the value of [primary_contact][crate::model::QueryTemplate::primary_contact].
402 ///
403 /// # Example
404 /// ```ignore,no_run
405 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
406 /// let x = QueryTemplate::new().set_primary_contact("example");
407 /// ```
408 pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
409 self.primary_contact = v.into();
410 self
411 }
412
413 /// Sets the value of [documentation][crate::model::QueryTemplate::documentation].
414 ///
415 /// # Example
416 /// ```ignore,no_run
417 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
418 /// let x = QueryTemplate::new().set_documentation("example");
419 /// ```
420 pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
421 self.documentation = v.into();
422 self
423 }
424
425 /// Sets the value of [state][crate::model::QueryTemplate::state].
426 ///
427 /// # Example
428 /// ```ignore,no_run
429 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
430 /// use google_cloud_bigquery_analyticshub_v1::model::query_template::State;
431 /// let x0 = QueryTemplate::new().set_state(State::Drafted);
432 /// let x1 = QueryTemplate::new().set_state(State::Pending);
433 /// let x2 = QueryTemplate::new().set_state(State::Deleted);
434 /// ```
435 pub fn set_state<T: std::convert::Into<crate::model::query_template::State>>(
436 mut self,
437 v: T,
438 ) -> Self {
439 self.state = v.into();
440 self
441 }
442
443 /// Sets the value of [routine][crate::model::QueryTemplate::routine].
444 ///
445 /// # Example
446 /// ```ignore,no_run
447 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
448 /// use google_cloud_bigquery_analyticshub_v1::model::Routine;
449 /// let x = QueryTemplate::new().set_routine(Routine::default()/* use setters */);
450 /// ```
451 pub fn set_routine<T>(mut self, v: T) -> Self
452 where
453 T: std::convert::Into<crate::model::Routine>,
454 {
455 self.routine = std::option::Option::Some(v.into());
456 self
457 }
458
459 /// Sets or clears the value of [routine][crate::model::QueryTemplate::routine].
460 ///
461 /// # Example
462 /// ```ignore,no_run
463 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
464 /// use google_cloud_bigquery_analyticshub_v1::model::Routine;
465 /// let x = QueryTemplate::new().set_or_clear_routine(Some(Routine::default()/* use setters */));
466 /// let x = QueryTemplate::new().set_or_clear_routine(None::<Routine>);
467 /// ```
468 pub fn set_or_clear_routine<T>(mut self, v: std::option::Option<T>) -> Self
469 where
470 T: std::convert::Into<crate::model::Routine>,
471 {
472 self.routine = v.map(|x| x.into());
473 self
474 }
475
476 /// Sets the value of [create_time][crate::model::QueryTemplate::create_time].
477 ///
478 /// # Example
479 /// ```ignore,no_run
480 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
481 /// use wkt::Timestamp;
482 /// let x = QueryTemplate::new().set_create_time(Timestamp::default()/* use setters */);
483 /// ```
484 pub fn set_create_time<T>(mut self, v: T) -> Self
485 where
486 T: std::convert::Into<wkt::Timestamp>,
487 {
488 self.create_time = std::option::Option::Some(v.into());
489 self
490 }
491
492 /// Sets or clears the value of [create_time][crate::model::QueryTemplate::create_time].
493 ///
494 /// # Example
495 /// ```ignore,no_run
496 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
497 /// use wkt::Timestamp;
498 /// let x = QueryTemplate::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
499 /// let x = QueryTemplate::new().set_or_clear_create_time(None::<Timestamp>);
500 /// ```
501 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
502 where
503 T: std::convert::Into<wkt::Timestamp>,
504 {
505 self.create_time = v.map(|x| x.into());
506 self
507 }
508
509 /// Sets the value of [update_time][crate::model::QueryTemplate::update_time].
510 ///
511 /// # Example
512 /// ```ignore,no_run
513 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
514 /// use wkt::Timestamp;
515 /// let x = QueryTemplate::new().set_update_time(Timestamp::default()/* use setters */);
516 /// ```
517 pub fn set_update_time<T>(mut self, v: T) -> Self
518 where
519 T: std::convert::Into<wkt::Timestamp>,
520 {
521 self.update_time = std::option::Option::Some(v.into());
522 self
523 }
524
525 /// Sets or clears the value of [update_time][crate::model::QueryTemplate::update_time].
526 ///
527 /// # Example
528 /// ```ignore,no_run
529 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
530 /// use wkt::Timestamp;
531 /// let x = QueryTemplate::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
532 /// let x = QueryTemplate::new().set_or_clear_update_time(None::<Timestamp>);
533 /// ```
534 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
535 where
536 T: std::convert::Into<wkt::Timestamp>,
537 {
538 self.update_time = v.map(|x| x.into());
539 self
540 }
541}
542
543impl wkt::message::Message for QueryTemplate {
544 fn typename() -> &'static str {
545 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.QueryTemplate"
546 }
547}
548
549/// Defines additional types related to [QueryTemplate].
550pub mod query_template {
551 #[allow(unused_imports)]
552 use super::*;
553
554 /// The QueryTemplate lifecycle state.
555 ///
556 /// # Working with unknown values
557 ///
558 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
559 /// additional enum variants at any time. Adding new variants is not considered
560 /// a breaking change. Applications should write their code in anticipation of:
561 ///
562 /// - New values appearing in future releases of the client library, **and**
563 /// - New values received dynamically, without application changes.
564 ///
565 /// Please consult the [Working with enums] section in the user guide for some
566 /// guidelines.
567 ///
568 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
569 #[derive(Clone, Debug, PartialEq)]
570 #[non_exhaustive]
571 pub enum State {
572 /// Default value. This value is unused.
573 Unspecified,
574 /// The QueryTemplate is in draft state.
575 Drafted,
576 /// The QueryTemplate is in pending state.
577 Pending,
578 /// The QueryTemplate is in deleted state.
579 Deleted,
580 /// The QueryTemplate is in approved state.
581 Approved,
582 /// If set, the enum was initialized with an unknown value.
583 ///
584 /// Applications can examine the value using [State::value] or
585 /// [State::name].
586 UnknownValue(state::UnknownValue),
587 }
588
589 #[doc(hidden)]
590 pub mod state {
591 #[allow(unused_imports)]
592 use super::*;
593 #[derive(Clone, Debug, PartialEq)]
594 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
595 }
596
597 impl State {
598 /// Gets the enum value.
599 ///
600 /// Returns `None` if the enum contains an unknown value deserialized from
601 /// the string representation of enums.
602 pub fn value(&self) -> std::option::Option<i32> {
603 match self {
604 Self::Unspecified => std::option::Option::Some(0),
605 Self::Drafted => std::option::Option::Some(1),
606 Self::Pending => std::option::Option::Some(2),
607 Self::Deleted => std::option::Option::Some(3),
608 Self::Approved => std::option::Option::Some(4),
609 Self::UnknownValue(u) => u.0.value(),
610 }
611 }
612
613 /// Gets the enum value as a string.
614 ///
615 /// Returns `None` if the enum contains an unknown value deserialized from
616 /// the integer representation of enums.
617 pub fn name(&self) -> std::option::Option<&str> {
618 match self {
619 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
620 Self::Drafted => std::option::Option::Some("DRAFTED"),
621 Self::Pending => std::option::Option::Some("PENDING"),
622 Self::Deleted => std::option::Option::Some("DELETED"),
623 Self::Approved => std::option::Option::Some("APPROVED"),
624 Self::UnknownValue(u) => u.0.name(),
625 }
626 }
627 }
628
629 impl std::default::Default for State {
630 fn default() -> Self {
631 use std::convert::From;
632 Self::from(0)
633 }
634 }
635
636 impl std::fmt::Display for State {
637 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
638 wkt::internal::display_enum(f, self.name(), self.value())
639 }
640 }
641
642 impl std::convert::From<i32> for State {
643 fn from(value: i32) -> Self {
644 match value {
645 0 => Self::Unspecified,
646 1 => Self::Drafted,
647 2 => Self::Pending,
648 3 => Self::Deleted,
649 4 => Self::Approved,
650 _ => Self::UnknownValue(state::UnknownValue(
651 wkt::internal::UnknownEnumValue::Integer(value),
652 )),
653 }
654 }
655 }
656
657 impl std::convert::From<&str> for State {
658 fn from(value: &str) -> Self {
659 use std::string::ToString;
660 match value {
661 "STATE_UNSPECIFIED" => Self::Unspecified,
662 "DRAFTED" => Self::Drafted,
663 "PENDING" => Self::Pending,
664 "DELETED" => Self::Deleted,
665 "APPROVED" => Self::Approved,
666 _ => Self::UnknownValue(state::UnknownValue(
667 wkt::internal::UnknownEnumValue::String(value.to_string()),
668 )),
669 }
670 }
671 }
672
673 impl serde::ser::Serialize for State {
674 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
675 where
676 S: serde::Serializer,
677 {
678 match self {
679 Self::Unspecified => serializer.serialize_i32(0),
680 Self::Drafted => serializer.serialize_i32(1),
681 Self::Pending => serializer.serialize_i32(2),
682 Self::Deleted => serializer.serialize_i32(3),
683 Self::Approved => serializer.serialize_i32(4),
684 Self::UnknownValue(u) => u.0.serialize(serializer),
685 }
686 }
687 }
688
689 impl<'de> serde::de::Deserialize<'de> for State {
690 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
691 where
692 D: serde::Deserializer<'de>,
693 {
694 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
695 ".google.cloud.bigquery.analyticshub.v1.QueryTemplate.State",
696 ))
697 }
698 }
699}
700
701/// Represents a bigquery routine.
702#[derive(Clone, Default, PartialEq)]
703#[non_exhaustive]
704pub struct Routine {
705 /// Required. The type of routine.
706 pub routine_type: crate::model::routine::RoutineType,
707
708 /// Optional. The definition body of the routine.
709 pub definition_body: std::string::String,
710
711 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
712}
713
714impl Routine {
715 /// Creates a new default instance.
716 pub fn new() -> Self {
717 std::default::Default::default()
718 }
719
720 /// Sets the value of [routine_type][crate::model::Routine::routine_type].
721 ///
722 /// # Example
723 /// ```ignore,no_run
724 /// # use google_cloud_bigquery_analyticshub_v1::model::Routine;
725 /// use google_cloud_bigquery_analyticshub_v1::model::routine::RoutineType;
726 /// let x0 = Routine::new().set_routine_type(RoutineType::TableValuedFunction);
727 /// ```
728 pub fn set_routine_type<T: std::convert::Into<crate::model::routine::RoutineType>>(
729 mut self,
730 v: T,
731 ) -> Self {
732 self.routine_type = v.into();
733 self
734 }
735
736 /// Sets the value of [definition_body][crate::model::Routine::definition_body].
737 ///
738 /// # Example
739 /// ```ignore,no_run
740 /// # use google_cloud_bigquery_analyticshub_v1::model::Routine;
741 /// let x = Routine::new().set_definition_body("example");
742 /// ```
743 pub fn set_definition_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
744 self.definition_body = v.into();
745 self
746 }
747}
748
749impl wkt::message::Message for Routine {
750 fn typename() -> &'static str {
751 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Routine"
752 }
753}
754
755/// Defines additional types related to [Routine].
756pub mod routine {
757 #[allow(unused_imports)]
758 use super::*;
759
760 /// Represents the type of a given routine.
761 ///
762 /// # Working with unknown values
763 ///
764 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
765 /// additional enum variants at any time. Adding new variants is not considered
766 /// a breaking change. Applications should write their code in anticipation of:
767 ///
768 /// - New values appearing in future releases of the client library, **and**
769 /// - New values received dynamically, without application changes.
770 ///
771 /// Please consult the [Working with enums] section in the user guide for some
772 /// guidelines.
773 ///
774 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
775 #[derive(Clone, Debug, PartialEq)]
776 #[non_exhaustive]
777 pub enum RoutineType {
778 /// Default value.
779 Unspecified,
780 /// Non-built-in persistent TVF.
781 TableValuedFunction,
782 /// If set, the enum was initialized with an unknown value.
783 ///
784 /// Applications can examine the value using [RoutineType::value] or
785 /// [RoutineType::name].
786 UnknownValue(routine_type::UnknownValue),
787 }
788
789 #[doc(hidden)]
790 pub mod routine_type {
791 #[allow(unused_imports)]
792 use super::*;
793 #[derive(Clone, Debug, PartialEq)]
794 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
795 }
796
797 impl RoutineType {
798 /// Gets the enum value.
799 ///
800 /// Returns `None` if the enum contains an unknown value deserialized from
801 /// the string representation of enums.
802 pub fn value(&self) -> std::option::Option<i32> {
803 match self {
804 Self::Unspecified => std::option::Option::Some(0),
805 Self::TableValuedFunction => std::option::Option::Some(1),
806 Self::UnknownValue(u) => u.0.value(),
807 }
808 }
809
810 /// Gets the enum value as a string.
811 ///
812 /// Returns `None` if the enum contains an unknown value deserialized from
813 /// the integer representation of enums.
814 pub fn name(&self) -> std::option::Option<&str> {
815 match self {
816 Self::Unspecified => std::option::Option::Some("ROUTINE_TYPE_UNSPECIFIED"),
817 Self::TableValuedFunction => std::option::Option::Some("TABLE_VALUED_FUNCTION"),
818 Self::UnknownValue(u) => u.0.name(),
819 }
820 }
821 }
822
823 impl std::default::Default for RoutineType {
824 fn default() -> Self {
825 use std::convert::From;
826 Self::from(0)
827 }
828 }
829
830 impl std::fmt::Display for RoutineType {
831 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
832 wkt::internal::display_enum(f, self.name(), self.value())
833 }
834 }
835
836 impl std::convert::From<i32> for RoutineType {
837 fn from(value: i32) -> Self {
838 match value {
839 0 => Self::Unspecified,
840 1 => Self::TableValuedFunction,
841 _ => Self::UnknownValue(routine_type::UnknownValue(
842 wkt::internal::UnknownEnumValue::Integer(value),
843 )),
844 }
845 }
846 }
847
848 impl std::convert::From<&str> for RoutineType {
849 fn from(value: &str) -> Self {
850 use std::string::ToString;
851 match value {
852 "ROUTINE_TYPE_UNSPECIFIED" => Self::Unspecified,
853 "TABLE_VALUED_FUNCTION" => Self::TableValuedFunction,
854 _ => Self::UnknownValue(routine_type::UnknownValue(
855 wkt::internal::UnknownEnumValue::String(value.to_string()),
856 )),
857 }
858 }
859 }
860
861 impl serde::ser::Serialize for RoutineType {
862 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
863 where
864 S: serde::Serializer,
865 {
866 match self {
867 Self::Unspecified => serializer.serialize_i32(0),
868 Self::TableValuedFunction => serializer.serialize_i32(1),
869 Self::UnknownValue(u) => u.0.serialize(serializer),
870 }
871 }
872 }
873
874 impl<'de> serde::de::Deserialize<'de> for RoutineType {
875 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
876 where
877 D: serde::Deserializer<'de>,
878 {
879 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutineType>::new(
880 ".google.cloud.bigquery.analyticshub.v1.Routine.RoutineType",
881 ))
882 }
883 }
884}
885
886/// Message for creating a QueryTemplate.
887#[derive(Clone, Default, PartialEq)]
888#[non_exhaustive]
889pub struct CreateQueryTemplateRequest {
890 /// Required. The parent resource path of the QueryTemplate.
891 /// e.g.
892 /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myQueryTemplate`.
893 pub parent: std::string::String,
894
895 /// Required. The ID of the QueryTemplate to create.
896 /// Must contain only Unicode letters, numbers (0-9), underscores (_).
897 /// Max length: 100 bytes.
898 pub query_template_id: std::string::String,
899
900 /// Required. The QueryTemplate to create.
901 pub query_template: std::option::Option<crate::model::QueryTemplate>,
902
903 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
904}
905
906impl CreateQueryTemplateRequest {
907 /// Creates a new default instance.
908 pub fn new() -> Self {
909 std::default::Default::default()
910 }
911
912 /// Sets the value of [parent][crate::model::CreateQueryTemplateRequest::parent].
913 ///
914 /// # Example
915 /// ```ignore,no_run
916 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
917 /// # let project_id = "project_id";
918 /// # let location_id = "location_id";
919 /// # let data_exchange_id = "data_exchange_id";
920 /// let x = CreateQueryTemplateRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
921 /// ```
922 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
923 self.parent = v.into();
924 self
925 }
926
927 /// Sets the value of [query_template_id][crate::model::CreateQueryTemplateRequest::query_template_id].
928 ///
929 /// # Example
930 /// ```ignore,no_run
931 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
932 /// let x = CreateQueryTemplateRequest::new().set_query_template_id("example");
933 /// ```
934 pub fn set_query_template_id<T: std::convert::Into<std::string::String>>(
935 mut self,
936 v: T,
937 ) -> Self {
938 self.query_template_id = v.into();
939 self
940 }
941
942 /// Sets the value of [query_template][crate::model::CreateQueryTemplateRequest::query_template].
943 ///
944 /// # Example
945 /// ```ignore,no_run
946 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
947 /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
948 /// let x = CreateQueryTemplateRequest::new().set_query_template(QueryTemplate::default()/* use setters */);
949 /// ```
950 pub fn set_query_template<T>(mut self, v: T) -> Self
951 where
952 T: std::convert::Into<crate::model::QueryTemplate>,
953 {
954 self.query_template = std::option::Option::Some(v.into());
955 self
956 }
957
958 /// Sets or clears the value of [query_template][crate::model::CreateQueryTemplateRequest::query_template].
959 ///
960 /// # Example
961 /// ```ignore,no_run
962 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
963 /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
964 /// let x = CreateQueryTemplateRequest::new().set_or_clear_query_template(Some(QueryTemplate::default()/* use setters */));
965 /// let x = CreateQueryTemplateRequest::new().set_or_clear_query_template(None::<QueryTemplate>);
966 /// ```
967 pub fn set_or_clear_query_template<T>(mut self, v: std::option::Option<T>) -> Self
968 where
969 T: std::convert::Into<crate::model::QueryTemplate>,
970 {
971 self.query_template = v.map(|x| x.into());
972 self
973 }
974}
975
976impl wkt::message::Message for CreateQueryTemplateRequest {
977 fn typename() -> &'static str {
978 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateQueryTemplateRequest"
979 }
980}
981
982/// Message for creating a QueryTemplate.
983#[derive(Clone, Default, PartialEq)]
984#[non_exhaustive]
985pub struct GetQueryTemplateRequest {
986 /// Required. The parent resource path of the QueryTemplate.
987 /// e.g.
988 /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
989 pub name: std::string::String,
990
991 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
992}
993
994impl GetQueryTemplateRequest {
995 /// Creates a new default instance.
996 pub fn new() -> Self {
997 std::default::Default::default()
998 }
999
1000 /// Sets the value of [name][crate::model::GetQueryTemplateRequest::name].
1001 ///
1002 /// # Example
1003 /// ```ignore,no_run
1004 /// # use google_cloud_bigquery_analyticshub_v1::model::GetQueryTemplateRequest;
1005 /// # let project_id = "project_id";
1006 /// # let location_id = "location_id";
1007 /// # let data_exchange_id = "data_exchange_id";
1008 /// # let query_template_id = "query_template_id";
1009 /// let x = GetQueryTemplateRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/queryTemplates/{query_template_id}"));
1010 /// ```
1011 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1012 self.name = v.into();
1013 self
1014 }
1015}
1016
1017impl wkt::message::Message for GetQueryTemplateRequest {
1018 fn typename() -> &'static str {
1019 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetQueryTemplateRequest"
1020 }
1021}
1022
1023/// Message for requesting the list of QueryTemplates.
1024#[derive(Clone, Default, PartialEq)]
1025#[non_exhaustive]
1026pub struct ListQueryTemplatesRequest {
1027 /// Required. The parent resource path of the QueryTemplates.
1028 /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
1029 pub parent: std::string::String,
1030
1031 /// Optional. The maximum number of results to return in a single response
1032 /// page. Leverage the page tokens to iterate through the entire collection.
1033 pub page_size: i32,
1034
1035 /// Optional. Page token, returned by a previous call, to request the next page
1036 /// of results.
1037 pub page_token: std::string::String,
1038
1039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1040}
1041
1042impl ListQueryTemplatesRequest {
1043 /// Creates a new default instance.
1044 pub fn new() -> Self {
1045 std::default::Default::default()
1046 }
1047
1048 /// Sets the value of [parent][crate::model::ListQueryTemplatesRequest::parent].
1049 ///
1050 /// # Example
1051 /// ```ignore,no_run
1052 /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesRequest;
1053 /// # let project_id = "project_id";
1054 /// # let location_id = "location_id";
1055 /// # let data_exchange_id = "data_exchange_id";
1056 /// let x = ListQueryTemplatesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
1057 /// ```
1058 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1059 self.parent = v.into();
1060 self
1061 }
1062
1063 /// Sets the value of [page_size][crate::model::ListQueryTemplatesRequest::page_size].
1064 ///
1065 /// # Example
1066 /// ```ignore,no_run
1067 /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesRequest;
1068 /// let x = ListQueryTemplatesRequest::new().set_page_size(42);
1069 /// ```
1070 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1071 self.page_size = v.into();
1072 self
1073 }
1074
1075 /// Sets the value of [page_token][crate::model::ListQueryTemplatesRequest::page_token].
1076 ///
1077 /// # Example
1078 /// ```ignore,no_run
1079 /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesRequest;
1080 /// let x = ListQueryTemplatesRequest::new().set_page_token("example");
1081 /// ```
1082 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1083 self.page_token = v.into();
1084 self
1085 }
1086}
1087
1088impl wkt::message::Message for ListQueryTemplatesRequest {
1089 fn typename() -> &'static str {
1090 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListQueryTemplatesRequest"
1091 }
1092}
1093
1094/// Message for response to the list of QueryTemplates.
1095#[derive(Clone, Default, PartialEq)]
1096#[non_exhaustive]
1097pub struct ListQueryTemplatesResponse {
1098 /// The list of QueryTemplates.
1099 pub query_templates: std::vec::Vec<crate::model::QueryTemplate>,
1100
1101 /// A token to request the next page of results.
1102 pub next_page_token: std::string::String,
1103
1104 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1105}
1106
1107impl ListQueryTemplatesResponse {
1108 /// Creates a new default instance.
1109 pub fn new() -> Self {
1110 std::default::Default::default()
1111 }
1112
1113 /// Sets the value of [query_templates][crate::model::ListQueryTemplatesResponse::query_templates].
1114 ///
1115 /// # Example
1116 /// ```ignore,no_run
1117 /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesResponse;
1118 /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
1119 /// let x = ListQueryTemplatesResponse::new()
1120 /// .set_query_templates([
1121 /// QueryTemplate::default()/* use setters */,
1122 /// QueryTemplate::default()/* use (different) setters */,
1123 /// ]);
1124 /// ```
1125 pub fn set_query_templates<T, V>(mut self, v: T) -> Self
1126 where
1127 T: std::iter::IntoIterator<Item = V>,
1128 V: std::convert::Into<crate::model::QueryTemplate>,
1129 {
1130 use std::iter::Iterator;
1131 self.query_templates = v.into_iter().map(|i| i.into()).collect();
1132 self
1133 }
1134
1135 /// Sets the value of [next_page_token][crate::model::ListQueryTemplatesResponse::next_page_token].
1136 ///
1137 /// # Example
1138 /// ```ignore,no_run
1139 /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesResponse;
1140 /// let x = ListQueryTemplatesResponse::new().set_next_page_token("example");
1141 /// ```
1142 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1143 self.next_page_token = v.into();
1144 self
1145 }
1146}
1147
1148impl wkt::message::Message for ListQueryTemplatesResponse {
1149 fn typename() -> &'static str {
1150 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListQueryTemplatesResponse"
1151 }
1152}
1153
1154#[doc(hidden)]
1155impl google_cloud_gax::paginator::internal::PageableResponse for ListQueryTemplatesResponse {
1156 type PageItem = crate::model::QueryTemplate;
1157
1158 fn items(self) -> std::vec::Vec<Self::PageItem> {
1159 self.query_templates
1160 }
1161
1162 fn next_page_token(&self) -> std::string::String {
1163 use std::clone::Clone;
1164 self.next_page_token.clone()
1165 }
1166}
1167
1168/// Message for updating a QueryTemplate.
1169#[derive(Clone, Default, PartialEq)]
1170#[non_exhaustive]
1171pub struct UpdateQueryTemplateRequest {
1172 /// Optional. Field mask specifies the fields to update in the query template
1173 /// resource. The fields specified in the `updateMask` are relative to the
1174 /// resource and are not a full request.
1175 pub update_mask: std::option::Option<wkt::FieldMask>,
1176
1177 /// Required. The QueryTemplate to update.
1178 pub query_template: std::option::Option<crate::model::QueryTemplate>,
1179
1180 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1181}
1182
1183impl UpdateQueryTemplateRequest {
1184 /// Creates a new default instance.
1185 pub fn new() -> Self {
1186 std::default::Default::default()
1187 }
1188
1189 /// Sets the value of [update_mask][crate::model::UpdateQueryTemplateRequest::update_mask].
1190 ///
1191 /// # Example
1192 /// ```ignore,no_run
1193 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1194 /// use wkt::FieldMask;
1195 /// let x = UpdateQueryTemplateRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1196 /// ```
1197 pub fn set_update_mask<T>(mut self, v: T) -> Self
1198 where
1199 T: std::convert::Into<wkt::FieldMask>,
1200 {
1201 self.update_mask = std::option::Option::Some(v.into());
1202 self
1203 }
1204
1205 /// Sets or clears the value of [update_mask][crate::model::UpdateQueryTemplateRequest::update_mask].
1206 ///
1207 /// # Example
1208 /// ```ignore,no_run
1209 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1210 /// use wkt::FieldMask;
1211 /// let x = UpdateQueryTemplateRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1212 /// let x = UpdateQueryTemplateRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1213 /// ```
1214 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1215 where
1216 T: std::convert::Into<wkt::FieldMask>,
1217 {
1218 self.update_mask = v.map(|x| x.into());
1219 self
1220 }
1221
1222 /// Sets the value of [query_template][crate::model::UpdateQueryTemplateRequest::query_template].
1223 ///
1224 /// # Example
1225 /// ```ignore,no_run
1226 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1227 /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
1228 /// let x = UpdateQueryTemplateRequest::new().set_query_template(QueryTemplate::default()/* use setters */);
1229 /// ```
1230 pub fn set_query_template<T>(mut self, v: T) -> Self
1231 where
1232 T: std::convert::Into<crate::model::QueryTemplate>,
1233 {
1234 self.query_template = std::option::Option::Some(v.into());
1235 self
1236 }
1237
1238 /// Sets or clears the value of [query_template][crate::model::UpdateQueryTemplateRequest::query_template].
1239 ///
1240 /// # Example
1241 /// ```ignore,no_run
1242 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1243 /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
1244 /// let x = UpdateQueryTemplateRequest::new().set_or_clear_query_template(Some(QueryTemplate::default()/* use setters */));
1245 /// let x = UpdateQueryTemplateRequest::new().set_or_clear_query_template(None::<QueryTemplate>);
1246 /// ```
1247 pub fn set_or_clear_query_template<T>(mut self, v: std::option::Option<T>) -> Self
1248 where
1249 T: std::convert::Into<crate::model::QueryTemplate>,
1250 {
1251 self.query_template = v.map(|x| x.into());
1252 self
1253 }
1254}
1255
1256impl wkt::message::Message for UpdateQueryTemplateRequest {
1257 fn typename() -> &'static str {
1258 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateQueryTemplateRequest"
1259 }
1260}
1261
1262/// Message for deleting a QueryTemplate.
1263#[derive(Clone, Default, PartialEq)]
1264#[non_exhaustive]
1265pub struct DeleteQueryTemplateRequest {
1266 /// Required. The resource path of the QueryTemplate.
1267 /// e.g.
1268 /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
1269 pub name: std::string::String,
1270
1271 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1272}
1273
1274impl DeleteQueryTemplateRequest {
1275 /// Creates a new default instance.
1276 pub fn new() -> Self {
1277 std::default::Default::default()
1278 }
1279
1280 /// Sets the value of [name][crate::model::DeleteQueryTemplateRequest::name].
1281 ///
1282 /// # Example
1283 /// ```ignore,no_run
1284 /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteQueryTemplateRequest;
1285 /// # let project_id = "project_id";
1286 /// # let location_id = "location_id";
1287 /// # let data_exchange_id = "data_exchange_id";
1288 /// # let query_template_id = "query_template_id";
1289 /// let x = DeleteQueryTemplateRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/queryTemplates/{query_template_id}"));
1290 /// ```
1291 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1292 self.name = v.into();
1293 self
1294 }
1295}
1296
1297impl wkt::message::Message for DeleteQueryTemplateRequest {
1298 fn typename() -> &'static str {
1299 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteQueryTemplateRequest"
1300 }
1301}
1302
1303/// Message for submitting a QueryTemplate.
1304#[derive(Clone, Default, PartialEq)]
1305#[non_exhaustive]
1306pub struct SubmitQueryTemplateRequest {
1307 /// Required. The resource path of the QueryTemplate.
1308 /// e.g.
1309 /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
1310 pub name: std::string::String,
1311
1312 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1313}
1314
1315impl SubmitQueryTemplateRequest {
1316 /// Creates a new default instance.
1317 pub fn new() -> Self {
1318 std::default::Default::default()
1319 }
1320
1321 /// Sets the value of [name][crate::model::SubmitQueryTemplateRequest::name].
1322 ///
1323 /// # Example
1324 /// ```ignore,no_run
1325 /// # use google_cloud_bigquery_analyticshub_v1::model::SubmitQueryTemplateRequest;
1326 /// # let project_id = "project_id";
1327 /// # let location_id = "location_id";
1328 /// # let data_exchange_id = "data_exchange_id";
1329 /// # let query_template_id = "query_template_id";
1330 /// let x = SubmitQueryTemplateRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/queryTemplates/{query_template_id}"));
1331 /// ```
1332 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1333 self.name = v.into();
1334 self
1335 }
1336}
1337
1338impl wkt::message::Message for SubmitQueryTemplateRequest {
1339 fn typename() -> &'static str {
1340 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubmitQueryTemplateRequest"
1341 }
1342}
1343
1344/// Message for approving a QueryTemplate.
1345#[derive(Clone, Default, PartialEq)]
1346#[non_exhaustive]
1347pub struct ApproveQueryTemplateRequest {
1348 /// Required. The resource path of the QueryTemplate.
1349 /// e.g.
1350 /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
1351 pub name: std::string::String,
1352
1353 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1354}
1355
1356impl ApproveQueryTemplateRequest {
1357 /// Creates a new default instance.
1358 pub fn new() -> Self {
1359 std::default::Default::default()
1360 }
1361
1362 /// Sets the value of [name][crate::model::ApproveQueryTemplateRequest::name].
1363 ///
1364 /// # Example
1365 /// ```ignore,no_run
1366 /// # use google_cloud_bigquery_analyticshub_v1::model::ApproveQueryTemplateRequest;
1367 /// # let project_id = "project_id";
1368 /// # let location_id = "location_id";
1369 /// # let data_exchange_id = "data_exchange_id";
1370 /// # let query_template_id = "query_template_id";
1371 /// let x = ApproveQueryTemplateRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/queryTemplates/{query_template_id}"));
1372 /// ```
1373 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1374 self.name = v.into();
1375 self
1376 }
1377}
1378
1379impl wkt::message::Message for ApproveQueryTemplateRequest {
1380 fn typename() -> &'static str {
1381 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ApproveQueryTemplateRequest"
1382 }
1383}
1384
1385/// Sharing environment is a behavior model for sharing data within a
1386/// data exchange. This option is configurable for a data exchange.
1387#[derive(Clone, Default, PartialEq)]
1388#[non_exhaustive]
1389pub struct SharingEnvironmentConfig {
1390 #[allow(missing_docs)]
1391 pub environment: std::option::Option<crate::model::sharing_environment_config::Environment>,
1392
1393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1394}
1395
1396impl SharingEnvironmentConfig {
1397 /// Creates a new default instance.
1398 pub fn new() -> Self {
1399 std::default::Default::default()
1400 }
1401
1402 /// Sets the value of [environment][crate::model::SharingEnvironmentConfig::environment].
1403 ///
1404 /// Note that all the setters affecting `environment` are mutually
1405 /// exclusive.
1406 ///
1407 /// # Example
1408 /// ```ignore,no_run
1409 /// # use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
1410 /// use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DefaultExchangeConfig;
1411 /// let x = SharingEnvironmentConfig::new().set_environment(Some(
1412 /// google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::Environment::DefaultExchangeConfig(DefaultExchangeConfig::default().into())));
1413 /// ```
1414 pub fn set_environment<
1415 T: std::convert::Into<
1416 std::option::Option<crate::model::sharing_environment_config::Environment>,
1417 >,
1418 >(
1419 mut self,
1420 v: T,
1421 ) -> Self {
1422 self.environment = v.into();
1423 self
1424 }
1425
1426 /// The value of [environment][crate::model::SharingEnvironmentConfig::environment]
1427 /// if it holds a `DefaultExchangeConfig`, `None` if the field is not set or
1428 /// holds a different branch.
1429 pub fn default_exchange_config(
1430 &self,
1431 ) -> std::option::Option<
1432 &std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1433 > {
1434 #[allow(unreachable_patterns)]
1435 self.environment.as_ref().and_then(|v| match v {
1436 crate::model::sharing_environment_config::Environment::DefaultExchangeConfig(v) => {
1437 std::option::Option::Some(v)
1438 }
1439 _ => std::option::Option::None,
1440 })
1441 }
1442
1443 /// Sets the value of [environment][crate::model::SharingEnvironmentConfig::environment]
1444 /// to hold a `DefaultExchangeConfig`.
1445 ///
1446 /// Note that all the setters affecting `environment` are
1447 /// mutually exclusive.
1448 ///
1449 /// # Example
1450 /// ```ignore,no_run
1451 /// # use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
1452 /// use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DefaultExchangeConfig;
1453 /// let x = SharingEnvironmentConfig::new().set_default_exchange_config(DefaultExchangeConfig::default()/* use setters */);
1454 /// assert!(x.default_exchange_config().is_some());
1455 /// assert!(x.dcr_exchange_config().is_none());
1456 /// ```
1457 pub fn set_default_exchange_config<
1458 T: std::convert::Into<
1459 std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1460 >,
1461 >(
1462 mut self,
1463 v: T,
1464 ) -> Self {
1465 self.environment = std::option::Option::Some(
1466 crate::model::sharing_environment_config::Environment::DefaultExchangeConfig(v.into()),
1467 );
1468 self
1469 }
1470
1471 /// The value of [environment][crate::model::SharingEnvironmentConfig::environment]
1472 /// if it holds a `DcrExchangeConfig`, `None` if the field is not set or
1473 /// holds a different branch.
1474 pub fn dcr_exchange_config(
1475 &self,
1476 ) -> std::option::Option<
1477 &std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1478 > {
1479 #[allow(unreachable_patterns)]
1480 self.environment.as_ref().and_then(|v| match v {
1481 crate::model::sharing_environment_config::Environment::DcrExchangeConfig(v) => {
1482 std::option::Option::Some(v)
1483 }
1484 _ => std::option::Option::None,
1485 })
1486 }
1487
1488 /// Sets the value of [environment][crate::model::SharingEnvironmentConfig::environment]
1489 /// to hold a `DcrExchangeConfig`.
1490 ///
1491 /// Note that all the setters affecting `environment` are
1492 /// mutually exclusive.
1493 ///
1494 /// # Example
1495 /// ```ignore,no_run
1496 /// # use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
1497 /// use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1498 /// let x = SharingEnvironmentConfig::new().set_dcr_exchange_config(DcrExchangeConfig::default()/* use setters */);
1499 /// assert!(x.dcr_exchange_config().is_some());
1500 /// assert!(x.default_exchange_config().is_none());
1501 /// ```
1502 pub fn set_dcr_exchange_config<
1503 T: std::convert::Into<
1504 std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1505 >,
1506 >(
1507 mut self,
1508 v: T,
1509 ) -> Self {
1510 self.environment = std::option::Option::Some(
1511 crate::model::sharing_environment_config::Environment::DcrExchangeConfig(v.into()),
1512 );
1513 self
1514 }
1515}
1516
1517impl wkt::message::Message for SharingEnvironmentConfig {
1518 fn typename() -> &'static str {
1519 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig"
1520 }
1521}
1522
1523/// Defines additional types related to [SharingEnvironmentConfig].
1524pub mod sharing_environment_config {
1525 #[allow(unused_imports)]
1526 use super::*;
1527
1528 /// Default Analytics Hub data exchange, used for secured data sharing.
1529 #[derive(Clone, Default, PartialEq)]
1530 #[non_exhaustive]
1531 pub struct DefaultExchangeConfig {
1532 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1533 }
1534
1535 impl DefaultExchangeConfig {
1536 /// Creates a new default instance.
1537 pub fn new() -> Self {
1538 std::default::Default::default()
1539 }
1540 }
1541
1542 impl wkt::message::Message for DefaultExchangeConfig {
1543 fn typename() -> &'static str {
1544 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DefaultExchangeConfig"
1545 }
1546 }
1547
1548 /// Data Clean Room (DCR), used for privacy-safe and secured data sharing.
1549 #[derive(Clone, Default, PartialEq)]
1550 #[non_exhaustive]
1551 pub struct DcrExchangeConfig {
1552 /// Output only. If True, this DCR restricts the contributors to sharing
1553 /// only a single resource in a Listing. And no two resources should have the
1554 /// same IDs. So if a contributor adds a view with a conflicting name, the
1555 /// CreateListing API will reject the request. if False, the data contributor
1556 /// can publish an entire dataset (as before). This is not configurable, and
1557 /// by default, all new DCRs will have the restriction set to True.
1558 pub single_selected_resource_sharing_restriction: std::option::Option<bool>,
1559
1560 /// Output only. If True, when subscribing to this DCR, it will create only
1561 /// one linked dataset containing all resources shared within the
1562 /// cleanroom. If False, when subscribing to this DCR, it will
1563 /// create 1 linked dataset per listing. This is not configurable, and by
1564 /// default, all new DCRs will have the restriction set to True.
1565 pub single_linked_dataset_per_cleanroom: std::option::Option<bool>,
1566
1567 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1568 }
1569
1570 impl DcrExchangeConfig {
1571 /// Creates a new default instance.
1572 pub fn new() -> Self {
1573 std::default::Default::default()
1574 }
1575
1576 /// Sets the value of [single_selected_resource_sharing_restriction][crate::model::sharing_environment_config::DcrExchangeConfig::single_selected_resource_sharing_restriction].
1577 ///
1578 /// # Example
1579 /// ```ignore,no_run
1580 /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1581 /// let x = DcrExchangeConfig::new().set_single_selected_resource_sharing_restriction(true);
1582 /// ```
1583 pub fn set_single_selected_resource_sharing_restriction<T>(mut self, v: T) -> Self
1584 where
1585 T: std::convert::Into<bool>,
1586 {
1587 self.single_selected_resource_sharing_restriction = std::option::Option::Some(v.into());
1588 self
1589 }
1590
1591 /// Sets or clears the value of [single_selected_resource_sharing_restriction][crate::model::sharing_environment_config::DcrExchangeConfig::single_selected_resource_sharing_restriction].
1592 ///
1593 /// # Example
1594 /// ```ignore,no_run
1595 /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1596 /// let x = DcrExchangeConfig::new().set_or_clear_single_selected_resource_sharing_restriction(Some(false));
1597 /// let x = DcrExchangeConfig::new().set_or_clear_single_selected_resource_sharing_restriction(None::<bool>);
1598 /// ```
1599 pub fn set_or_clear_single_selected_resource_sharing_restriction<T>(
1600 mut self,
1601 v: std::option::Option<T>,
1602 ) -> Self
1603 where
1604 T: std::convert::Into<bool>,
1605 {
1606 self.single_selected_resource_sharing_restriction = v.map(|x| x.into());
1607 self
1608 }
1609
1610 /// Sets the value of [single_linked_dataset_per_cleanroom][crate::model::sharing_environment_config::DcrExchangeConfig::single_linked_dataset_per_cleanroom].
1611 ///
1612 /// # Example
1613 /// ```ignore,no_run
1614 /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1615 /// let x = DcrExchangeConfig::new().set_single_linked_dataset_per_cleanroom(true);
1616 /// ```
1617 pub fn set_single_linked_dataset_per_cleanroom<T>(mut self, v: T) -> Self
1618 where
1619 T: std::convert::Into<bool>,
1620 {
1621 self.single_linked_dataset_per_cleanroom = std::option::Option::Some(v.into());
1622 self
1623 }
1624
1625 /// Sets or clears the value of [single_linked_dataset_per_cleanroom][crate::model::sharing_environment_config::DcrExchangeConfig::single_linked_dataset_per_cleanroom].
1626 ///
1627 /// # Example
1628 /// ```ignore,no_run
1629 /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1630 /// let x = DcrExchangeConfig::new().set_or_clear_single_linked_dataset_per_cleanroom(Some(false));
1631 /// let x = DcrExchangeConfig::new().set_or_clear_single_linked_dataset_per_cleanroom(None::<bool>);
1632 /// ```
1633 pub fn set_or_clear_single_linked_dataset_per_cleanroom<T>(
1634 mut self,
1635 v: std::option::Option<T>,
1636 ) -> Self
1637 where
1638 T: std::convert::Into<bool>,
1639 {
1640 self.single_linked_dataset_per_cleanroom = v.map(|x| x.into());
1641 self
1642 }
1643 }
1644
1645 impl wkt::message::Message for DcrExchangeConfig {
1646 fn typename() -> &'static str {
1647 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DcrExchangeConfig"
1648 }
1649 }
1650
1651 #[allow(missing_docs)]
1652 #[derive(Clone, Debug, PartialEq)]
1653 #[non_exhaustive]
1654 pub enum Environment {
1655 /// Default Analytics Hub data exchange, used for secured data sharing.
1656 DefaultExchangeConfig(
1657 std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1658 ),
1659 /// Data Clean Room (DCR), used for privacy-safe and secured data sharing.
1660 DcrExchangeConfig(
1661 std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1662 ),
1663 }
1664}
1665
1666/// Contains details of the data provider.
1667#[derive(Clone, Default, PartialEq)]
1668#[non_exhaustive]
1669pub struct DataProvider {
1670 /// Optional. Name of the data provider.
1671 pub name: std::string::String,
1672
1673 /// Optional. Email or URL of the data provider.
1674 /// Max Length: 1000 bytes.
1675 pub primary_contact: std::string::String,
1676
1677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1678}
1679
1680impl DataProvider {
1681 /// Creates a new default instance.
1682 pub fn new() -> Self {
1683 std::default::Default::default()
1684 }
1685
1686 /// Sets the value of [name][crate::model::DataProvider::name].
1687 ///
1688 /// # Example
1689 /// ```ignore,no_run
1690 /// # use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
1691 /// let x = DataProvider::new().set_name("example");
1692 /// ```
1693 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1694 self.name = v.into();
1695 self
1696 }
1697
1698 /// Sets the value of [primary_contact][crate::model::DataProvider::primary_contact].
1699 ///
1700 /// # Example
1701 /// ```ignore,no_run
1702 /// # use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
1703 /// let x = DataProvider::new().set_primary_contact("example");
1704 /// ```
1705 pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1706 self.primary_contact = v.into();
1707 self
1708 }
1709}
1710
1711impl wkt::message::Message for DataProvider {
1712 fn typename() -> &'static str {
1713 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DataProvider"
1714 }
1715}
1716
1717/// Contains details of the listing publisher.
1718#[derive(Clone, Default, PartialEq)]
1719#[non_exhaustive]
1720pub struct Publisher {
1721 /// Optional. Name of the listing publisher.
1722 pub name: std::string::String,
1723
1724 /// Optional. Email or URL of the listing publisher.
1725 /// Max Length: 1000 bytes.
1726 pub primary_contact: std::string::String,
1727
1728 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1729}
1730
1731impl Publisher {
1732 /// Creates a new default instance.
1733 pub fn new() -> Self {
1734 std::default::Default::default()
1735 }
1736
1737 /// Sets the value of [name][crate::model::Publisher::name].
1738 ///
1739 /// # Example
1740 /// ```ignore,no_run
1741 /// # use google_cloud_bigquery_analyticshub_v1::model::Publisher;
1742 /// let x = Publisher::new().set_name("example");
1743 /// ```
1744 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1745 self.name = v.into();
1746 self
1747 }
1748
1749 /// Sets the value of [primary_contact][crate::model::Publisher::primary_contact].
1750 ///
1751 /// # Example
1752 /// ```ignore,no_run
1753 /// # use google_cloud_bigquery_analyticshub_v1::model::Publisher;
1754 /// let x = Publisher::new().set_primary_contact("example");
1755 /// ```
1756 pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1757 self.primary_contact = v.into();
1758 self
1759 }
1760}
1761
1762impl wkt::message::Message for Publisher {
1763 fn typename() -> &'static str {
1764 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Publisher"
1765 }
1766}
1767
1768#[allow(missing_docs)]
1769#[derive(Clone, Default, PartialEq)]
1770#[non_exhaustive]
1771pub struct DestinationDatasetReference {
1772 /// Required. A unique ID for this dataset, without the project name. The ID
1773 /// must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
1774 /// The maximum length is 1,024 characters.
1775 pub dataset_id: std::string::String,
1776
1777 /// Required. The ID of the project containing this dataset.
1778 pub project_id: std::string::String,
1779
1780 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1781}
1782
1783impl DestinationDatasetReference {
1784 /// Creates a new default instance.
1785 pub fn new() -> Self {
1786 std::default::Default::default()
1787 }
1788
1789 /// Sets the value of [dataset_id][crate::model::DestinationDatasetReference::dataset_id].
1790 ///
1791 /// # Example
1792 /// ```ignore,no_run
1793 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1794 /// let x = DestinationDatasetReference::new().set_dataset_id("example");
1795 /// ```
1796 pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1797 self.dataset_id = v.into();
1798 self
1799 }
1800
1801 /// Sets the value of [project_id][crate::model::DestinationDatasetReference::project_id].
1802 ///
1803 /// # Example
1804 /// ```ignore,no_run
1805 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1806 /// let x = DestinationDatasetReference::new().set_project_id("example");
1807 /// ```
1808 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1809 self.project_id = v.into();
1810 self
1811 }
1812}
1813
1814impl wkt::message::Message for DestinationDatasetReference {
1815 fn typename() -> &'static str {
1816 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference"
1817 }
1818}
1819
1820/// Defines the destination bigquery dataset.
1821#[derive(Clone, Default, PartialEq)]
1822#[non_exhaustive]
1823pub struct DestinationDataset {
1824 /// Required. A reference that identifies the destination dataset.
1825 pub dataset_reference: std::option::Option<crate::model::DestinationDatasetReference>,
1826
1827 /// Optional. A descriptive name for the dataset.
1828 pub friendly_name: std::option::Option<wkt::StringValue>,
1829
1830 /// Optional. A user-friendly description of the dataset.
1831 pub description: std::option::Option<wkt::StringValue>,
1832
1833 /// Optional. The labels associated with this dataset. You can use these
1834 /// to organize and group your datasets.
1835 /// You can set this property when inserting or updating a dataset.
1836 /// See <https://cloud.google.com/resource-manager/docs/creating-managing-labels>
1837 /// for more information.
1838 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1839
1840 /// Required. The geographic location where the dataset should reside. See
1841 /// <https://cloud.google.com/bigquery/docs/locations> for supported
1842 /// locations.
1843 pub location: std::string::String,
1844
1845 /// Optional. The geographic locations where the dataset should be replicated.
1846 /// See [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
1847 /// for supported locations.
1848 pub replica_locations: std::vec::Vec<std::string::String>,
1849
1850 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1851}
1852
1853impl DestinationDataset {
1854 /// Creates a new default instance.
1855 pub fn new() -> Self {
1856 std::default::Default::default()
1857 }
1858
1859 /// Sets the value of [dataset_reference][crate::model::DestinationDataset::dataset_reference].
1860 ///
1861 /// # Example
1862 /// ```ignore,no_run
1863 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1864 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1865 /// let x = DestinationDataset::new().set_dataset_reference(DestinationDatasetReference::default()/* use setters */);
1866 /// ```
1867 pub fn set_dataset_reference<T>(mut self, v: T) -> Self
1868 where
1869 T: std::convert::Into<crate::model::DestinationDatasetReference>,
1870 {
1871 self.dataset_reference = std::option::Option::Some(v.into());
1872 self
1873 }
1874
1875 /// Sets or clears the value of [dataset_reference][crate::model::DestinationDataset::dataset_reference].
1876 ///
1877 /// # Example
1878 /// ```ignore,no_run
1879 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1880 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1881 /// let x = DestinationDataset::new().set_or_clear_dataset_reference(Some(DestinationDatasetReference::default()/* use setters */));
1882 /// let x = DestinationDataset::new().set_or_clear_dataset_reference(None::<DestinationDatasetReference>);
1883 /// ```
1884 pub fn set_or_clear_dataset_reference<T>(mut self, v: std::option::Option<T>) -> Self
1885 where
1886 T: std::convert::Into<crate::model::DestinationDatasetReference>,
1887 {
1888 self.dataset_reference = v.map(|x| x.into());
1889 self
1890 }
1891
1892 /// Sets the value of [friendly_name][crate::model::DestinationDataset::friendly_name].
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_friendly_name(StringValue::default()/* use setters */);
1899 /// ```
1900 pub fn set_friendly_name<T>(mut self, v: T) -> Self
1901 where
1902 T: std::convert::Into<wkt::StringValue>,
1903 {
1904 self.friendly_name = std::option::Option::Some(v.into());
1905 self
1906 }
1907
1908 /// Sets or clears the value of [friendly_name][crate::model::DestinationDataset::friendly_name].
1909 ///
1910 /// # Example
1911 /// ```ignore,no_run
1912 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1913 /// use wkt::StringValue;
1914 /// let x = DestinationDataset::new().set_or_clear_friendly_name(Some(StringValue::default()/* use setters */));
1915 /// let x = DestinationDataset::new().set_or_clear_friendly_name(None::<StringValue>);
1916 /// ```
1917 pub fn set_or_clear_friendly_name<T>(mut self, v: std::option::Option<T>) -> Self
1918 where
1919 T: std::convert::Into<wkt::StringValue>,
1920 {
1921 self.friendly_name = v.map(|x| x.into());
1922 self
1923 }
1924
1925 /// Sets the value of [description][crate::model::DestinationDataset::description].
1926 ///
1927 /// # Example
1928 /// ```ignore,no_run
1929 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1930 /// use wkt::StringValue;
1931 /// let x = DestinationDataset::new().set_description(StringValue::default()/* use setters */);
1932 /// ```
1933 pub fn set_description<T>(mut self, v: T) -> Self
1934 where
1935 T: std::convert::Into<wkt::StringValue>,
1936 {
1937 self.description = std::option::Option::Some(v.into());
1938 self
1939 }
1940
1941 /// Sets or clears the value of [description][crate::model::DestinationDataset::description].
1942 ///
1943 /// # Example
1944 /// ```ignore,no_run
1945 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1946 /// use wkt::StringValue;
1947 /// let x = DestinationDataset::new().set_or_clear_description(Some(StringValue::default()/* use setters */));
1948 /// let x = DestinationDataset::new().set_or_clear_description(None::<StringValue>);
1949 /// ```
1950 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
1951 where
1952 T: std::convert::Into<wkt::StringValue>,
1953 {
1954 self.description = v.map(|x| x.into());
1955 self
1956 }
1957
1958 /// Sets the value of [labels][crate::model::DestinationDataset::labels].
1959 ///
1960 /// # Example
1961 /// ```ignore,no_run
1962 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1963 /// let x = DestinationDataset::new().set_labels([
1964 /// ("key0", "abc"),
1965 /// ("key1", "xyz"),
1966 /// ]);
1967 /// ```
1968 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1969 where
1970 T: std::iter::IntoIterator<Item = (K, V)>,
1971 K: std::convert::Into<std::string::String>,
1972 V: std::convert::Into<std::string::String>,
1973 {
1974 use std::iter::Iterator;
1975 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1976 self
1977 }
1978
1979 /// Sets the value of [location][crate::model::DestinationDataset::location].
1980 ///
1981 /// # Example
1982 /// ```ignore,no_run
1983 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1984 /// let x = DestinationDataset::new().set_location("example");
1985 /// ```
1986 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1987 self.location = v.into();
1988 self
1989 }
1990
1991 /// Sets the value of [replica_locations][crate::model::DestinationDataset::replica_locations].
1992 ///
1993 /// # Example
1994 /// ```ignore,no_run
1995 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1996 /// let x = DestinationDataset::new().set_replica_locations(["a", "b", "c"]);
1997 /// ```
1998 pub fn set_replica_locations<T, V>(mut self, v: T) -> Self
1999 where
2000 T: std::iter::IntoIterator<Item = V>,
2001 V: std::convert::Into<std::string::String>,
2002 {
2003 use std::iter::Iterator;
2004 self.replica_locations = v.into_iter().map(|i| i.into()).collect();
2005 self
2006 }
2007}
2008
2009impl wkt::message::Message for DestinationDataset {
2010 fn typename() -> &'static str {
2011 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationDataset"
2012 }
2013}
2014
2015/// Defines the destination Pub/Sub subscription.
2016#[derive(Clone, Default, PartialEq)]
2017#[non_exhaustive]
2018pub struct DestinationPubSubSubscription {
2019 /// Required. Destination Pub/Sub subscription resource.
2020 pub pubsub_subscription: std::option::Option<crate::model::PubSubSubscription>,
2021
2022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2023}
2024
2025impl DestinationPubSubSubscription {
2026 /// Creates a new default instance.
2027 pub fn new() -> Self {
2028 std::default::Default::default()
2029 }
2030
2031 /// Sets the value of [pubsub_subscription][crate::model::DestinationPubSubSubscription::pubsub_subscription].
2032 ///
2033 /// # Example
2034 /// ```ignore,no_run
2035 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationPubSubSubscription;
2036 /// use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
2037 /// let x = DestinationPubSubSubscription::new().set_pubsub_subscription(PubSubSubscription::default()/* use setters */);
2038 /// ```
2039 pub fn set_pubsub_subscription<T>(mut self, v: T) -> Self
2040 where
2041 T: std::convert::Into<crate::model::PubSubSubscription>,
2042 {
2043 self.pubsub_subscription = std::option::Option::Some(v.into());
2044 self
2045 }
2046
2047 /// Sets or clears the value of [pubsub_subscription][crate::model::DestinationPubSubSubscription::pubsub_subscription].
2048 ///
2049 /// # Example
2050 /// ```ignore,no_run
2051 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationPubSubSubscription;
2052 /// use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
2053 /// let x = DestinationPubSubSubscription::new().set_or_clear_pubsub_subscription(Some(PubSubSubscription::default()/* use setters */));
2054 /// let x = DestinationPubSubSubscription::new().set_or_clear_pubsub_subscription(None::<PubSubSubscription>);
2055 /// ```
2056 pub fn set_or_clear_pubsub_subscription<T>(mut self, v: std::option::Option<T>) -> Self
2057 where
2058 T: std::convert::Into<crate::model::PubSubSubscription>,
2059 {
2060 self.pubsub_subscription = v.map(|x| x.into());
2061 self
2062 }
2063}
2064
2065impl wkt::message::Message for DestinationPubSubSubscription {
2066 fn typename() -> &'static str {
2067 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationPubSubSubscription"
2068 }
2069}
2070
2071/// A listing is what gets published into a data exchange that a subscriber can
2072/// subscribe to. It contains a reference to the data source along with
2073/// descriptive information that will help subscribers find and subscribe the
2074/// data.
2075#[derive(Clone, Default, PartialEq)]
2076#[non_exhaustive]
2077pub struct Listing {
2078 /// Output only. The resource name of the listing.
2079 /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`
2080 pub name: std::string::String,
2081
2082 /// Required. Human-readable display name of the listing. The display name must
2083 /// contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
2084 /// spaces ( ), ampersands (&) and can't start or end with spaces. Default
2085 /// value is an empty string. Max length: 63 bytes.
2086 pub display_name: std::string::String,
2087
2088 /// Optional. Short description of the listing. The description must not
2089 /// contain Unicode non-characters and C0 and C1 control codes except tabs
2090 /// (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
2091 /// value is an empty string. Max length: 2000 bytes.
2092 pub description: std::string::String,
2093
2094 /// Optional. Email or URL of the primary point of contact of the listing.
2095 /// Max Length: 1000 bytes.
2096 pub primary_contact: std::string::String,
2097
2098 /// Optional. Documentation describing the listing.
2099 pub documentation: std::string::String,
2100
2101 /// Output only. Current state of the listing.
2102 pub state: crate::model::listing::State,
2103
2104 /// Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB
2105 /// Expected image dimensions are 512x512 pixels, however the API only
2106 /// performs validation on size of the encoded data.
2107 /// Note: For byte fields, the contents of the field are base64-encoded (which
2108 /// increases the size of the data by 33-36%) when using JSON on the wire.
2109 pub icon: ::bytes::Bytes,
2110
2111 /// Optional. Details of the data provider who owns the source data.
2112 pub data_provider: std::option::Option<crate::model::DataProvider>,
2113
2114 /// Optional. Categories of the listing. Up to five categories are allowed.
2115 pub categories: std::vec::Vec<crate::model::listing::Category>,
2116
2117 /// Optional. Details of the publisher who owns the listing and who can share
2118 /// the source data.
2119 pub publisher: std::option::Option<crate::model::Publisher>,
2120
2121 /// Optional. Email or URL of the request access of the listing.
2122 /// Subscribers can use this reference to request access.
2123 /// Max Length: 1000 bytes.
2124 pub request_access: std::string::String,
2125
2126 /// Optional. If set, restricted export configuration will be propagated and
2127 /// enforced on the linked dataset.
2128 pub restricted_export_config:
2129 std::option::Option<crate::model::listing::RestrictedExportConfig>,
2130
2131 /// Optional. If set, stored procedure configuration will be propagated and
2132 /// enforced on the linked dataset.
2133 pub stored_procedure_config: std::option::Option<crate::model::StoredProcedureConfig>,
2134
2135 /// Optional. Type of discovery of the listing on the discovery page.
2136 pub discovery_type: std::option::Option<crate::model::DiscoveryType>,
2137
2138 /// Output only. Listing shared asset type.
2139 pub resource_type: crate::model::SharedResourceType,
2140
2141 /// Output only. Commercial info contains the information about the commercial
2142 /// data products associated with the listing.
2143 pub commercial_info: std::option::Option<crate::model::listing::CommercialInfo>,
2144
2145 /// Optional. By default, false.
2146 /// If true, the Listing has an email sharing mandate enabled.
2147 pub log_linked_dataset_query_user_email: std::option::Option<bool>,
2148
2149 /// Optional. If true, the listing is only available to get the resource
2150 /// metadata. Listing is non subscribable.
2151 pub allow_only_metadata_sharing: std::option::Option<bool>,
2152
2153 /// Listing source.
2154 pub source: std::option::Option<crate::model::listing::Source>,
2155
2156 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2157}
2158
2159impl Listing {
2160 /// Creates a new default instance.
2161 pub fn new() -> Self {
2162 std::default::Default::default()
2163 }
2164
2165 /// Sets the value of [name][crate::model::Listing::name].
2166 ///
2167 /// # Example
2168 /// ```ignore,no_run
2169 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2170 /// # let project_id = "project_id";
2171 /// # let location_id = "location_id";
2172 /// # let data_exchange_id = "data_exchange_id";
2173 /// # let listing_id = "listing_id";
2174 /// let x = Listing::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/listings/{listing_id}"));
2175 /// ```
2176 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2177 self.name = v.into();
2178 self
2179 }
2180
2181 /// Sets the value of [display_name][crate::model::Listing::display_name].
2182 ///
2183 /// # Example
2184 /// ```ignore,no_run
2185 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2186 /// let x = Listing::new().set_display_name("example");
2187 /// ```
2188 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2189 self.display_name = v.into();
2190 self
2191 }
2192
2193 /// Sets the value of [description][crate::model::Listing::description].
2194 ///
2195 /// # Example
2196 /// ```ignore,no_run
2197 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2198 /// let x = Listing::new().set_description("example");
2199 /// ```
2200 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2201 self.description = v.into();
2202 self
2203 }
2204
2205 /// Sets the value of [primary_contact][crate::model::Listing::primary_contact].
2206 ///
2207 /// # Example
2208 /// ```ignore,no_run
2209 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2210 /// let x = Listing::new().set_primary_contact("example");
2211 /// ```
2212 pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2213 self.primary_contact = v.into();
2214 self
2215 }
2216
2217 /// Sets the value of [documentation][crate::model::Listing::documentation].
2218 ///
2219 /// # Example
2220 /// ```ignore,no_run
2221 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2222 /// let x = Listing::new().set_documentation("example");
2223 /// ```
2224 pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2225 self.documentation = v.into();
2226 self
2227 }
2228
2229 /// Sets the value of [state][crate::model::Listing::state].
2230 ///
2231 /// # Example
2232 /// ```ignore,no_run
2233 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2234 /// use google_cloud_bigquery_analyticshub_v1::model::listing::State;
2235 /// let x0 = Listing::new().set_state(State::Active);
2236 /// ```
2237 pub fn set_state<T: std::convert::Into<crate::model::listing::State>>(mut self, v: T) -> Self {
2238 self.state = v.into();
2239 self
2240 }
2241
2242 /// Sets the value of [icon][crate::model::Listing::icon].
2243 ///
2244 /// # Example
2245 /// ```ignore,no_run
2246 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2247 /// let x = Listing::new().set_icon(bytes::Bytes::from_static(b"example"));
2248 /// ```
2249 pub fn set_icon<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2250 self.icon = v.into();
2251 self
2252 }
2253
2254 /// Sets the value of [data_provider][crate::model::Listing::data_provider].
2255 ///
2256 /// # Example
2257 /// ```ignore,no_run
2258 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2259 /// use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
2260 /// let x = Listing::new().set_data_provider(DataProvider::default()/* use setters */);
2261 /// ```
2262 pub fn set_data_provider<T>(mut self, v: T) -> Self
2263 where
2264 T: std::convert::Into<crate::model::DataProvider>,
2265 {
2266 self.data_provider = std::option::Option::Some(v.into());
2267 self
2268 }
2269
2270 /// Sets or clears the value of [data_provider][crate::model::Listing::data_provider].
2271 ///
2272 /// # Example
2273 /// ```ignore,no_run
2274 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2275 /// use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
2276 /// let x = Listing::new().set_or_clear_data_provider(Some(DataProvider::default()/* use setters */));
2277 /// let x = Listing::new().set_or_clear_data_provider(None::<DataProvider>);
2278 /// ```
2279 pub fn set_or_clear_data_provider<T>(mut self, v: std::option::Option<T>) -> Self
2280 where
2281 T: std::convert::Into<crate::model::DataProvider>,
2282 {
2283 self.data_provider = v.map(|x| x.into());
2284 self
2285 }
2286
2287 /// Sets the value of [categories][crate::model::Listing::categories].
2288 ///
2289 /// # Example
2290 /// ```ignore,no_run
2291 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2292 /// use google_cloud_bigquery_analyticshub_v1::model::listing::Category;
2293 /// let x = Listing::new().set_categories([
2294 /// Category::Others,
2295 /// Category::AdvertisingAndMarketing,
2296 /// Category::Commerce,
2297 /// ]);
2298 /// ```
2299 pub fn set_categories<T, V>(mut self, v: T) -> Self
2300 where
2301 T: std::iter::IntoIterator<Item = V>,
2302 V: std::convert::Into<crate::model::listing::Category>,
2303 {
2304 use std::iter::Iterator;
2305 self.categories = v.into_iter().map(|i| i.into()).collect();
2306 self
2307 }
2308
2309 /// Sets the value of [publisher][crate::model::Listing::publisher].
2310 ///
2311 /// # Example
2312 /// ```ignore,no_run
2313 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2314 /// use google_cloud_bigquery_analyticshub_v1::model::Publisher;
2315 /// let x = Listing::new().set_publisher(Publisher::default()/* use setters */);
2316 /// ```
2317 pub fn set_publisher<T>(mut self, v: T) -> Self
2318 where
2319 T: std::convert::Into<crate::model::Publisher>,
2320 {
2321 self.publisher = std::option::Option::Some(v.into());
2322 self
2323 }
2324
2325 /// Sets or clears the value of [publisher][crate::model::Listing::publisher].
2326 ///
2327 /// # Example
2328 /// ```ignore,no_run
2329 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2330 /// use google_cloud_bigquery_analyticshub_v1::model::Publisher;
2331 /// let x = Listing::new().set_or_clear_publisher(Some(Publisher::default()/* use setters */));
2332 /// let x = Listing::new().set_or_clear_publisher(None::<Publisher>);
2333 /// ```
2334 pub fn set_or_clear_publisher<T>(mut self, v: std::option::Option<T>) -> Self
2335 where
2336 T: std::convert::Into<crate::model::Publisher>,
2337 {
2338 self.publisher = v.map(|x| x.into());
2339 self
2340 }
2341
2342 /// Sets the value of [request_access][crate::model::Listing::request_access].
2343 ///
2344 /// # Example
2345 /// ```ignore,no_run
2346 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2347 /// let x = Listing::new().set_request_access("example");
2348 /// ```
2349 pub fn set_request_access<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2350 self.request_access = v.into();
2351 self
2352 }
2353
2354 /// Sets the value of [restricted_export_config][crate::model::Listing::restricted_export_config].
2355 ///
2356 /// # Example
2357 /// ```ignore,no_run
2358 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2359 /// use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
2360 /// let x = Listing::new().set_restricted_export_config(RestrictedExportConfig::default()/* use setters */);
2361 /// ```
2362 pub fn set_restricted_export_config<T>(mut self, v: T) -> Self
2363 where
2364 T: std::convert::Into<crate::model::listing::RestrictedExportConfig>,
2365 {
2366 self.restricted_export_config = std::option::Option::Some(v.into());
2367 self
2368 }
2369
2370 /// Sets or clears the value of [restricted_export_config][crate::model::Listing::restricted_export_config].
2371 ///
2372 /// # Example
2373 /// ```ignore,no_run
2374 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2375 /// use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
2376 /// let x = Listing::new().set_or_clear_restricted_export_config(Some(RestrictedExportConfig::default()/* use setters */));
2377 /// let x = Listing::new().set_or_clear_restricted_export_config(None::<RestrictedExportConfig>);
2378 /// ```
2379 pub fn set_or_clear_restricted_export_config<T>(mut self, v: std::option::Option<T>) -> Self
2380 where
2381 T: std::convert::Into<crate::model::listing::RestrictedExportConfig>,
2382 {
2383 self.restricted_export_config = v.map(|x| x.into());
2384 self
2385 }
2386
2387 /// Sets the value of [stored_procedure_config][crate::model::Listing::stored_procedure_config].
2388 ///
2389 /// # Example
2390 /// ```ignore,no_run
2391 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2392 /// use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
2393 /// let x = Listing::new().set_stored_procedure_config(StoredProcedureConfig::default()/* use setters */);
2394 /// ```
2395 pub fn set_stored_procedure_config<T>(mut self, v: T) -> Self
2396 where
2397 T: std::convert::Into<crate::model::StoredProcedureConfig>,
2398 {
2399 self.stored_procedure_config = std::option::Option::Some(v.into());
2400 self
2401 }
2402
2403 /// Sets or clears the value of [stored_procedure_config][crate::model::Listing::stored_procedure_config].
2404 ///
2405 /// # Example
2406 /// ```ignore,no_run
2407 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2408 /// use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
2409 /// let x = Listing::new().set_or_clear_stored_procedure_config(Some(StoredProcedureConfig::default()/* use setters */));
2410 /// let x = Listing::new().set_or_clear_stored_procedure_config(None::<StoredProcedureConfig>);
2411 /// ```
2412 pub fn set_or_clear_stored_procedure_config<T>(mut self, v: std::option::Option<T>) -> Self
2413 where
2414 T: std::convert::Into<crate::model::StoredProcedureConfig>,
2415 {
2416 self.stored_procedure_config = v.map(|x| x.into());
2417 self
2418 }
2419
2420 /// Sets the value of [discovery_type][crate::model::Listing::discovery_type].
2421 ///
2422 /// # Example
2423 /// ```ignore,no_run
2424 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2425 /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
2426 /// let x0 = Listing::new().set_discovery_type(DiscoveryType::Private);
2427 /// let x1 = Listing::new().set_discovery_type(DiscoveryType::Public);
2428 /// ```
2429 pub fn set_discovery_type<T>(mut self, v: T) -> Self
2430 where
2431 T: std::convert::Into<crate::model::DiscoveryType>,
2432 {
2433 self.discovery_type = std::option::Option::Some(v.into());
2434 self
2435 }
2436
2437 /// Sets or clears the value of [discovery_type][crate::model::Listing::discovery_type].
2438 ///
2439 /// # Example
2440 /// ```ignore,no_run
2441 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2442 /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
2443 /// let x0 = Listing::new().set_or_clear_discovery_type(Some(DiscoveryType::Private));
2444 /// let x1 = Listing::new().set_or_clear_discovery_type(Some(DiscoveryType::Public));
2445 /// let x_none = Listing::new().set_or_clear_discovery_type(None::<DiscoveryType>);
2446 /// ```
2447 pub fn set_or_clear_discovery_type<T>(mut self, v: std::option::Option<T>) -> Self
2448 where
2449 T: std::convert::Into<crate::model::DiscoveryType>,
2450 {
2451 self.discovery_type = v.map(|x| x.into());
2452 self
2453 }
2454
2455 /// Sets the value of [resource_type][crate::model::Listing::resource_type].
2456 ///
2457 /// # Example
2458 /// ```ignore,no_run
2459 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2460 /// use google_cloud_bigquery_analyticshub_v1::model::SharedResourceType;
2461 /// let x0 = Listing::new().set_resource_type(SharedResourceType::BigqueryDataset);
2462 /// let x1 = Listing::new().set_resource_type(SharedResourceType::PubsubTopic);
2463 /// ```
2464 pub fn set_resource_type<T: std::convert::Into<crate::model::SharedResourceType>>(
2465 mut self,
2466 v: T,
2467 ) -> Self {
2468 self.resource_type = v.into();
2469 self
2470 }
2471
2472 /// Sets the value of [commercial_info][crate::model::Listing::commercial_info].
2473 ///
2474 /// # Example
2475 /// ```ignore,no_run
2476 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2477 /// use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
2478 /// let x = Listing::new().set_commercial_info(CommercialInfo::default()/* use setters */);
2479 /// ```
2480 pub fn set_commercial_info<T>(mut self, v: T) -> Self
2481 where
2482 T: std::convert::Into<crate::model::listing::CommercialInfo>,
2483 {
2484 self.commercial_info = std::option::Option::Some(v.into());
2485 self
2486 }
2487
2488 /// Sets or clears the value of [commercial_info][crate::model::Listing::commercial_info].
2489 ///
2490 /// # Example
2491 /// ```ignore,no_run
2492 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2493 /// use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
2494 /// let x = Listing::new().set_or_clear_commercial_info(Some(CommercialInfo::default()/* use setters */));
2495 /// let x = Listing::new().set_or_clear_commercial_info(None::<CommercialInfo>);
2496 /// ```
2497 pub fn set_or_clear_commercial_info<T>(mut self, v: std::option::Option<T>) -> Self
2498 where
2499 T: std::convert::Into<crate::model::listing::CommercialInfo>,
2500 {
2501 self.commercial_info = v.map(|x| x.into());
2502 self
2503 }
2504
2505 /// Sets the value of [log_linked_dataset_query_user_email][crate::model::Listing::log_linked_dataset_query_user_email].
2506 ///
2507 /// # Example
2508 /// ```ignore,no_run
2509 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2510 /// let x = Listing::new().set_log_linked_dataset_query_user_email(true);
2511 /// ```
2512 pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
2513 where
2514 T: std::convert::Into<bool>,
2515 {
2516 self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
2517 self
2518 }
2519
2520 /// Sets or clears the value of [log_linked_dataset_query_user_email][crate::model::Listing::log_linked_dataset_query_user_email].
2521 ///
2522 /// # Example
2523 /// ```ignore,no_run
2524 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2525 /// let x = Listing::new().set_or_clear_log_linked_dataset_query_user_email(Some(false));
2526 /// let x = Listing::new().set_or_clear_log_linked_dataset_query_user_email(None::<bool>);
2527 /// ```
2528 pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
2529 mut self,
2530 v: std::option::Option<T>,
2531 ) -> Self
2532 where
2533 T: std::convert::Into<bool>,
2534 {
2535 self.log_linked_dataset_query_user_email = v.map(|x| x.into());
2536 self
2537 }
2538
2539 /// Sets the value of [allow_only_metadata_sharing][crate::model::Listing::allow_only_metadata_sharing].
2540 ///
2541 /// # Example
2542 /// ```ignore,no_run
2543 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2544 /// let x = Listing::new().set_allow_only_metadata_sharing(true);
2545 /// ```
2546 pub fn set_allow_only_metadata_sharing<T>(mut self, v: T) -> Self
2547 where
2548 T: std::convert::Into<bool>,
2549 {
2550 self.allow_only_metadata_sharing = std::option::Option::Some(v.into());
2551 self
2552 }
2553
2554 /// Sets or clears the value of [allow_only_metadata_sharing][crate::model::Listing::allow_only_metadata_sharing].
2555 ///
2556 /// # Example
2557 /// ```ignore,no_run
2558 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2559 /// let x = Listing::new().set_or_clear_allow_only_metadata_sharing(Some(false));
2560 /// let x = Listing::new().set_or_clear_allow_only_metadata_sharing(None::<bool>);
2561 /// ```
2562 pub fn set_or_clear_allow_only_metadata_sharing<T>(mut self, v: std::option::Option<T>) -> Self
2563 where
2564 T: std::convert::Into<bool>,
2565 {
2566 self.allow_only_metadata_sharing = v.map(|x| x.into());
2567 self
2568 }
2569
2570 /// Sets the value of [source][crate::model::Listing::source].
2571 ///
2572 /// Note that all the setters affecting `source` are mutually
2573 /// exclusive.
2574 ///
2575 /// # Example
2576 /// ```ignore,no_run
2577 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2578 /// use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2579 /// let x = Listing::new().set_source(Some(
2580 /// google_cloud_bigquery_analyticshub_v1::model::listing::Source::BigqueryDataset(BigQueryDatasetSource::default().into())));
2581 /// ```
2582 pub fn set_source<T: std::convert::Into<std::option::Option<crate::model::listing::Source>>>(
2583 mut self,
2584 v: T,
2585 ) -> Self {
2586 self.source = v.into();
2587 self
2588 }
2589
2590 /// The value of [source][crate::model::Listing::source]
2591 /// if it holds a `BigqueryDataset`, `None` if the field is not set or
2592 /// holds a different branch.
2593 pub fn bigquery_dataset(
2594 &self,
2595 ) -> std::option::Option<&std::boxed::Box<crate::model::listing::BigQueryDatasetSource>> {
2596 #[allow(unreachable_patterns)]
2597 self.source.as_ref().and_then(|v| match v {
2598 crate::model::listing::Source::BigqueryDataset(v) => std::option::Option::Some(v),
2599 _ => std::option::Option::None,
2600 })
2601 }
2602
2603 /// Sets the value of [source][crate::model::Listing::source]
2604 /// to hold a `BigqueryDataset`.
2605 ///
2606 /// Note that all the setters affecting `source` are
2607 /// mutually exclusive.
2608 ///
2609 /// # Example
2610 /// ```ignore,no_run
2611 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2612 /// use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2613 /// let x = Listing::new().set_bigquery_dataset(BigQueryDatasetSource::default()/* use setters */);
2614 /// assert!(x.bigquery_dataset().is_some());
2615 /// assert!(x.pubsub_topic().is_none());
2616 /// ```
2617 pub fn set_bigquery_dataset<
2618 T: std::convert::Into<std::boxed::Box<crate::model::listing::BigQueryDatasetSource>>,
2619 >(
2620 mut self,
2621 v: T,
2622 ) -> Self {
2623 self.source =
2624 std::option::Option::Some(crate::model::listing::Source::BigqueryDataset(v.into()));
2625 self
2626 }
2627
2628 /// The value of [source][crate::model::Listing::source]
2629 /// if it holds a `PubsubTopic`, `None` if the field is not set or
2630 /// holds a different branch.
2631 pub fn pubsub_topic(
2632 &self,
2633 ) -> std::option::Option<&std::boxed::Box<crate::model::listing::PubSubTopicSource>> {
2634 #[allow(unreachable_patterns)]
2635 self.source.as_ref().and_then(|v| match v {
2636 crate::model::listing::Source::PubsubTopic(v) => std::option::Option::Some(v),
2637 _ => std::option::Option::None,
2638 })
2639 }
2640
2641 /// Sets the value of [source][crate::model::Listing::source]
2642 /// to hold a `PubsubTopic`.
2643 ///
2644 /// Note that all the setters affecting `source` are
2645 /// mutually exclusive.
2646 ///
2647 /// # Example
2648 /// ```ignore,no_run
2649 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2650 /// use google_cloud_bigquery_analyticshub_v1::model::listing::PubSubTopicSource;
2651 /// let x = Listing::new().set_pubsub_topic(PubSubTopicSource::default()/* use setters */);
2652 /// assert!(x.pubsub_topic().is_some());
2653 /// assert!(x.bigquery_dataset().is_none());
2654 /// ```
2655 pub fn set_pubsub_topic<
2656 T: std::convert::Into<std::boxed::Box<crate::model::listing::PubSubTopicSource>>,
2657 >(
2658 mut self,
2659 v: T,
2660 ) -> Self {
2661 self.source =
2662 std::option::Option::Some(crate::model::listing::Source::PubsubTopic(v.into()));
2663 self
2664 }
2665}
2666
2667impl wkt::message::Message for Listing {
2668 fn typename() -> &'static str {
2669 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing"
2670 }
2671}
2672
2673/// Defines additional types related to [Listing].
2674pub mod listing {
2675 #[allow(unused_imports)]
2676 use super::*;
2677
2678 /// A reference to a shared dataset. It is an existing BigQuery dataset with a
2679 /// collection of objects such as tables and views that you want to share
2680 /// with subscribers.
2681 /// When subscriber's subscribe to a listing, Analytics Hub creates a linked
2682 /// dataset in
2683 /// the subscriber's project. A Linked dataset is an opaque, read-only BigQuery
2684 /// dataset that serves as a _symbolic link_ to a shared dataset.
2685 #[derive(Clone, Default, PartialEq)]
2686 #[non_exhaustive]
2687 pub struct BigQueryDatasetSource {
2688 /// Optional. Resource name of the dataset source for this listing.
2689 /// e.g. `projects/myproject/datasets/123`
2690 pub dataset: std::string::String,
2691
2692 /// Optional. Resource in this dataset that is selectively shared.
2693 /// This field is required for data clean room exchanges.
2694 pub selected_resources:
2695 std::vec::Vec<crate::model::listing::big_query_dataset_source::SelectedResource>,
2696
2697 /// Optional. If set, restricted export policy will be propagated and
2698 /// enforced on the linked dataset.
2699 pub restricted_export_policy: std::option::Option<
2700 crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2701 >,
2702
2703 /// Optional. A list of regions where the publisher has created shared
2704 /// dataset replicas.
2705 pub replica_locations: std::vec::Vec<std::string::String>,
2706
2707 /// Output only. Server-owned effective state of replicas.
2708 /// Contains both primary and secondary replicas.
2709 /// Each replica includes a system-computed (output-only) state and primary
2710 /// designation.
2711 pub effective_replicas:
2712 std::vec::Vec<crate::model::listing::big_query_dataset_source::Replica>,
2713
2714 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2715 }
2716
2717 impl BigQueryDatasetSource {
2718 /// Creates a new default instance.
2719 pub fn new() -> Self {
2720 std::default::Default::default()
2721 }
2722
2723 /// Sets the value of [dataset][crate::model::listing::BigQueryDatasetSource::dataset].
2724 ///
2725 /// # Example
2726 /// ```ignore,no_run
2727 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2728 /// let x = BigQueryDatasetSource::new().set_dataset("example");
2729 /// ```
2730 pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2731 self.dataset = v.into();
2732 self
2733 }
2734
2735 /// Sets the value of [selected_resources][crate::model::listing::BigQueryDatasetSource::selected_resources].
2736 ///
2737 /// # Example
2738 /// ```ignore,no_run
2739 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2740 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2741 /// let x = BigQueryDatasetSource::new()
2742 /// .set_selected_resources([
2743 /// SelectedResource::default()/* use setters */,
2744 /// SelectedResource::default()/* use (different) setters */,
2745 /// ]);
2746 /// ```
2747 pub fn set_selected_resources<T, V>(mut self, v: T) -> Self
2748 where
2749 T: std::iter::IntoIterator<Item = V>,
2750 V: std::convert::Into<
2751 crate::model::listing::big_query_dataset_source::SelectedResource,
2752 >,
2753 {
2754 use std::iter::Iterator;
2755 self.selected_resources = v.into_iter().map(|i| i.into()).collect();
2756 self
2757 }
2758
2759 /// Sets the value of [restricted_export_policy][crate::model::listing::BigQueryDatasetSource::restricted_export_policy].
2760 ///
2761 /// # Example
2762 /// ```ignore,no_run
2763 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2764 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2765 /// let x = BigQueryDatasetSource::new().set_restricted_export_policy(RestrictedExportPolicy::default()/* use setters */);
2766 /// ```
2767 pub fn set_restricted_export_policy<T>(mut self, v: T) -> Self
2768 where
2769 T: std::convert::Into<
2770 crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2771 >,
2772 {
2773 self.restricted_export_policy = std::option::Option::Some(v.into());
2774 self
2775 }
2776
2777 /// Sets or clears the value of [restricted_export_policy][crate::model::listing::BigQueryDatasetSource::restricted_export_policy].
2778 ///
2779 /// # Example
2780 /// ```ignore,no_run
2781 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2782 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2783 /// let x = BigQueryDatasetSource::new().set_or_clear_restricted_export_policy(Some(RestrictedExportPolicy::default()/* use setters */));
2784 /// let x = BigQueryDatasetSource::new().set_or_clear_restricted_export_policy(None::<RestrictedExportPolicy>);
2785 /// ```
2786 pub fn set_or_clear_restricted_export_policy<T>(mut self, v: std::option::Option<T>) -> Self
2787 where
2788 T: std::convert::Into<
2789 crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2790 >,
2791 {
2792 self.restricted_export_policy = v.map(|x| x.into());
2793 self
2794 }
2795
2796 /// Sets the value of [replica_locations][crate::model::listing::BigQueryDatasetSource::replica_locations].
2797 ///
2798 /// # Example
2799 /// ```ignore,no_run
2800 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2801 /// let x = BigQueryDatasetSource::new().set_replica_locations(["a", "b", "c"]);
2802 /// ```
2803 pub fn set_replica_locations<T, V>(mut self, v: T) -> Self
2804 where
2805 T: std::iter::IntoIterator<Item = V>,
2806 V: std::convert::Into<std::string::String>,
2807 {
2808 use std::iter::Iterator;
2809 self.replica_locations = v.into_iter().map(|i| i.into()).collect();
2810 self
2811 }
2812
2813 /// Sets the value of [effective_replicas][crate::model::listing::BigQueryDatasetSource::effective_replicas].
2814 ///
2815 /// # Example
2816 /// ```ignore,no_run
2817 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2818 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
2819 /// let x = BigQueryDatasetSource::new()
2820 /// .set_effective_replicas([
2821 /// Replica::default()/* use setters */,
2822 /// Replica::default()/* use (different) setters */,
2823 /// ]);
2824 /// ```
2825 pub fn set_effective_replicas<T, V>(mut self, v: T) -> Self
2826 where
2827 T: std::iter::IntoIterator<Item = V>,
2828 V: std::convert::Into<crate::model::listing::big_query_dataset_source::Replica>,
2829 {
2830 use std::iter::Iterator;
2831 self.effective_replicas = v.into_iter().map(|i| i.into()).collect();
2832 self
2833 }
2834 }
2835
2836 impl wkt::message::Message for BigQueryDatasetSource {
2837 fn typename() -> &'static str {
2838 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource"
2839 }
2840 }
2841
2842 /// Defines additional types related to [BigQueryDatasetSource].
2843 pub mod big_query_dataset_source {
2844 #[allow(unused_imports)]
2845 use super::*;
2846
2847 /// Resource in this dataset that is selectively shared.
2848 #[derive(Clone, Default, PartialEq)]
2849 #[non_exhaustive]
2850 pub struct SelectedResource {
2851 #[allow(missing_docs)]
2852 pub resource: std::option::Option<
2853 crate::model::listing::big_query_dataset_source::selected_resource::Resource,
2854 >,
2855
2856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2857 }
2858
2859 impl SelectedResource {
2860 /// Creates a new default instance.
2861 pub fn new() -> Self {
2862 std::default::Default::default()
2863 }
2864
2865 /// Sets the value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource].
2866 ///
2867 /// Note that all the setters affecting `resource` are mutually
2868 /// exclusive.
2869 ///
2870 /// # Example
2871 /// ```ignore,no_run
2872 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2873 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::selected_resource::Resource;
2874 /// let x = SelectedResource::new().set_resource(Some(Resource::Table("example".to_string())));
2875 /// ```
2876 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
2877 {
2878 self.resource = v.into();
2879 self
2880 }
2881
2882 /// The value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2883 /// if it holds a `Table`, `None` if the field is not set or
2884 /// holds a different branch.
2885 pub fn table(&self) -> std::option::Option<&std::string::String> {
2886 #[allow(unreachable_patterns)]
2887 self.resource.as_ref().and_then(|v| match v {
2888 crate::model::listing::big_query_dataset_source::selected_resource::Resource::Table(v) => std::option::Option::Some(v),
2889 _ => std::option::Option::None,
2890 })
2891 }
2892
2893 /// Sets the value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2894 /// to hold a `Table`.
2895 ///
2896 /// Note that all the setters affecting `resource` are
2897 /// mutually exclusive.
2898 ///
2899 /// # Example
2900 /// ```ignore,no_run
2901 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2902 /// let x = SelectedResource::new().set_table("example");
2903 /// assert!(x.table().is_some());
2904 /// assert!(x.routine().is_none());
2905 /// ```
2906 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2907 self.resource = std::option::Option::Some(
2908 crate::model::listing::big_query_dataset_source::selected_resource::Resource::Table(
2909 v.into()
2910 )
2911 );
2912 self
2913 }
2914
2915 /// The value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2916 /// if it holds a `Routine`, `None` if the field is not set or
2917 /// holds a different branch.
2918 pub fn routine(&self) -> std::option::Option<&std::string::String> {
2919 #[allow(unreachable_patterns)]
2920 self.resource.as_ref().and_then(|v| match v {
2921 crate::model::listing::big_query_dataset_source::selected_resource::Resource::Routine(v) => std::option::Option::Some(v),
2922 _ => std::option::Option::None,
2923 })
2924 }
2925
2926 /// Sets the value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2927 /// to hold a `Routine`.
2928 ///
2929 /// Note that all the setters affecting `resource` are
2930 /// mutually exclusive.
2931 ///
2932 /// # Example
2933 /// ```ignore,no_run
2934 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2935 /// let x = SelectedResource::new().set_routine("example");
2936 /// assert!(x.routine().is_some());
2937 /// assert!(x.table().is_none());
2938 /// ```
2939 pub fn set_routine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2940 self.resource = std::option::Option::Some(
2941 crate::model::listing::big_query_dataset_source::selected_resource::Resource::Routine(
2942 v.into()
2943 )
2944 );
2945 self
2946 }
2947 }
2948
2949 impl wkt::message::Message for SelectedResource {
2950 fn typename() -> &'static str {
2951 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.SelectedResource"
2952 }
2953 }
2954
2955 /// Defines additional types related to [SelectedResource].
2956 pub mod selected_resource {
2957 #[allow(unused_imports)]
2958 use super::*;
2959
2960 #[allow(missing_docs)]
2961 #[derive(Clone, Debug, PartialEq)]
2962 #[non_exhaustive]
2963 pub enum Resource {
2964 /// Optional. Format:
2965 /// For table:
2966 /// `projects/{projectId}/datasets/{datasetId}/tables/{tableId}`
2967 /// Example:"projects/test_project/datasets/test_dataset/tables/test_table"
2968 Table(std::string::String),
2969 /// Optional. Format:
2970 /// For routine:
2971 /// `projects/{projectId}/datasets/{datasetId}/routines/{routineId}`
2972 /// Example:"projects/test_project/datasets/test_dataset/routines/test_routine"
2973 Routine(std::string::String),
2974 }
2975 }
2976
2977 /// Restricted export policy used to configure restricted export on linked
2978 /// dataset.
2979 #[derive(Clone, Default, PartialEq)]
2980 #[non_exhaustive]
2981 pub struct RestrictedExportPolicy {
2982 /// Optional. If true, enable restricted export.
2983 pub enabled: std::option::Option<wkt::BoolValue>,
2984
2985 /// Optional. If true, restrict direct table access (read
2986 /// api/tabledata.list) on linked table.
2987 pub restrict_direct_table_access: std::option::Option<wkt::BoolValue>,
2988
2989 /// Optional. If true, restrict export of query result derived from
2990 /// restricted linked dataset table.
2991 pub restrict_query_result: std::option::Option<wkt::BoolValue>,
2992
2993 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2994 }
2995
2996 impl RestrictedExportPolicy {
2997 /// Creates a new default instance.
2998 pub fn new() -> Self {
2999 std::default::Default::default()
3000 }
3001
3002 /// Sets the value of [enabled][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::enabled].
3003 ///
3004 /// # Example
3005 /// ```ignore,no_run
3006 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3007 /// use wkt::BoolValue;
3008 /// let x = RestrictedExportPolicy::new().set_enabled(BoolValue::default()/* use setters */);
3009 /// ```
3010 pub fn set_enabled<T>(mut self, v: T) -> Self
3011 where
3012 T: std::convert::Into<wkt::BoolValue>,
3013 {
3014 self.enabled = std::option::Option::Some(v.into());
3015 self
3016 }
3017
3018 /// Sets or clears the value of [enabled][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::enabled].
3019 ///
3020 /// # Example
3021 /// ```ignore,no_run
3022 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3023 /// use wkt::BoolValue;
3024 /// let x = RestrictedExportPolicy::new().set_or_clear_enabled(Some(BoolValue::default()/* use setters */));
3025 /// let x = RestrictedExportPolicy::new().set_or_clear_enabled(None::<BoolValue>);
3026 /// ```
3027 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
3028 where
3029 T: std::convert::Into<wkt::BoolValue>,
3030 {
3031 self.enabled = v.map(|x| x.into());
3032 self
3033 }
3034
3035 /// Sets the value of [restrict_direct_table_access][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_direct_table_access].
3036 ///
3037 /// # Example
3038 /// ```ignore,no_run
3039 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3040 /// use wkt::BoolValue;
3041 /// let x = RestrictedExportPolicy::new().set_restrict_direct_table_access(BoolValue::default()/* use setters */);
3042 /// ```
3043 pub fn set_restrict_direct_table_access<T>(mut self, v: T) -> Self
3044 where
3045 T: std::convert::Into<wkt::BoolValue>,
3046 {
3047 self.restrict_direct_table_access = std::option::Option::Some(v.into());
3048 self
3049 }
3050
3051 /// Sets or clears the value of [restrict_direct_table_access][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_direct_table_access].
3052 ///
3053 /// # Example
3054 /// ```ignore,no_run
3055 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3056 /// use wkt::BoolValue;
3057 /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_direct_table_access(Some(BoolValue::default()/* use setters */));
3058 /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_direct_table_access(None::<BoolValue>);
3059 /// ```
3060 pub fn set_or_clear_restrict_direct_table_access<T>(
3061 mut self,
3062 v: std::option::Option<T>,
3063 ) -> Self
3064 where
3065 T: std::convert::Into<wkt::BoolValue>,
3066 {
3067 self.restrict_direct_table_access = v.map(|x| x.into());
3068 self
3069 }
3070
3071 /// Sets the value of [restrict_query_result][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_query_result].
3072 ///
3073 /// # Example
3074 /// ```ignore,no_run
3075 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3076 /// use wkt::BoolValue;
3077 /// let x = RestrictedExportPolicy::new().set_restrict_query_result(BoolValue::default()/* use setters */);
3078 /// ```
3079 pub fn set_restrict_query_result<T>(mut self, v: T) -> Self
3080 where
3081 T: std::convert::Into<wkt::BoolValue>,
3082 {
3083 self.restrict_query_result = std::option::Option::Some(v.into());
3084 self
3085 }
3086
3087 /// Sets or clears the value of [restrict_query_result][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_query_result].
3088 ///
3089 /// # Example
3090 /// ```ignore,no_run
3091 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3092 /// use wkt::BoolValue;
3093 /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_query_result(Some(BoolValue::default()/* use setters */));
3094 /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_query_result(None::<BoolValue>);
3095 /// ```
3096 pub fn set_or_clear_restrict_query_result<T>(
3097 mut self,
3098 v: std::option::Option<T>,
3099 ) -> Self
3100 where
3101 T: std::convert::Into<wkt::BoolValue>,
3102 {
3103 self.restrict_query_result = v.map(|x| x.into());
3104 self
3105 }
3106 }
3107
3108 impl wkt::message::Message for RestrictedExportPolicy {
3109 fn typename() -> &'static str {
3110 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.RestrictedExportPolicy"
3111 }
3112 }
3113
3114 /// Represents the state of a replica of a shared dataset.
3115 /// It includes the geographic location of the replica and
3116 /// system-computed, output-only fields indicating its replication state and
3117 /// whether it is the primary replica.
3118 #[derive(Clone, Default, PartialEq)]
3119 #[non_exhaustive]
3120 pub struct Replica {
3121 /// Output only. The geographic location where the replica resides. See
3122 /// [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
3123 /// for supported locations. Eg. "us-central1".
3124 pub location: std::string::String,
3125
3126 /// Output only. Assigned by Analytics Hub based on real BigQuery
3127 /// replication state.
3128 pub replica_state:
3129 crate::model::listing::big_query_dataset_source::replica::ReplicaState,
3130
3131 /// Output only. Indicates that this replica is the primary replica.
3132 pub primary_state: std::option::Option<
3133 crate::model::listing::big_query_dataset_source::replica::PrimaryState,
3134 >,
3135
3136 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3137 }
3138
3139 impl Replica {
3140 /// Creates a new default instance.
3141 pub fn new() -> Self {
3142 std::default::Default::default()
3143 }
3144
3145 /// Sets the value of [location][crate::model::listing::big_query_dataset_source::Replica::location].
3146 ///
3147 /// # Example
3148 /// ```ignore,no_run
3149 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3150 /// let x = Replica::new().set_location("example");
3151 /// ```
3152 pub fn set_location<T: std::convert::Into<std::string::String>>(
3153 mut self,
3154 v: T,
3155 ) -> Self {
3156 self.location = v.into();
3157 self
3158 }
3159
3160 /// Sets the value of [replica_state][crate::model::listing::big_query_dataset_source::Replica::replica_state].
3161 ///
3162 /// # Example
3163 /// ```ignore,no_run
3164 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3165 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::replica::ReplicaState;
3166 /// let x0 = Replica::new().set_replica_state(ReplicaState::ReadyToUse);
3167 /// let x1 = Replica::new().set_replica_state(ReplicaState::Unavailable);
3168 /// ```
3169 pub fn set_replica_state<
3170 T: std::convert::Into<
3171 crate::model::listing::big_query_dataset_source::replica::ReplicaState,
3172 >,
3173 >(
3174 mut self,
3175 v: T,
3176 ) -> Self {
3177 self.replica_state = v.into();
3178 self
3179 }
3180
3181 /// Sets the value of [primary_state][crate::model::listing::big_query_dataset_source::Replica::primary_state].
3182 ///
3183 /// # Example
3184 /// ```ignore,no_run
3185 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3186 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::replica::PrimaryState;
3187 /// let x0 = Replica::new().set_primary_state(PrimaryState::PrimaryReplica);
3188 /// ```
3189 pub fn set_primary_state<T>(mut self, v: T) -> Self
3190 where
3191 T: std::convert::Into<
3192 crate::model::listing::big_query_dataset_source::replica::PrimaryState,
3193 >,
3194 {
3195 self.primary_state = std::option::Option::Some(v.into());
3196 self
3197 }
3198
3199 /// Sets or clears the value of [primary_state][crate::model::listing::big_query_dataset_source::Replica::primary_state].
3200 ///
3201 /// # Example
3202 /// ```ignore,no_run
3203 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3204 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::replica::PrimaryState;
3205 /// let x0 = Replica::new().set_or_clear_primary_state(Some(PrimaryState::PrimaryReplica));
3206 /// let x_none = Replica::new().set_or_clear_primary_state(None::<PrimaryState>);
3207 /// ```
3208 pub fn set_or_clear_primary_state<T>(mut self, v: std::option::Option<T>) -> Self
3209 where
3210 T: std::convert::Into<
3211 crate::model::listing::big_query_dataset_source::replica::PrimaryState,
3212 >,
3213 {
3214 self.primary_state = v.map(|x| x.into());
3215 self
3216 }
3217 }
3218
3219 impl wkt::message::Message for Replica {
3220 fn typename() -> &'static str {
3221 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica"
3222 }
3223 }
3224
3225 /// Defines additional types related to [Replica].
3226 pub mod replica {
3227 #[allow(unused_imports)]
3228 use super::*;
3229
3230 /// Replica state of the shared dataset.
3231 ///
3232 /// # Working with unknown values
3233 ///
3234 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3235 /// additional enum variants at any time. Adding new variants is not considered
3236 /// a breaking change. Applications should write their code in anticipation of:
3237 ///
3238 /// - New values appearing in future releases of the client library, **and**
3239 /// - New values received dynamically, without application changes.
3240 ///
3241 /// Please consult the [Working with enums] section in the user guide for some
3242 /// guidelines.
3243 ///
3244 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3245 #[derive(Clone, Debug, PartialEq)]
3246 #[non_exhaustive]
3247 pub enum ReplicaState {
3248 /// Default value. This value is unused.
3249 Unspecified,
3250 /// The replica is backfilled and ready to use.
3251 ReadyToUse,
3252 /// The replica is unavailable, does not exist, or has not been
3253 /// backfilled yet.
3254 Unavailable,
3255 /// If set, the enum was initialized with an unknown value.
3256 ///
3257 /// Applications can examine the value using [ReplicaState::value] or
3258 /// [ReplicaState::name].
3259 UnknownValue(replica_state::UnknownValue),
3260 }
3261
3262 #[doc(hidden)]
3263 pub mod replica_state {
3264 #[allow(unused_imports)]
3265 use super::*;
3266 #[derive(Clone, Debug, PartialEq)]
3267 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3268 }
3269
3270 impl ReplicaState {
3271 /// Gets the enum value.
3272 ///
3273 /// Returns `None` if the enum contains an unknown value deserialized from
3274 /// the string representation of enums.
3275 pub fn value(&self) -> std::option::Option<i32> {
3276 match self {
3277 Self::Unspecified => std::option::Option::Some(0),
3278 Self::ReadyToUse => std::option::Option::Some(1),
3279 Self::Unavailable => std::option::Option::Some(2),
3280 Self::UnknownValue(u) => u.0.value(),
3281 }
3282 }
3283
3284 /// Gets the enum value as a string.
3285 ///
3286 /// Returns `None` if the enum contains an unknown value deserialized from
3287 /// the integer representation of enums.
3288 pub fn name(&self) -> std::option::Option<&str> {
3289 match self {
3290 Self::Unspecified => std::option::Option::Some("REPLICA_STATE_UNSPECIFIED"),
3291 Self::ReadyToUse => std::option::Option::Some("READY_TO_USE"),
3292 Self::Unavailable => std::option::Option::Some("UNAVAILABLE"),
3293 Self::UnknownValue(u) => u.0.name(),
3294 }
3295 }
3296 }
3297
3298 impl std::default::Default for ReplicaState {
3299 fn default() -> Self {
3300 use std::convert::From;
3301 Self::from(0)
3302 }
3303 }
3304
3305 impl std::fmt::Display for ReplicaState {
3306 fn fmt(
3307 &self,
3308 f: &mut std::fmt::Formatter<'_>,
3309 ) -> std::result::Result<(), std::fmt::Error> {
3310 wkt::internal::display_enum(f, self.name(), self.value())
3311 }
3312 }
3313
3314 impl std::convert::From<i32> for ReplicaState {
3315 fn from(value: i32) -> Self {
3316 match value {
3317 0 => Self::Unspecified,
3318 1 => Self::ReadyToUse,
3319 2 => Self::Unavailable,
3320 _ => Self::UnknownValue(replica_state::UnknownValue(
3321 wkt::internal::UnknownEnumValue::Integer(value),
3322 )),
3323 }
3324 }
3325 }
3326
3327 impl std::convert::From<&str> for ReplicaState {
3328 fn from(value: &str) -> Self {
3329 use std::string::ToString;
3330 match value {
3331 "REPLICA_STATE_UNSPECIFIED" => Self::Unspecified,
3332 "READY_TO_USE" => Self::ReadyToUse,
3333 "UNAVAILABLE" => Self::Unavailable,
3334 _ => Self::UnknownValue(replica_state::UnknownValue(
3335 wkt::internal::UnknownEnumValue::String(value.to_string()),
3336 )),
3337 }
3338 }
3339 }
3340
3341 impl serde::ser::Serialize for ReplicaState {
3342 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3343 where
3344 S: serde::Serializer,
3345 {
3346 match self {
3347 Self::Unspecified => serializer.serialize_i32(0),
3348 Self::ReadyToUse => serializer.serialize_i32(1),
3349 Self::Unavailable => serializer.serialize_i32(2),
3350 Self::UnknownValue(u) => u.0.serialize(serializer),
3351 }
3352 }
3353 }
3354
3355 impl<'de> serde::de::Deserialize<'de> for ReplicaState {
3356 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3357 where
3358 D: serde::Deserializer<'de>,
3359 {
3360 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicaState>::new(
3361 ".google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.ReplicaState"))
3362 }
3363 }
3364
3365 /// Primary state of the replica. Set only for the primary replica.
3366 ///
3367 /// # Working with unknown values
3368 ///
3369 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3370 /// additional enum variants at any time. Adding new variants is not considered
3371 /// a breaking change. Applications should write their code in anticipation of:
3372 ///
3373 /// - New values appearing in future releases of the client library, **and**
3374 /// - New values received dynamically, without application changes.
3375 ///
3376 /// Please consult the [Working with enums] section in the user guide for some
3377 /// guidelines.
3378 ///
3379 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3380 #[derive(Clone, Debug, PartialEq)]
3381 #[non_exhaustive]
3382 pub enum PrimaryState {
3383 /// Default value. This value is unused.
3384 Unspecified,
3385 /// The replica is the primary replica.
3386 PrimaryReplica,
3387 /// If set, the enum was initialized with an unknown value.
3388 ///
3389 /// Applications can examine the value using [PrimaryState::value] or
3390 /// [PrimaryState::name].
3391 UnknownValue(primary_state::UnknownValue),
3392 }
3393
3394 #[doc(hidden)]
3395 pub mod primary_state {
3396 #[allow(unused_imports)]
3397 use super::*;
3398 #[derive(Clone, Debug, PartialEq)]
3399 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3400 }
3401
3402 impl PrimaryState {
3403 /// Gets the enum value.
3404 ///
3405 /// Returns `None` if the enum contains an unknown value deserialized from
3406 /// the string representation of enums.
3407 pub fn value(&self) -> std::option::Option<i32> {
3408 match self {
3409 Self::Unspecified => std::option::Option::Some(0),
3410 Self::PrimaryReplica => std::option::Option::Some(1),
3411 Self::UnknownValue(u) => u.0.value(),
3412 }
3413 }
3414
3415 /// Gets the enum value as a string.
3416 ///
3417 /// Returns `None` if the enum contains an unknown value deserialized from
3418 /// the integer representation of enums.
3419 pub fn name(&self) -> std::option::Option<&str> {
3420 match self {
3421 Self::Unspecified => std::option::Option::Some("PRIMARY_STATE_UNSPECIFIED"),
3422 Self::PrimaryReplica => std::option::Option::Some("PRIMARY_REPLICA"),
3423 Self::UnknownValue(u) => u.0.name(),
3424 }
3425 }
3426 }
3427
3428 impl std::default::Default for PrimaryState {
3429 fn default() -> Self {
3430 use std::convert::From;
3431 Self::from(0)
3432 }
3433 }
3434
3435 impl std::fmt::Display for PrimaryState {
3436 fn fmt(
3437 &self,
3438 f: &mut std::fmt::Formatter<'_>,
3439 ) -> std::result::Result<(), std::fmt::Error> {
3440 wkt::internal::display_enum(f, self.name(), self.value())
3441 }
3442 }
3443
3444 impl std::convert::From<i32> for PrimaryState {
3445 fn from(value: i32) -> Self {
3446 match value {
3447 0 => Self::Unspecified,
3448 1 => Self::PrimaryReplica,
3449 _ => Self::UnknownValue(primary_state::UnknownValue(
3450 wkt::internal::UnknownEnumValue::Integer(value),
3451 )),
3452 }
3453 }
3454 }
3455
3456 impl std::convert::From<&str> for PrimaryState {
3457 fn from(value: &str) -> Self {
3458 use std::string::ToString;
3459 match value {
3460 "PRIMARY_STATE_UNSPECIFIED" => Self::Unspecified,
3461 "PRIMARY_REPLICA" => Self::PrimaryReplica,
3462 _ => Self::UnknownValue(primary_state::UnknownValue(
3463 wkt::internal::UnknownEnumValue::String(value.to_string()),
3464 )),
3465 }
3466 }
3467 }
3468
3469 impl serde::ser::Serialize for PrimaryState {
3470 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3471 where
3472 S: serde::Serializer,
3473 {
3474 match self {
3475 Self::Unspecified => serializer.serialize_i32(0),
3476 Self::PrimaryReplica => serializer.serialize_i32(1),
3477 Self::UnknownValue(u) => u.0.serialize(serializer),
3478 }
3479 }
3480 }
3481
3482 impl<'de> serde::de::Deserialize<'de> for PrimaryState {
3483 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3484 where
3485 D: serde::Deserializer<'de>,
3486 {
3487 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrimaryState>::new(
3488 ".google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.PrimaryState"))
3489 }
3490 }
3491 }
3492 }
3493
3494 /// Pub/Sub topic source.
3495 #[derive(Clone, Default, PartialEq)]
3496 #[non_exhaustive]
3497 pub struct PubSubTopicSource {
3498 /// Required. Resource name of the Pub/Sub topic source for this listing.
3499 /// e.g. projects/myproject/topics/topicId
3500 pub topic: std::string::String,
3501
3502 /// Optional. Region hint on where the data might be published. Data affinity
3503 /// regions are modifiable. See <https://cloud.google.com/about/locations> for
3504 /// full listing of possible Cloud regions.
3505 pub data_affinity_regions: std::vec::Vec<std::string::String>,
3506
3507 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3508 }
3509
3510 impl PubSubTopicSource {
3511 /// Creates a new default instance.
3512 pub fn new() -> Self {
3513 std::default::Default::default()
3514 }
3515
3516 /// Sets the value of [topic][crate::model::listing::PubSubTopicSource::topic].
3517 ///
3518 /// # Example
3519 /// ```ignore,no_run
3520 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::PubSubTopicSource;
3521 /// let x = PubSubTopicSource::new().set_topic("example");
3522 /// ```
3523 pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3524 self.topic = v.into();
3525 self
3526 }
3527
3528 /// Sets the value of [data_affinity_regions][crate::model::listing::PubSubTopicSource::data_affinity_regions].
3529 ///
3530 /// # Example
3531 /// ```ignore,no_run
3532 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::PubSubTopicSource;
3533 /// let x = PubSubTopicSource::new().set_data_affinity_regions(["a", "b", "c"]);
3534 /// ```
3535 pub fn set_data_affinity_regions<T, V>(mut self, v: T) -> Self
3536 where
3537 T: std::iter::IntoIterator<Item = V>,
3538 V: std::convert::Into<std::string::String>,
3539 {
3540 use std::iter::Iterator;
3541 self.data_affinity_regions = v.into_iter().map(|i| i.into()).collect();
3542 self
3543 }
3544 }
3545
3546 impl wkt::message::Message for PubSubTopicSource {
3547 fn typename() -> &'static str {
3548 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.PubSubTopicSource"
3549 }
3550 }
3551
3552 /// Restricted export config, used to configure restricted export on linked
3553 /// dataset.
3554 #[derive(Clone, Default, PartialEq)]
3555 #[non_exhaustive]
3556 pub struct RestrictedExportConfig {
3557 /// Optional. If true, enable restricted export.
3558 pub enabled: bool,
3559
3560 /// Output only. If true, restrict direct table access(read
3561 /// api/tabledata.list) on linked table.
3562 pub restrict_direct_table_access: bool,
3563
3564 /// Optional. If true, restrict export of query result derived from
3565 /// restricted linked dataset table.
3566 pub restrict_query_result: bool,
3567
3568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3569 }
3570
3571 impl RestrictedExportConfig {
3572 /// Creates a new default instance.
3573 pub fn new() -> Self {
3574 std::default::Default::default()
3575 }
3576
3577 /// Sets the value of [enabled][crate::model::listing::RestrictedExportConfig::enabled].
3578 ///
3579 /// # Example
3580 /// ```ignore,no_run
3581 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
3582 /// let x = RestrictedExportConfig::new().set_enabled(true);
3583 /// ```
3584 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3585 self.enabled = v.into();
3586 self
3587 }
3588
3589 /// Sets the value of [restrict_direct_table_access][crate::model::listing::RestrictedExportConfig::restrict_direct_table_access].
3590 ///
3591 /// # Example
3592 /// ```ignore,no_run
3593 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
3594 /// let x = RestrictedExportConfig::new().set_restrict_direct_table_access(true);
3595 /// ```
3596 pub fn set_restrict_direct_table_access<T: std::convert::Into<bool>>(
3597 mut self,
3598 v: T,
3599 ) -> Self {
3600 self.restrict_direct_table_access = v.into();
3601 self
3602 }
3603
3604 /// Sets the value of [restrict_query_result][crate::model::listing::RestrictedExportConfig::restrict_query_result].
3605 ///
3606 /// # Example
3607 /// ```ignore,no_run
3608 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
3609 /// let x = RestrictedExportConfig::new().set_restrict_query_result(true);
3610 /// ```
3611 pub fn set_restrict_query_result<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3612 self.restrict_query_result = v.into();
3613 self
3614 }
3615 }
3616
3617 impl wkt::message::Message for RestrictedExportConfig {
3618 fn typename() -> &'static str {
3619 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.RestrictedExportConfig"
3620 }
3621 }
3622
3623 /// Commercial info contains the information about the commercial data products
3624 /// associated with the listing.
3625 #[derive(Clone, Default, PartialEq)]
3626 #[non_exhaustive]
3627 pub struct CommercialInfo {
3628 /// Output only. Details of the Marketplace Data Product associated with the
3629 /// Listing.
3630 pub cloud_marketplace:
3631 std::option::Option<crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo>,
3632
3633 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3634 }
3635
3636 impl CommercialInfo {
3637 /// Creates a new default instance.
3638 pub fn new() -> Self {
3639 std::default::Default::default()
3640 }
3641
3642 /// Sets the value of [cloud_marketplace][crate::model::listing::CommercialInfo::cloud_marketplace].
3643 ///
3644 /// # Example
3645 /// ```ignore,no_run
3646 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
3647 /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3648 /// let x = CommercialInfo::new().set_cloud_marketplace(GoogleCloudMarketplaceInfo::default()/* use setters */);
3649 /// ```
3650 pub fn set_cloud_marketplace<T>(mut self, v: T) -> Self
3651 where
3652 T: std::convert::Into<
3653 crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo,
3654 >,
3655 {
3656 self.cloud_marketplace = std::option::Option::Some(v.into());
3657 self
3658 }
3659
3660 /// Sets or clears the value of [cloud_marketplace][crate::model::listing::CommercialInfo::cloud_marketplace].
3661 ///
3662 /// # Example
3663 /// ```ignore,no_run
3664 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
3665 /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3666 /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(Some(GoogleCloudMarketplaceInfo::default()/* use setters */));
3667 /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(None::<GoogleCloudMarketplaceInfo>);
3668 /// ```
3669 pub fn set_or_clear_cloud_marketplace<T>(mut self, v: std::option::Option<T>) -> Self
3670 where
3671 T: std::convert::Into<
3672 crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo,
3673 >,
3674 {
3675 self.cloud_marketplace = v.map(|x| x.into());
3676 self
3677 }
3678 }
3679
3680 impl wkt::message::Message for CommercialInfo {
3681 fn typename() -> &'static str {
3682 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo"
3683 }
3684 }
3685
3686 /// Defines additional types related to [CommercialInfo].
3687 pub mod commercial_info {
3688 #[allow(unused_imports)]
3689 use super::*;
3690
3691 /// Specifies the details of the Marketplace Data Product associated with the
3692 /// Listing.
3693 #[derive(Clone, Default, PartialEq)]
3694 #[non_exhaustive]
3695 pub struct GoogleCloudMarketplaceInfo {
3696
3697 /// Output only. Resource name of the commercial service associated with
3698 /// the Marketplace Data Product. e.g. example.com
3699 pub service: std::option::Option<std::string::String>,
3700
3701 /// Output only. Commercial state of the Marketplace Data Product.
3702 pub commercial_state: std::option::Option<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>,
3703
3704 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3705 }
3706
3707 impl GoogleCloudMarketplaceInfo {
3708 /// Creates a new default instance.
3709 pub fn new() -> Self {
3710 std::default::Default::default()
3711 }
3712
3713 /// Sets the value of [service][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::service].
3714 ///
3715 /// # Example
3716 /// ```ignore,no_run
3717 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3718 /// let x = GoogleCloudMarketplaceInfo::new().set_service("example");
3719 /// ```
3720 pub fn set_service<T>(mut self, v: T) -> Self
3721 where
3722 T: std::convert::Into<std::string::String>,
3723 {
3724 self.service = std::option::Option::Some(v.into());
3725 self
3726 }
3727
3728 /// Sets or clears the value of [service][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::service].
3729 ///
3730 /// # Example
3731 /// ```ignore,no_run
3732 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3733 /// let x = GoogleCloudMarketplaceInfo::new().set_or_clear_service(Some("example"));
3734 /// let x = GoogleCloudMarketplaceInfo::new().set_or_clear_service(None::<String>);
3735 /// ```
3736 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
3737 where
3738 T: std::convert::Into<std::string::String>,
3739 {
3740 self.service = v.map(|x| x.into());
3741 self
3742 }
3743
3744 /// Sets the value of [commercial_state][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::commercial_state].
3745 ///
3746 /// # Example
3747 /// ```ignore,no_run
3748 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3749 /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState;
3750 /// let x0 = GoogleCloudMarketplaceInfo::new().set_commercial_state(CommercialState::Onboarding);
3751 /// let x1 = GoogleCloudMarketplaceInfo::new().set_commercial_state(CommercialState::Active);
3752 /// ```
3753 pub fn set_commercial_state<T>(mut self, v: T) -> Self
3754 where T: std::convert::Into<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>
3755 {
3756 self.commercial_state = std::option::Option::Some(v.into());
3757 self
3758 }
3759
3760 /// Sets or clears the value of [commercial_state][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::commercial_state].
3761 ///
3762 /// # Example
3763 /// ```ignore,no_run
3764 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3765 /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState;
3766 /// let x0 = GoogleCloudMarketplaceInfo::new().set_or_clear_commercial_state(Some(CommercialState::Onboarding));
3767 /// let x1 = GoogleCloudMarketplaceInfo::new().set_or_clear_commercial_state(Some(CommercialState::Active));
3768 /// let x_none = GoogleCloudMarketplaceInfo::new().set_or_clear_commercial_state(None::<CommercialState>);
3769 /// ```
3770 pub fn set_or_clear_commercial_state<T>(mut self, v: std::option::Option<T>) -> Self
3771 where T: std::convert::Into<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>
3772 {
3773 self.commercial_state = v.map(|x| x.into());
3774 self
3775 }
3776 }
3777
3778 impl wkt::message::Message for GoogleCloudMarketplaceInfo {
3779 fn typename() -> &'static str {
3780 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo.GoogleCloudMarketplaceInfo"
3781 }
3782 }
3783
3784 /// Defines additional types related to [GoogleCloudMarketplaceInfo].
3785 pub mod google_cloud_marketplace_info {
3786 #[allow(unused_imports)]
3787 use super::*;
3788
3789 /// Indicates whether this commercial access is currently active.
3790 ///
3791 /// # Working with unknown values
3792 ///
3793 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3794 /// additional enum variants at any time. Adding new variants is not considered
3795 /// a breaking change. Applications should write their code in anticipation of:
3796 ///
3797 /// - New values appearing in future releases of the client library, **and**
3798 /// - New values received dynamically, without application changes.
3799 ///
3800 /// Please consult the [Working with enums] section in the user guide for some
3801 /// guidelines.
3802 ///
3803 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3804 #[derive(Clone, Debug, PartialEq)]
3805 #[non_exhaustive]
3806 pub enum CommercialState {
3807 /// Commercialization is incomplete and cannot be used.
3808 Unspecified,
3809 /// Commercialization has been initialized.
3810 Onboarding,
3811 /// Commercialization is complete and available for use.
3812 Active,
3813 /// If set, the enum was initialized with an unknown value.
3814 ///
3815 /// Applications can examine the value using [CommercialState::value] or
3816 /// [CommercialState::name].
3817 UnknownValue(commercial_state::UnknownValue),
3818 }
3819
3820 #[doc(hidden)]
3821 pub mod commercial_state {
3822 #[allow(unused_imports)]
3823 use super::*;
3824 #[derive(Clone, Debug, PartialEq)]
3825 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3826 }
3827
3828 impl CommercialState {
3829 /// Gets the enum value.
3830 ///
3831 /// Returns `None` if the enum contains an unknown value deserialized from
3832 /// the string representation of enums.
3833 pub fn value(&self) -> std::option::Option<i32> {
3834 match self {
3835 Self::Unspecified => std::option::Option::Some(0),
3836 Self::Onboarding => std::option::Option::Some(1),
3837 Self::Active => std::option::Option::Some(2),
3838 Self::UnknownValue(u) => u.0.value(),
3839 }
3840 }
3841
3842 /// Gets the enum value as a string.
3843 ///
3844 /// Returns `None` if the enum contains an unknown value deserialized from
3845 /// the integer representation of enums.
3846 pub fn name(&self) -> std::option::Option<&str> {
3847 match self {
3848 Self::Unspecified => {
3849 std::option::Option::Some("COMMERCIAL_STATE_UNSPECIFIED")
3850 }
3851 Self::Onboarding => std::option::Option::Some("ONBOARDING"),
3852 Self::Active => std::option::Option::Some("ACTIVE"),
3853 Self::UnknownValue(u) => u.0.name(),
3854 }
3855 }
3856 }
3857
3858 impl std::default::Default for CommercialState {
3859 fn default() -> Self {
3860 use std::convert::From;
3861 Self::from(0)
3862 }
3863 }
3864
3865 impl std::fmt::Display for CommercialState {
3866 fn fmt(
3867 &self,
3868 f: &mut std::fmt::Formatter<'_>,
3869 ) -> std::result::Result<(), std::fmt::Error> {
3870 wkt::internal::display_enum(f, self.name(), self.value())
3871 }
3872 }
3873
3874 impl std::convert::From<i32> for CommercialState {
3875 fn from(value: i32) -> Self {
3876 match value {
3877 0 => Self::Unspecified,
3878 1 => Self::Onboarding,
3879 2 => Self::Active,
3880 _ => Self::UnknownValue(commercial_state::UnknownValue(
3881 wkt::internal::UnknownEnumValue::Integer(value),
3882 )),
3883 }
3884 }
3885 }
3886
3887 impl std::convert::From<&str> for CommercialState {
3888 fn from(value: &str) -> Self {
3889 use std::string::ToString;
3890 match value {
3891 "COMMERCIAL_STATE_UNSPECIFIED" => Self::Unspecified,
3892 "ONBOARDING" => Self::Onboarding,
3893 "ACTIVE" => Self::Active,
3894 _ => Self::UnknownValue(commercial_state::UnknownValue(
3895 wkt::internal::UnknownEnumValue::String(value.to_string()),
3896 )),
3897 }
3898 }
3899 }
3900
3901 impl serde::ser::Serialize for CommercialState {
3902 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3903 where
3904 S: serde::Serializer,
3905 {
3906 match self {
3907 Self::Unspecified => serializer.serialize_i32(0),
3908 Self::Onboarding => serializer.serialize_i32(1),
3909 Self::Active => serializer.serialize_i32(2),
3910 Self::UnknownValue(u) => u.0.serialize(serializer),
3911 }
3912 }
3913 }
3914
3915 impl<'de> serde::de::Deserialize<'de> for CommercialState {
3916 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3917 where
3918 D: serde::Deserializer<'de>,
3919 {
3920 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CommercialState>::new(
3921 ".google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo.GoogleCloudMarketplaceInfo.CommercialState"))
3922 }
3923 }
3924 }
3925 }
3926
3927 /// State of the listing.
3928 ///
3929 /// # Working with unknown values
3930 ///
3931 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3932 /// additional enum variants at any time. Adding new variants is not considered
3933 /// a breaking change. Applications should write their code in anticipation of:
3934 ///
3935 /// - New values appearing in future releases of the client library, **and**
3936 /// - New values received dynamically, without application changes.
3937 ///
3938 /// Please consult the [Working with enums] section in the user guide for some
3939 /// guidelines.
3940 ///
3941 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3942 #[derive(Clone, Debug, PartialEq)]
3943 #[non_exhaustive]
3944 pub enum State {
3945 /// Default value. This value is unused.
3946 Unspecified,
3947 /// Subscribable state. Users with dataexchange.listings.subscribe permission
3948 /// can subscribe to this listing.
3949 Active,
3950 /// If set, the enum was initialized with an unknown value.
3951 ///
3952 /// Applications can examine the value using [State::value] or
3953 /// [State::name].
3954 UnknownValue(state::UnknownValue),
3955 }
3956
3957 #[doc(hidden)]
3958 pub mod state {
3959 #[allow(unused_imports)]
3960 use super::*;
3961 #[derive(Clone, Debug, PartialEq)]
3962 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3963 }
3964
3965 impl State {
3966 /// Gets the enum value.
3967 ///
3968 /// Returns `None` if the enum contains an unknown value deserialized from
3969 /// the string representation of enums.
3970 pub fn value(&self) -> std::option::Option<i32> {
3971 match self {
3972 Self::Unspecified => std::option::Option::Some(0),
3973 Self::Active => std::option::Option::Some(1),
3974 Self::UnknownValue(u) => u.0.value(),
3975 }
3976 }
3977
3978 /// Gets the enum value as a string.
3979 ///
3980 /// Returns `None` if the enum contains an unknown value deserialized from
3981 /// the integer representation of enums.
3982 pub fn name(&self) -> std::option::Option<&str> {
3983 match self {
3984 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3985 Self::Active => std::option::Option::Some("ACTIVE"),
3986 Self::UnknownValue(u) => u.0.name(),
3987 }
3988 }
3989 }
3990
3991 impl std::default::Default for State {
3992 fn default() -> Self {
3993 use std::convert::From;
3994 Self::from(0)
3995 }
3996 }
3997
3998 impl std::fmt::Display for State {
3999 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4000 wkt::internal::display_enum(f, self.name(), self.value())
4001 }
4002 }
4003
4004 impl std::convert::From<i32> for State {
4005 fn from(value: i32) -> Self {
4006 match value {
4007 0 => Self::Unspecified,
4008 1 => Self::Active,
4009 _ => Self::UnknownValue(state::UnknownValue(
4010 wkt::internal::UnknownEnumValue::Integer(value),
4011 )),
4012 }
4013 }
4014 }
4015
4016 impl std::convert::From<&str> for State {
4017 fn from(value: &str) -> Self {
4018 use std::string::ToString;
4019 match value {
4020 "STATE_UNSPECIFIED" => Self::Unspecified,
4021 "ACTIVE" => Self::Active,
4022 _ => Self::UnknownValue(state::UnknownValue(
4023 wkt::internal::UnknownEnumValue::String(value.to_string()),
4024 )),
4025 }
4026 }
4027 }
4028
4029 impl serde::ser::Serialize for State {
4030 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4031 where
4032 S: serde::Serializer,
4033 {
4034 match self {
4035 Self::Unspecified => serializer.serialize_i32(0),
4036 Self::Active => serializer.serialize_i32(1),
4037 Self::UnknownValue(u) => u.0.serialize(serializer),
4038 }
4039 }
4040 }
4041
4042 impl<'de> serde::de::Deserialize<'de> for State {
4043 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4044 where
4045 D: serde::Deserializer<'de>,
4046 {
4047 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4048 ".google.cloud.bigquery.analyticshub.v1.Listing.State",
4049 ))
4050 }
4051 }
4052
4053 /// Listing categories.
4054 ///
4055 /// # Working with unknown values
4056 ///
4057 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4058 /// additional enum variants at any time. Adding new variants is not considered
4059 /// a breaking change. Applications should write their code in anticipation of:
4060 ///
4061 /// - New values appearing in future releases of the client library, **and**
4062 /// - New values received dynamically, without application changes.
4063 ///
4064 /// Please consult the [Working with enums] section in the user guide for some
4065 /// guidelines.
4066 ///
4067 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4068 #[derive(Clone, Debug, PartialEq)]
4069 #[non_exhaustive]
4070 pub enum Category {
4071 #[allow(missing_docs)]
4072 Unspecified,
4073 #[allow(missing_docs)]
4074 Others,
4075 #[allow(missing_docs)]
4076 AdvertisingAndMarketing,
4077 #[allow(missing_docs)]
4078 Commerce,
4079 #[allow(missing_docs)]
4080 ClimateAndEnvironment,
4081 #[allow(missing_docs)]
4082 Demographics,
4083 #[allow(missing_docs)]
4084 Economics,
4085 #[allow(missing_docs)]
4086 Education,
4087 #[allow(missing_docs)]
4088 Energy,
4089 #[allow(missing_docs)]
4090 Financial,
4091 #[allow(missing_docs)]
4092 Gaming,
4093 #[allow(missing_docs)]
4094 Geospatial,
4095 #[allow(missing_docs)]
4096 HealthcareAndLifeScience,
4097 #[allow(missing_docs)]
4098 Media,
4099 #[allow(missing_docs)]
4100 PublicSector,
4101 #[allow(missing_docs)]
4102 Retail,
4103 #[allow(missing_docs)]
4104 Sports,
4105 #[allow(missing_docs)]
4106 ScienceAndResearch,
4107 #[allow(missing_docs)]
4108 TransportationAndLogistics,
4109 #[allow(missing_docs)]
4110 TravelAndTourism,
4111 #[allow(missing_docs)]
4112 GoogleEarthEngine,
4113 /// If set, the enum was initialized with an unknown value.
4114 ///
4115 /// Applications can examine the value using [Category::value] or
4116 /// [Category::name].
4117 UnknownValue(category::UnknownValue),
4118 }
4119
4120 #[doc(hidden)]
4121 pub mod category {
4122 #[allow(unused_imports)]
4123 use super::*;
4124 #[derive(Clone, Debug, PartialEq)]
4125 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4126 }
4127
4128 impl Category {
4129 /// Gets the enum value.
4130 ///
4131 /// Returns `None` if the enum contains an unknown value deserialized from
4132 /// the string representation of enums.
4133 pub fn value(&self) -> std::option::Option<i32> {
4134 match self {
4135 Self::Unspecified => std::option::Option::Some(0),
4136 Self::Others => std::option::Option::Some(1),
4137 Self::AdvertisingAndMarketing => std::option::Option::Some(2),
4138 Self::Commerce => std::option::Option::Some(3),
4139 Self::ClimateAndEnvironment => std::option::Option::Some(4),
4140 Self::Demographics => std::option::Option::Some(5),
4141 Self::Economics => std::option::Option::Some(6),
4142 Self::Education => std::option::Option::Some(7),
4143 Self::Energy => std::option::Option::Some(8),
4144 Self::Financial => std::option::Option::Some(9),
4145 Self::Gaming => std::option::Option::Some(10),
4146 Self::Geospatial => std::option::Option::Some(11),
4147 Self::HealthcareAndLifeScience => std::option::Option::Some(12),
4148 Self::Media => std::option::Option::Some(13),
4149 Self::PublicSector => std::option::Option::Some(14),
4150 Self::Retail => std::option::Option::Some(15),
4151 Self::Sports => std::option::Option::Some(16),
4152 Self::ScienceAndResearch => std::option::Option::Some(17),
4153 Self::TransportationAndLogistics => std::option::Option::Some(18),
4154 Self::TravelAndTourism => std::option::Option::Some(19),
4155 Self::GoogleEarthEngine => std::option::Option::Some(20),
4156 Self::UnknownValue(u) => u.0.value(),
4157 }
4158 }
4159
4160 /// Gets the enum value as a string.
4161 ///
4162 /// Returns `None` if the enum contains an unknown value deserialized from
4163 /// the integer representation of enums.
4164 pub fn name(&self) -> std::option::Option<&str> {
4165 match self {
4166 Self::Unspecified => std::option::Option::Some("CATEGORY_UNSPECIFIED"),
4167 Self::Others => std::option::Option::Some("CATEGORY_OTHERS"),
4168 Self::AdvertisingAndMarketing => {
4169 std::option::Option::Some("CATEGORY_ADVERTISING_AND_MARKETING")
4170 }
4171 Self::Commerce => std::option::Option::Some("CATEGORY_COMMERCE"),
4172 Self::ClimateAndEnvironment => {
4173 std::option::Option::Some("CATEGORY_CLIMATE_AND_ENVIRONMENT")
4174 }
4175 Self::Demographics => std::option::Option::Some("CATEGORY_DEMOGRAPHICS"),
4176 Self::Economics => std::option::Option::Some("CATEGORY_ECONOMICS"),
4177 Self::Education => std::option::Option::Some("CATEGORY_EDUCATION"),
4178 Self::Energy => std::option::Option::Some("CATEGORY_ENERGY"),
4179 Self::Financial => std::option::Option::Some("CATEGORY_FINANCIAL"),
4180 Self::Gaming => std::option::Option::Some("CATEGORY_GAMING"),
4181 Self::Geospatial => std::option::Option::Some("CATEGORY_GEOSPATIAL"),
4182 Self::HealthcareAndLifeScience => {
4183 std::option::Option::Some("CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE")
4184 }
4185 Self::Media => std::option::Option::Some("CATEGORY_MEDIA"),
4186 Self::PublicSector => std::option::Option::Some("CATEGORY_PUBLIC_SECTOR"),
4187 Self::Retail => std::option::Option::Some("CATEGORY_RETAIL"),
4188 Self::Sports => std::option::Option::Some("CATEGORY_SPORTS"),
4189 Self::ScienceAndResearch => {
4190 std::option::Option::Some("CATEGORY_SCIENCE_AND_RESEARCH")
4191 }
4192 Self::TransportationAndLogistics => {
4193 std::option::Option::Some("CATEGORY_TRANSPORTATION_AND_LOGISTICS")
4194 }
4195 Self::TravelAndTourism => std::option::Option::Some("CATEGORY_TRAVEL_AND_TOURISM"),
4196 Self::GoogleEarthEngine => {
4197 std::option::Option::Some("CATEGORY_GOOGLE_EARTH_ENGINE")
4198 }
4199 Self::UnknownValue(u) => u.0.name(),
4200 }
4201 }
4202 }
4203
4204 impl std::default::Default for Category {
4205 fn default() -> Self {
4206 use std::convert::From;
4207 Self::from(0)
4208 }
4209 }
4210
4211 impl std::fmt::Display for Category {
4212 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4213 wkt::internal::display_enum(f, self.name(), self.value())
4214 }
4215 }
4216
4217 impl std::convert::From<i32> for Category {
4218 fn from(value: i32) -> Self {
4219 match value {
4220 0 => Self::Unspecified,
4221 1 => Self::Others,
4222 2 => Self::AdvertisingAndMarketing,
4223 3 => Self::Commerce,
4224 4 => Self::ClimateAndEnvironment,
4225 5 => Self::Demographics,
4226 6 => Self::Economics,
4227 7 => Self::Education,
4228 8 => Self::Energy,
4229 9 => Self::Financial,
4230 10 => Self::Gaming,
4231 11 => Self::Geospatial,
4232 12 => Self::HealthcareAndLifeScience,
4233 13 => Self::Media,
4234 14 => Self::PublicSector,
4235 15 => Self::Retail,
4236 16 => Self::Sports,
4237 17 => Self::ScienceAndResearch,
4238 18 => Self::TransportationAndLogistics,
4239 19 => Self::TravelAndTourism,
4240 20 => Self::GoogleEarthEngine,
4241 _ => Self::UnknownValue(category::UnknownValue(
4242 wkt::internal::UnknownEnumValue::Integer(value),
4243 )),
4244 }
4245 }
4246 }
4247
4248 impl std::convert::From<&str> for Category {
4249 fn from(value: &str) -> Self {
4250 use std::string::ToString;
4251 match value {
4252 "CATEGORY_UNSPECIFIED" => Self::Unspecified,
4253 "CATEGORY_OTHERS" => Self::Others,
4254 "CATEGORY_ADVERTISING_AND_MARKETING" => Self::AdvertisingAndMarketing,
4255 "CATEGORY_COMMERCE" => Self::Commerce,
4256 "CATEGORY_CLIMATE_AND_ENVIRONMENT" => Self::ClimateAndEnvironment,
4257 "CATEGORY_DEMOGRAPHICS" => Self::Demographics,
4258 "CATEGORY_ECONOMICS" => Self::Economics,
4259 "CATEGORY_EDUCATION" => Self::Education,
4260 "CATEGORY_ENERGY" => Self::Energy,
4261 "CATEGORY_FINANCIAL" => Self::Financial,
4262 "CATEGORY_GAMING" => Self::Gaming,
4263 "CATEGORY_GEOSPATIAL" => Self::Geospatial,
4264 "CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE" => Self::HealthcareAndLifeScience,
4265 "CATEGORY_MEDIA" => Self::Media,
4266 "CATEGORY_PUBLIC_SECTOR" => Self::PublicSector,
4267 "CATEGORY_RETAIL" => Self::Retail,
4268 "CATEGORY_SPORTS" => Self::Sports,
4269 "CATEGORY_SCIENCE_AND_RESEARCH" => Self::ScienceAndResearch,
4270 "CATEGORY_TRANSPORTATION_AND_LOGISTICS" => Self::TransportationAndLogistics,
4271 "CATEGORY_TRAVEL_AND_TOURISM" => Self::TravelAndTourism,
4272 "CATEGORY_GOOGLE_EARTH_ENGINE" => Self::GoogleEarthEngine,
4273 _ => Self::UnknownValue(category::UnknownValue(
4274 wkt::internal::UnknownEnumValue::String(value.to_string()),
4275 )),
4276 }
4277 }
4278 }
4279
4280 impl serde::ser::Serialize for Category {
4281 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4282 where
4283 S: serde::Serializer,
4284 {
4285 match self {
4286 Self::Unspecified => serializer.serialize_i32(0),
4287 Self::Others => serializer.serialize_i32(1),
4288 Self::AdvertisingAndMarketing => serializer.serialize_i32(2),
4289 Self::Commerce => serializer.serialize_i32(3),
4290 Self::ClimateAndEnvironment => serializer.serialize_i32(4),
4291 Self::Demographics => serializer.serialize_i32(5),
4292 Self::Economics => serializer.serialize_i32(6),
4293 Self::Education => serializer.serialize_i32(7),
4294 Self::Energy => serializer.serialize_i32(8),
4295 Self::Financial => serializer.serialize_i32(9),
4296 Self::Gaming => serializer.serialize_i32(10),
4297 Self::Geospatial => serializer.serialize_i32(11),
4298 Self::HealthcareAndLifeScience => serializer.serialize_i32(12),
4299 Self::Media => serializer.serialize_i32(13),
4300 Self::PublicSector => serializer.serialize_i32(14),
4301 Self::Retail => serializer.serialize_i32(15),
4302 Self::Sports => serializer.serialize_i32(16),
4303 Self::ScienceAndResearch => serializer.serialize_i32(17),
4304 Self::TransportationAndLogistics => serializer.serialize_i32(18),
4305 Self::TravelAndTourism => serializer.serialize_i32(19),
4306 Self::GoogleEarthEngine => serializer.serialize_i32(20),
4307 Self::UnknownValue(u) => u.0.serialize(serializer),
4308 }
4309 }
4310 }
4311
4312 impl<'de> serde::de::Deserialize<'de> for Category {
4313 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4314 where
4315 D: serde::Deserializer<'de>,
4316 {
4317 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Category>::new(
4318 ".google.cloud.bigquery.analyticshub.v1.Listing.Category",
4319 ))
4320 }
4321 }
4322
4323 /// Listing source.
4324 #[derive(Clone, Debug, PartialEq)]
4325 #[non_exhaustive]
4326 pub enum Source {
4327 /// Shared dataset i.e. BigQuery dataset source.
4328 BigqueryDataset(std::boxed::Box<crate::model::listing::BigQueryDatasetSource>),
4329 /// Pub/Sub topic source.
4330 PubsubTopic(std::boxed::Box<crate::model::listing::PubSubTopicSource>),
4331 }
4332}
4333
4334/// Stored procedure configuration, used to configure stored procedure sharing
4335/// on linked dataset.
4336#[derive(Clone, Default, PartialEq)]
4337#[non_exhaustive]
4338pub struct StoredProcedureConfig {
4339 /// Optional. If true, enable sharing of stored procedure.
4340 pub enabled: bool,
4341
4342 /// Output only. Types of stored procedure supported to share.
4343 pub allowed_stored_procedure_types:
4344 std::vec::Vec<crate::model::stored_procedure_config::StoredProcedureType>,
4345
4346 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4347}
4348
4349impl StoredProcedureConfig {
4350 /// Creates a new default instance.
4351 pub fn new() -> Self {
4352 std::default::Default::default()
4353 }
4354
4355 /// Sets the value of [enabled][crate::model::StoredProcedureConfig::enabled].
4356 ///
4357 /// # Example
4358 /// ```ignore,no_run
4359 /// # use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
4360 /// let x = StoredProcedureConfig::new().set_enabled(true);
4361 /// ```
4362 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4363 self.enabled = v.into();
4364 self
4365 }
4366
4367 /// Sets the value of [allowed_stored_procedure_types][crate::model::StoredProcedureConfig::allowed_stored_procedure_types].
4368 ///
4369 /// # Example
4370 /// ```ignore,no_run
4371 /// # use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
4372 /// use google_cloud_bigquery_analyticshub_v1::model::stored_procedure_config::StoredProcedureType;
4373 /// let x = StoredProcedureConfig::new().set_allowed_stored_procedure_types([
4374 /// StoredProcedureType::SqlProcedure,
4375 /// ]);
4376 /// ```
4377 pub fn set_allowed_stored_procedure_types<T, V>(mut self, v: T) -> Self
4378 where
4379 T: std::iter::IntoIterator<Item = V>,
4380 V: std::convert::Into<crate::model::stored_procedure_config::StoredProcedureType>,
4381 {
4382 use std::iter::Iterator;
4383 self.allowed_stored_procedure_types = v.into_iter().map(|i| i.into()).collect();
4384 self
4385 }
4386}
4387
4388impl wkt::message::Message for StoredProcedureConfig {
4389 fn typename() -> &'static str {
4390 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.StoredProcedureConfig"
4391 }
4392}
4393
4394/// Defines additional types related to [StoredProcedureConfig].
4395pub mod stored_procedure_config {
4396 #[allow(unused_imports)]
4397 use super::*;
4398
4399 /// Enum to specify the type of stored procedure to share.
4400 ///
4401 /// # Working with unknown values
4402 ///
4403 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4404 /// additional enum variants at any time. Adding new variants is not considered
4405 /// a breaking change. Applications should write their code in anticipation of:
4406 ///
4407 /// - New values appearing in future releases of the client library, **and**
4408 /// - New values received dynamically, without application changes.
4409 ///
4410 /// Please consult the [Working with enums] section in the user guide for some
4411 /// guidelines.
4412 ///
4413 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4414 #[derive(Clone, Debug, PartialEq)]
4415 #[non_exhaustive]
4416 pub enum StoredProcedureType {
4417 /// Default value. This value is unused.
4418 Unspecified,
4419 /// SQL stored procedure.
4420 SqlProcedure,
4421 /// If set, the enum was initialized with an unknown value.
4422 ///
4423 /// Applications can examine the value using [StoredProcedureType::value] or
4424 /// [StoredProcedureType::name].
4425 UnknownValue(stored_procedure_type::UnknownValue),
4426 }
4427
4428 #[doc(hidden)]
4429 pub mod stored_procedure_type {
4430 #[allow(unused_imports)]
4431 use super::*;
4432 #[derive(Clone, Debug, PartialEq)]
4433 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4434 }
4435
4436 impl StoredProcedureType {
4437 /// Gets the enum value.
4438 ///
4439 /// Returns `None` if the enum contains an unknown value deserialized from
4440 /// the string representation of enums.
4441 pub fn value(&self) -> std::option::Option<i32> {
4442 match self {
4443 Self::Unspecified => std::option::Option::Some(0),
4444 Self::SqlProcedure => std::option::Option::Some(1),
4445 Self::UnknownValue(u) => u.0.value(),
4446 }
4447 }
4448
4449 /// Gets the enum value as a string.
4450 ///
4451 /// Returns `None` if the enum contains an unknown value deserialized from
4452 /// the integer representation of enums.
4453 pub fn name(&self) -> std::option::Option<&str> {
4454 match self {
4455 Self::Unspecified => std::option::Option::Some("STORED_PROCEDURE_TYPE_UNSPECIFIED"),
4456 Self::SqlProcedure => std::option::Option::Some("SQL_PROCEDURE"),
4457 Self::UnknownValue(u) => u.0.name(),
4458 }
4459 }
4460 }
4461
4462 impl std::default::Default for StoredProcedureType {
4463 fn default() -> Self {
4464 use std::convert::From;
4465 Self::from(0)
4466 }
4467 }
4468
4469 impl std::fmt::Display for StoredProcedureType {
4470 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4471 wkt::internal::display_enum(f, self.name(), self.value())
4472 }
4473 }
4474
4475 impl std::convert::From<i32> for StoredProcedureType {
4476 fn from(value: i32) -> Self {
4477 match value {
4478 0 => Self::Unspecified,
4479 1 => Self::SqlProcedure,
4480 _ => Self::UnknownValue(stored_procedure_type::UnknownValue(
4481 wkt::internal::UnknownEnumValue::Integer(value),
4482 )),
4483 }
4484 }
4485 }
4486
4487 impl std::convert::From<&str> for StoredProcedureType {
4488 fn from(value: &str) -> Self {
4489 use std::string::ToString;
4490 match value {
4491 "STORED_PROCEDURE_TYPE_UNSPECIFIED" => Self::Unspecified,
4492 "SQL_PROCEDURE" => Self::SqlProcedure,
4493 _ => Self::UnknownValue(stored_procedure_type::UnknownValue(
4494 wkt::internal::UnknownEnumValue::String(value.to_string()),
4495 )),
4496 }
4497 }
4498 }
4499
4500 impl serde::ser::Serialize for StoredProcedureType {
4501 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4502 where
4503 S: serde::Serializer,
4504 {
4505 match self {
4506 Self::Unspecified => serializer.serialize_i32(0),
4507 Self::SqlProcedure => serializer.serialize_i32(1),
4508 Self::UnknownValue(u) => u.0.serialize(serializer),
4509 }
4510 }
4511 }
4512
4513 impl<'de> serde::de::Deserialize<'de> for StoredProcedureType {
4514 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4515 where
4516 D: serde::Deserializer<'de>,
4517 {
4518 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StoredProcedureType>::new(
4519 ".google.cloud.bigquery.analyticshub.v1.StoredProcedureConfig.StoredProcedureType",
4520 ))
4521 }
4522 }
4523}
4524
4525/// A subscription represents a subscribers' access to a particular set of
4526/// published data. It contains references to associated listings,
4527/// data exchanges, and linked datasets.
4528#[derive(Clone, Default, PartialEq)]
4529#[non_exhaustive]
4530pub struct Subscription {
4531 /// Output only. The resource name of the subscription.
4532 /// e.g. `projects/myproject/locations/us/subscriptions/123`.
4533 pub name: std::string::String,
4534
4535 /// Output only. Timestamp when the subscription was created.
4536 pub creation_time: std::option::Option<wkt::Timestamp>,
4537
4538 /// Output only. Timestamp when the subscription was last modified.
4539 pub last_modify_time: std::option::Option<wkt::Timestamp>,
4540
4541 /// Output only. Organization of the project this subscription belongs to.
4542 pub organization_id: std::string::String,
4543
4544 /// Output only. Display name of the project of this subscription.
4545 pub organization_display_name: std::string::String,
4546
4547 /// Output only. Current state of the subscription.
4548 pub state: crate::model::subscription::State,
4549
4550 /// Output only. Map of listing resource names to associated linked resource,
4551 /// e.g. projects/123/locations/us/dataExchanges/456/listings/789
4552 /// ->
4553 /// projects/123/datasets/my_dataset
4554 ///
4555 /// For listing-level subscriptions, this is a map of size 1.
4556 /// Only contains values if state == STATE_ACTIVE.
4557 pub linked_dataset_map:
4558 std::collections::HashMap<std::string::String, crate::model::subscription::LinkedResource>,
4559
4560 /// Output only. Email of the subscriber.
4561 pub subscriber_contact: std::string::String,
4562
4563 /// Output only. Linked resources created in the subscription. Only contains
4564 /// values if state = STATE_ACTIVE.
4565 pub linked_resources: std::vec::Vec<crate::model::subscription::LinkedResource>,
4566
4567 /// Output only. Listing shared asset type.
4568 pub resource_type: crate::model::SharedResourceType,
4569
4570 /// Output only. This is set if this is a commercial subscription i.e. if this
4571 /// subscription was created from subscribing to a commercial listing.
4572 pub commercial_info: std::option::Option<crate::model::subscription::CommercialInfo>,
4573
4574 /// Output only. By default, false.
4575 /// If true, the Subscriber agreed to the email sharing mandate
4576 /// that is enabled for DataExchange/Listing.
4577 pub log_linked_dataset_query_user_email: std::option::Option<bool>,
4578
4579 /// Optional. BigQuery destination dataset to create for the subscriber.
4580 pub destination_dataset: std::option::Option<crate::model::DestinationDataset>,
4581
4582 #[allow(missing_docs)]
4583 pub resource_name: std::option::Option<crate::model::subscription::ResourceName>,
4584
4585 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4586}
4587
4588impl Subscription {
4589 /// Creates a new default instance.
4590 pub fn new() -> Self {
4591 std::default::Default::default()
4592 }
4593
4594 /// Sets the value of [name][crate::model::Subscription::name].
4595 ///
4596 /// # Example
4597 /// ```ignore,no_run
4598 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4599 /// # let project_id = "project_id";
4600 /// # let location_id = "location_id";
4601 /// # let subscription_id = "subscription_id";
4602 /// let x = Subscription::new().set_name(format!("projects/{project_id}/locations/{location_id}/subscriptions/{subscription_id}"));
4603 /// ```
4604 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4605 self.name = v.into();
4606 self
4607 }
4608
4609 /// Sets the value of [creation_time][crate::model::Subscription::creation_time].
4610 ///
4611 /// # Example
4612 /// ```ignore,no_run
4613 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4614 /// use wkt::Timestamp;
4615 /// let x = Subscription::new().set_creation_time(Timestamp::default()/* use setters */);
4616 /// ```
4617 pub fn set_creation_time<T>(mut self, v: T) -> Self
4618 where
4619 T: std::convert::Into<wkt::Timestamp>,
4620 {
4621 self.creation_time = std::option::Option::Some(v.into());
4622 self
4623 }
4624
4625 /// Sets or clears the value of [creation_time][crate::model::Subscription::creation_time].
4626 ///
4627 /// # Example
4628 /// ```ignore,no_run
4629 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4630 /// use wkt::Timestamp;
4631 /// let x = Subscription::new().set_or_clear_creation_time(Some(Timestamp::default()/* use setters */));
4632 /// let x = Subscription::new().set_or_clear_creation_time(None::<Timestamp>);
4633 /// ```
4634 pub fn set_or_clear_creation_time<T>(mut self, v: std::option::Option<T>) -> Self
4635 where
4636 T: std::convert::Into<wkt::Timestamp>,
4637 {
4638 self.creation_time = v.map(|x| x.into());
4639 self
4640 }
4641
4642 /// Sets the value of [last_modify_time][crate::model::Subscription::last_modify_time].
4643 ///
4644 /// # Example
4645 /// ```ignore,no_run
4646 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4647 /// use wkt::Timestamp;
4648 /// let x = Subscription::new().set_last_modify_time(Timestamp::default()/* use setters */);
4649 /// ```
4650 pub fn set_last_modify_time<T>(mut self, v: T) -> Self
4651 where
4652 T: std::convert::Into<wkt::Timestamp>,
4653 {
4654 self.last_modify_time = std::option::Option::Some(v.into());
4655 self
4656 }
4657
4658 /// Sets or clears the value of [last_modify_time][crate::model::Subscription::last_modify_time].
4659 ///
4660 /// # Example
4661 /// ```ignore,no_run
4662 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4663 /// use wkt::Timestamp;
4664 /// let x = Subscription::new().set_or_clear_last_modify_time(Some(Timestamp::default()/* use setters */));
4665 /// let x = Subscription::new().set_or_clear_last_modify_time(None::<Timestamp>);
4666 /// ```
4667 pub fn set_or_clear_last_modify_time<T>(mut self, v: std::option::Option<T>) -> Self
4668 where
4669 T: std::convert::Into<wkt::Timestamp>,
4670 {
4671 self.last_modify_time = v.map(|x| x.into());
4672 self
4673 }
4674
4675 /// Sets the value of [organization_id][crate::model::Subscription::organization_id].
4676 ///
4677 /// # Example
4678 /// ```ignore,no_run
4679 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4680 /// let x = Subscription::new().set_organization_id("example");
4681 /// ```
4682 pub fn set_organization_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4683 self.organization_id = v.into();
4684 self
4685 }
4686
4687 /// Sets the value of [organization_display_name][crate::model::Subscription::organization_display_name].
4688 ///
4689 /// # Example
4690 /// ```ignore,no_run
4691 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4692 /// let x = Subscription::new().set_organization_display_name("example");
4693 /// ```
4694 pub fn set_organization_display_name<T: std::convert::Into<std::string::String>>(
4695 mut self,
4696 v: T,
4697 ) -> Self {
4698 self.organization_display_name = v.into();
4699 self
4700 }
4701
4702 /// Sets the value of [state][crate::model::Subscription::state].
4703 ///
4704 /// # Example
4705 /// ```ignore,no_run
4706 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4707 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::State;
4708 /// let x0 = Subscription::new().set_state(State::Active);
4709 /// let x1 = Subscription::new().set_state(State::Stale);
4710 /// let x2 = Subscription::new().set_state(State::Inactive);
4711 /// ```
4712 pub fn set_state<T: std::convert::Into<crate::model::subscription::State>>(
4713 mut self,
4714 v: T,
4715 ) -> Self {
4716 self.state = v.into();
4717 self
4718 }
4719
4720 /// Sets the value of [linked_dataset_map][crate::model::Subscription::linked_dataset_map].
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::LinkedResource;
4726 /// let x = Subscription::new().set_linked_dataset_map([
4727 /// ("key0", LinkedResource::default()/* use setters */),
4728 /// ("key1", LinkedResource::default()/* use (different) setters */),
4729 /// ]);
4730 /// ```
4731 pub fn set_linked_dataset_map<T, K, V>(mut self, v: T) -> Self
4732 where
4733 T: std::iter::IntoIterator<Item = (K, V)>,
4734 K: std::convert::Into<std::string::String>,
4735 V: std::convert::Into<crate::model::subscription::LinkedResource>,
4736 {
4737 use std::iter::Iterator;
4738 self.linked_dataset_map = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4739 self
4740 }
4741
4742 /// Sets the value of [subscriber_contact][crate::model::Subscription::subscriber_contact].
4743 ///
4744 /// # Example
4745 /// ```ignore,no_run
4746 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4747 /// let x = Subscription::new().set_subscriber_contact("example");
4748 /// ```
4749 pub fn set_subscriber_contact<T: std::convert::Into<std::string::String>>(
4750 mut self,
4751 v: T,
4752 ) -> Self {
4753 self.subscriber_contact = v.into();
4754 self
4755 }
4756
4757 /// Sets the value of [linked_resources][crate::model::Subscription::linked_resources].
4758 ///
4759 /// # Example
4760 /// ```ignore,no_run
4761 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4762 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4763 /// let x = Subscription::new()
4764 /// .set_linked_resources([
4765 /// LinkedResource::default()/* use setters */,
4766 /// LinkedResource::default()/* use (different) setters */,
4767 /// ]);
4768 /// ```
4769 pub fn set_linked_resources<T, V>(mut self, v: T) -> Self
4770 where
4771 T: std::iter::IntoIterator<Item = V>,
4772 V: std::convert::Into<crate::model::subscription::LinkedResource>,
4773 {
4774 use std::iter::Iterator;
4775 self.linked_resources = v.into_iter().map(|i| i.into()).collect();
4776 self
4777 }
4778
4779 /// Sets the value of [resource_type][crate::model::Subscription::resource_type].
4780 ///
4781 /// # Example
4782 /// ```ignore,no_run
4783 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4784 /// use google_cloud_bigquery_analyticshub_v1::model::SharedResourceType;
4785 /// let x0 = Subscription::new().set_resource_type(SharedResourceType::BigqueryDataset);
4786 /// let x1 = Subscription::new().set_resource_type(SharedResourceType::PubsubTopic);
4787 /// ```
4788 pub fn set_resource_type<T: std::convert::Into<crate::model::SharedResourceType>>(
4789 mut self,
4790 v: T,
4791 ) -> Self {
4792 self.resource_type = v.into();
4793 self
4794 }
4795
4796 /// Sets the value of [commercial_info][crate::model::Subscription::commercial_info].
4797 ///
4798 /// # Example
4799 /// ```ignore,no_run
4800 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4801 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
4802 /// let x = Subscription::new().set_commercial_info(CommercialInfo::default()/* use setters */);
4803 /// ```
4804 pub fn set_commercial_info<T>(mut self, v: T) -> Self
4805 where
4806 T: std::convert::Into<crate::model::subscription::CommercialInfo>,
4807 {
4808 self.commercial_info = std::option::Option::Some(v.into());
4809 self
4810 }
4811
4812 /// Sets or clears the value of [commercial_info][crate::model::Subscription::commercial_info].
4813 ///
4814 /// # Example
4815 /// ```ignore,no_run
4816 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4817 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
4818 /// let x = Subscription::new().set_or_clear_commercial_info(Some(CommercialInfo::default()/* use setters */));
4819 /// let x = Subscription::new().set_or_clear_commercial_info(None::<CommercialInfo>);
4820 /// ```
4821 pub fn set_or_clear_commercial_info<T>(mut self, v: std::option::Option<T>) -> Self
4822 where
4823 T: std::convert::Into<crate::model::subscription::CommercialInfo>,
4824 {
4825 self.commercial_info = v.map(|x| x.into());
4826 self
4827 }
4828
4829 /// Sets the value of [log_linked_dataset_query_user_email][crate::model::Subscription::log_linked_dataset_query_user_email].
4830 ///
4831 /// # Example
4832 /// ```ignore,no_run
4833 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4834 /// let x = Subscription::new().set_log_linked_dataset_query_user_email(true);
4835 /// ```
4836 pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
4837 where
4838 T: std::convert::Into<bool>,
4839 {
4840 self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
4841 self
4842 }
4843
4844 /// Sets or clears the value of [log_linked_dataset_query_user_email][crate::model::Subscription::log_linked_dataset_query_user_email].
4845 ///
4846 /// # Example
4847 /// ```ignore,no_run
4848 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4849 /// let x = Subscription::new().set_or_clear_log_linked_dataset_query_user_email(Some(false));
4850 /// let x = Subscription::new().set_or_clear_log_linked_dataset_query_user_email(None::<bool>);
4851 /// ```
4852 pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
4853 mut self,
4854 v: std::option::Option<T>,
4855 ) -> Self
4856 where
4857 T: std::convert::Into<bool>,
4858 {
4859 self.log_linked_dataset_query_user_email = v.map(|x| x.into());
4860 self
4861 }
4862
4863 /// Sets the value of [destination_dataset][crate::model::Subscription::destination_dataset].
4864 ///
4865 /// # Example
4866 /// ```ignore,no_run
4867 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4868 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
4869 /// let x = Subscription::new().set_destination_dataset(DestinationDataset::default()/* use setters */);
4870 /// ```
4871 pub fn set_destination_dataset<T>(mut self, v: T) -> Self
4872 where
4873 T: std::convert::Into<crate::model::DestinationDataset>,
4874 {
4875 self.destination_dataset = std::option::Option::Some(v.into());
4876 self
4877 }
4878
4879 /// Sets or clears the value of [destination_dataset][crate::model::Subscription::destination_dataset].
4880 ///
4881 /// # Example
4882 /// ```ignore,no_run
4883 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4884 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
4885 /// let x = Subscription::new().set_or_clear_destination_dataset(Some(DestinationDataset::default()/* use setters */));
4886 /// let x = Subscription::new().set_or_clear_destination_dataset(None::<DestinationDataset>);
4887 /// ```
4888 pub fn set_or_clear_destination_dataset<T>(mut self, v: std::option::Option<T>) -> Self
4889 where
4890 T: std::convert::Into<crate::model::DestinationDataset>,
4891 {
4892 self.destination_dataset = v.map(|x| x.into());
4893 self
4894 }
4895
4896 /// Sets the value of [resource_name][crate::model::Subscription::resource_name].
4897 ///
4898 /// Note that all the setters affecting `resource_name` are mutually
4899 /// exclusive.
4900 ///
4901 /// # Example
4902 /// ```ignore,no_run
4903 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4904 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::ResourceName;
4905 /// let x = Subscription::new().set_resource_name(Some(ResourceName::Listing("example".to_string())));
4906 /// ```
4907 pub fn set_resource_name<
4908 T: std::convert::Into<std::option::Option<crate::model::subscription::ResourceName>>,
4909 >(
4910 mut self,
4911 v: T,
4912 ) -> Self {
4913 self.resource_name = v.into();
4914 self
4915 }
4916
4917 /// The value of [resource_name][crate::model::Subscription::resource_name]
4918 /// if it holds a `Listing`, `None` if the field is not set or
4919 /// holds a different branch.
4920 pub fn listing(&self) -> std::option::Option<&std::string::String> {
4921 #[allow(unreachable_patterns)]
4922 self.resource_name.as_ref().and_then(|v| match v {
4923 crate::model::subscription::ResourceName::Listing(v) => std::option::Option::Some(v),
4924 _ => std::option::Option::None,
4925 })
4926 }
4927
4928 /// Sets the value of [resource_name][crate::model::Subscription::resource_name]
4929 /// to hold a `Listing`.
4930 ///
4931 /// Note that all the setters affecting `resource_name` are
4932 /// mutually exclusive.
4933 ///
4934 /// # Example
4935 /// ```ignore,no_run
4936 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4937 /// let x = Subscription::new().set_listing("example");
4938 /// assert!(x.listing().is_some());
4939 /// assert!(x.data_exchange().is_none());
4940 /// ```
4941 pub fn set_listing<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4942 self.resource_name =
4943 std::option::Option::Some(crate::model::subscription::ResourceName::Listing(v.into()));
4944 self
4945 }
4946
4947 /// The value of [resource_name][crate::model::Subscription::resource_name]
4948 /// if it holds a `DataExchange`, `None` if the field is not set or
4949 /// holds a different branch.
4950 pub fn data_exchange(&self) -> std::option::Option<&std::string::String> {
4951 #[allow(unreachable_patterns)]
4952 self.resource_name.as_ref().and_then(|v| match v {
4953 crate::model::subscription::ResourceName::DataExchange(v) => {
4954 std::option::Option::Some(v)
4955 }
4956 _ => std::option::Option::None,
4957 })
4958 }
4959
4960 /// Sets the value of [resource_name][crate::model::Subscription::resource_name]
4961 /// to hold a `DataExchange`.
4962 ///
4963 /// Note that all the setters affecting `resource_name` are
4964 /// mutually exclusive.
4965 ///
4966 /// # Example
4967 /// ```ignore,no_run
4968 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4969 /// let x = Subscription::new().set_data_exchange("example");
4970 /// assert!(x.data_exchange().is_some());
4971 /// assert!(x.listing().is_none());
4972 /// ```
4973 pub fn set_data_exchange<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4974 self.resource_name = std::option::Option::Some(
4975 crate::model::subscription::ResourceName::DataExchange(v.into()),
4976 );
4977 self
4978 }
4979}
4980
4981impl wkt::message::Message for Subscription {
4982 fn typename() -> &'static str {
4983 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription"
4984 }
4985}
4986
4987/// Defines additional types related to [Subscription].
4988pub mod subscription {
4989 #[allow(unused_imports)]
4990 use super::*;
4991
4992 /// Reference to a linked resource tracked by this Subscription.
4993 #[derive(Clone, Default, PartialEq)]
4994 #[non_exhaustive]
4995 pub struct LinkedResource {
4996 /// Output only. Listing for which linked resource is created.
4997 pub listing: std::string::String,
4998
4999 #[allow(missing_docs)]
5000 pub reference: std::option::Option<crate::model::subscription::linked_resource::Reference>,
5001
5002 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5003 }
5004
5005 impl LinkedResource {
5006 /// Creates a new default instance.
5007 pub fn new() -> Self {
5008 std::default::Default::default()
5009 }
5010
5011 /// Sets the value of [listing][crate::model::subscription::LinkedResource::listing].
5012 ///
5013 /// # Example
5014 /// ```ignore,no_run
5015 /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
5016 /// let x = LinkedResource::new().set_listing("example");
5017 /// ```
5018 pub fn set_listing<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5019 self.listing = v.into();
5020 self
5021 }
5022
5023 /// Sets the value of [reference][crate::model::subscription::LinkedResource::reference].
5024 ///
5025 /// Note that all the setters affecting `reference` are mutually
5026 /// exclusive.
5027 ///
5028 /// # Example
5029 /// ```ignore,no_run
5030 /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
5031 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::linked_resource::Reference;
5032 /// let x = LinkedResource::new().set_reference(Some(Reference::LinkedDataset("example".to_string())));
5033 /// ```
5034 pub fn set_reference<
5035 T: std::convert::Into<
5036 std::option::Option<crate::model::subscription::linked_resource::Reference>,
5037 >,
5038 >(
5039 mut self,
5040 v: T,
5041 ) -> Self {
5042 self.reference = v.into();
5043 self
5044 }
5045
5046 /// The value of [reference][crate::model::subscription::LinkedResource::reference]
5047 /// if it holds a `LinkedDataset`, `None` if the field is not set or
5048 /// holds a different branch.
5049 pub fn linked_dataset(&self) -> std::option::Option<&std::string::String> {
5050 #[allow(unreachable_patterns)]
5051 self.reference.as_ref().and_then(|v| match v {
5052 crate::model::subscription::linked_resource::Reference::LinkedDataset(v) => {
5053 std::option::Option::Some(v)
5054 }
5055 _ => std::option::Option::None,
5056 })
5057 }
5058
5059 /// Sets the value of [reference][crate::model::subscription::LinkedResource::reference]
5060 /// to hold a `LinkedDataset`.
5061 ///
5062 /// Note that all the setters affecting `reference` are
5063 /// mutually exclusive.
5064 ///
5065 /// # Example
5066 /// ```ignore,no_run
5067 /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
5068 /// let x = LinkedResource::new().set_linked_dataset("example");
5069 /// assert!(x.linked_dataset().is_some());
5070 /// assert!(x.linked_pubsub_subscription().is_none());
5071 /// ```
5072 pub fn set_linked_dataset<T: std::convert::Into<std::string::String>>(
5073 mut self,
5074 v: T,
5075 ) -> Self {
5076 self.reference = std::option::Option::Some(
5077 crate::model::subscription::linked_resource::Reference::LinkedDataset(v.into()),
5078 );
5079 self
5080 }
5081
5082 /// The value of [reference][crate::model::subscription::LinkedResource::reference]
5083 /// if it holds a `LinkedPubsubSubscription`, `None` if the field is not set or
5084 /// holds a different branch.
5085 pub fn linked_pubsub_subscription(&self) -> std::option::Option<&std::string::String> {
5086 #[allow(unreachable_patterns)]
5087 self.reference.as_ref().and_then(|v| match v {
5088 crate::model::subscription::linked_resource::Reference::LinkedPubsubSubscription(v) => std::option::Option::Some(v),
5089 _ => std::option::Option::None,
5090 })
5091 }
5092
5093 /// Sets the value of [reference][crate::model::subscription::LinkedResource::reference]
5094 /// to hold a `LinkedPubsubSubscription`.
5095 ///
5096 /// Note that all the setters affecting `reference` are
5097 /// mutually exclusive.
5098 ///
5099 /// # Example
5100 /// ```ignore,no_run
5101 /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
5102 /// let x = LinkedResource::new().set_linked_pubsub_subscription("example");
5103 /// assert!(x.linked_pubsub_subscription().is_some());
5104 /// assert!(x.linked_dataset().is_none());
5105 /// ```
5106 pub fn set_linked_pubsub_subscription<T: std::convert::Into<std::string::String>>(
5107 mut self,
5108 v: T,
5109 ) -> Self {
5110 self.reference = std::option::Option::Some(
5111 crate::model::subscription::linked_resource::Reference::LinkedPubsubSubscription(
5112 v.into(),
5113 ),
5114 );
5115 self
5116 }
5117 }
5118
5119 impl wkt::message::Message for LinkedResource {
5120 fn typename() -> &'static str {
5121 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.LinkedResource"
5122 }
5123 }
5124
5125 /// Defines additional types related to [LinkedResource].
5126 pub mod linked_resource {
5127 #[allow(unused_imports)]
5128 use super::*;
5129
5130 #[allow(missing_docs)]
5131 #[derive(Clone, Debug, PartialEq)]
5132 #[non_exhaustive]
5133 pub enum Reference {
5134 /// Output only. Name of the linked dataset, e.g.
5135 /// projects/subscriberproject/datasets/linked_dataset
5136 LinkedDataset(std::string::String),
5137 /// Output only. Name of the Pub/Sub subscription, e.g.
5138 /// projects/subscriberproject/subscriptions/subscriptions/sub_id
5139 LinkedPubsubSubscription(std::string::String),
5140 }
5141 }
5142
5143 /// Commercial info metadata for this subscription.
5144 #[derive(Clone, Default, PartialEq)]
5145 #[non_exhaustive]
5146 pub struct CommercialInfo {
5147 /// Output only. This is set when the subscription is commercialised via
5148 /// Cloud Marketplace.
5149 pub cloud_marketplace: std::option::Option<
5150 crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
5151 >,
5152
5153 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5154 }
5155
5156 impl CommercialInfo {
5157 /// Creates a new default instance.
5158 pub fn new() -> Self {
5159 std::default::Default::default()
5160 }
5161
5162 /// Sets the value of [cloud_marketplace][crate::model::subscription::CommercialInfo::cloud_marketplace].
5163 ///
5164 /// # Example
5165 /// ```ignore,no_run
5166 /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
5167 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::commercial_info::GoogleCloudMarketplaceInfo;
5168 /// let x = CommercialInfo::new().set_cloud_marketplace(GoogleCloudMarketplaceInfo::default()/* use setters */);
5169 /// ```
5170 pub fn set_cloud_marketplace<T>(mut self, v: T) -> Self
5171 where
5172 T: std::convert::Into<
5173 crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
5174 >,
5175 {
5176 self.cloud_marketplace = std::option::Option::Some(v.into());
5177 self
5178 }
5179
5180 /// Sets or clears the value of [cloud_marketplace][crate::model::subscription::CommercialInfo::cloud_marketplace].
5181 ///
5182 /// # Example
5183 /// ```ignore,no_run
5184 /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
5185 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::commercial_info::GoogleCloudMarketplaceInfo;
5186 /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(Some(GoogleCloudMarketplaceInfo::default()/* use setters */));
5187 /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(None::<GoogleCloudMarketplaceInfo>);
5188 /// ```
5189 pub fn set_or_clear_cloud_marketplace<T>(mut self, v: std::option::Option<T>) -> Self
5190 where
5191 T: std::convert::Into<
5192 crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
5193 >,
5194 {
5195 self.cloud_marketplace = v.map(|x| x.into());
5196 self
5197 }
5198 }
5199
5200 impl wkt::message::Message for CommercialInfo {
5201 fn typename() -> &'static str {
5202 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.CommercialInfo"
5203 }
5204 }
5205
5206 /// Defines additional types related to [CommercialInfo].
5207 pub mod commercial_info {
5208 #[allow(unused_imports)]
5209 use super::*;
5210
5211 /// Cloud Marketplace commercial metadata for this subscription.
5212 #[derive(Clone, Default, PartialEq)]
5213 #[non_exhaustive]
5214 pub struct GoogleCloudMarketplaceInfo {
5215 /// Resource name of the Marketplace Order.
5216 pub order: std::string::String,
5217
5218 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5219 }
5220
5221 impl GoogleCloudMarketplaceInfo {
5222 /// Creates a new default instance.
5223 pub fn new() -> Self {
5224 std::default::Default::default()
5225 }
5226
5227 /// Sets the value of [order][crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo::order].
5228 ///
5229 /// # Example
5230 /// ```ignore,no_run
5231 /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::commercial_info::GoogleCloudMarketplaceInfo;
5232 /// let x = GoogleCloudMarketplaceInfo::new().set_order("example");
5233 /// ```
5234 pub fn set_order<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5235 self.order = v.into();
5236 self
5237 }
5238 }
5239
5240 impl wkt::message::Message for GoogleCloudMarketplaceInfo {
5241 fn typename() -> &'static str {
5242 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.CommercialInfo.GoogleCloudMarketplaceInfo"
5243 }
5244 }
5245 }
5246
5247 /// State of the subscription.
5248 ///
5249 /// # Working with unknown values
5250 ///
5251 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5252 /// additional enum variants at any time. Adding new variants is not considered
5253 /// a breaking change. Applications should write their code in anticipation of:
5254 ///
5255 /// - New values appearing in future releases of the client library, **and**
5256 /// - New values received dynamically, without application changes.
5257 ///
5258 /// Please consult the [Working with enums] section in the user guide for some
5259 /// guidelines.
5260 ///
5261 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5262 #[derive(Clone, Debug, PartialEq)]
5263 #[non_exhaustive]
5264 pub enum State {
5265 /// Default value. This value is unused.
5266 Unspecified,
5267 /// This subscription is active and the data is accessible.
5268 Active,
5269 /// The data referenced by this subscription is out of date and should be
5270 /// refreshed. This can happen when a data provider adds or removes datasets.
5271 Stale,
5272 /// This subscription has been cancelled or revoked and the data is no longer
5273 /// accessible.
5274 Inactive,
5275 /// If set, the enum was initialized with an unknown value.
5276 ///
5277 /// Applications can examine the value using [State::value] or
5278 /// [State::name].
5279 UnknownValue(state::UnknownValue),
5280 }
5281
5282 #[doc(hidden)]
5283 pub mod state {
5284 #[allow(unused_imports)]
5285 use super::*;
5286 #[derive(Clone, Debug, PartialEq)]
5287 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5288 }
5289
5290 impl State {
5291 /// Gets the enum value.
5292 ///
5293 /// Returns `None` if the enum contains an unknown value deserialized from
5294 /// the string representation of enums.
5295 pub fn value(&self) -> std::option::Option<i32> {
5296 match self {
5297 Self::Unspecified => std::option::Option::Some(0),
5298 Self::Active => std::option::Option::Some(1),
5299 Self::Stale => std::option::Option::Some(2),
5300 Self::Inactive => std::option::Option::Some(3),
5301 Self::UnknownValue(u) => u.0.value(),
5302 }
5303 }
5304
5305 /// Gets the enum value as a string.
5306 ///
5307 /// Returns `None` if the enum contains an unknown value deserialized from
5308 /// the integer representation of enums.
5309 pub fn name(&self) -> std::option::Option<&str> {
5310 match self {
5311 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5312 Self::Active => std::option::Option::Some("STATE_ACTIVE"),
5313 Self::Stale => std::option::Option::Some("STATE_STALE"),
5314 Self::Inactive => std::option::Option::Some("STATE_INACTIVE"),
5315 Self::UnknownValue(u) => u.0.name(),
5316 }
5317 }
5318 }
5319
5320 impl std::default::Default for State {
5321 fn default() -> Self {
5322 use std::convert::From;
5323 Self::from(0)
5324 }
5325 }
5326
5327 impl std::fmt::Display for State {
5328 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5329 wkt::internal::display_enum(f, self.name(), self.value())
5330 }
5331 }
5332
5333 impl std::convert::From<i32> for State {
5334 fn from(value: i32) -> Self {
5335 match value {
5336 0 => Self::Unspecified,
5337 1 => Self::Active,
5338 2 => Self::Stale,
5339 3 => Self::Inactive,
5340 _ => Self::UnknownValue(state::UnknownValue(
5341 wkt::internal::UnknownEnumValue::Integer(value),
5342 )),
5343 }
5344 }
5345 }
5346
5347 impl std::convert::From<&str> for State {
5348 fn from(value: &str) -> Self {
5349 use std::string::ToString;
5350 match value {
5351 "STATE_UNSPECIFIED" => Self::Unspecified,
5352 "STATE_ACTIVE" => Self::Active,
5353 "STATE_STALE" => Self::Stale,
5354 "STATE_INACTIVE" => Self::Inactive,
5355 _ => Self::UnknownValue(state::UnknownValue(
5356 wkt::internal::UnknownEnumValue::String(value.to_string()),
5357 )),
5358 }
5359 }
5360 }
5361
5362 impl serde::ser::Serialize for State {
5363 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5364 where
5365 S: serde::Serializer,
5366 {
5367 match self {
5368 Self::Unspecified => serializer.serialize_i32(0),
5369 Self::Active => serializer.serialize_i32(1),
5370 Self::Stale => serializer.serialize_i32(2),
5371 Self::Inactive => serializer.serialize_i32(3),
5372 Self::UnknownValue(u) => u.0.serialize(serializer),
5373 }
5374 }
5375 }
5376
5377 impl<'de> serde::de::Deserialize<'de> for State {
5378 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5379 where
5380 D: serde::Deserializer<'de>,
5381 {
5382 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5383 ".google.cloud.bigquery.analyticshub.v1.Subscription.State",
5384 ))
5385 }
5386 }
5387
5388 #[allow(missing_docs)]
5389 #[derive(Clone, Debug, PartialEq)]
5390 #[non_exhaustive]
5391 pub enum ResourceName {
5392 /// Output only. Resource name of the source Listing.
5393 /// e.g. projects/123/locations/us/dataExchanges/456/listings/789
5394 Listing(std::string::String),
5395 /// Output only. Resource name of the source Data Exchange.
5396 /// e.g. projects/123/locations/us/dataExchanges/456
5397 DataExchange(std::string::String),
5398 }
5399}
5400
5401/// Message for requesting the list of data exchanges.
5402#[derive(Clone, Default, PartialEq)]
5403#[non_exhaustive]
5404pub struct ListDataExchangesRequest {
5405 /// Required. The parent resource path of the data exchanges.
5406 /// e.g. `projects/myproject/locations/us`.
5407 pub parent: std::string::String,
5408
5409 /// The maximum number of results to return in a single response page. Leverage
5410 /// the page tokens to iterate through the entire collection.
5411 pub page_size: i32,
5412
5413 /// Page token, returned by a previous call, to request the next page of
5414 /// results.
5415 pub page_token: std::string::String,
5416
5417 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5418}
5419
5420impl ListDataExchangesRequest {
5421 /// Creates a new default instance.
5422 pub fn new() -> Self {
5423 std::default::Default::default()
5424 }
5425
5426 /// Sets the value of [parent][crate::model::ListDataExchangesRequest::parent].
5427 ///
5428 /// # Example
5429 /// ```ignore,no_run
5430 /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesRequest;
5431 /// # let project_id = "project_id";
5432 /// # let location_id = "location_id";
5433 /// let x = ListDataExchangesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5434 /// ```
5435 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5436 self.parent = v.into();
5437 self
5438 }
5439
5440 /// Sets the value of [page_size][crate::model::ListDataExchangesRequest::page_size].
5441 ///
5442 /// # Example
5443 /// ```ignore,no_run
5444 /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesRequest;
5445 /// let x = ListDataExchangesRequest::new().set_page_size(42);
5446 /// ```
5447 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5448 self.page_size = v.into();
5449 self
5450 }
5451
5452 /// Sets the value of [page_token][crate::model::ListDataExchangesRequest::page_token].
5453 ///
5454 /// # Example
5455 /// ```ignore,no_run
5456 /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesRequest;
5457 /// let x = ListDataExchangesRequest::new().set_page_token("example");
5458 /// ```
5459 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5460 self.page_token = v.into();
5461 self
5462 }
5463}
5464
5465impl wkt::message::Message for ListDataExchangesRequest {
5466 fn typename() -> &'static str {
5467 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest"
5468 }
5469}
5470
5471/// Message for response to the list of data exchanges.
5472#[derive(Clone, Default, PartialEq)]
5473#[non_exhaustive]
5474pub struct ListDataExchangesResponse {
5475 /// The list of data exchanges.
5476 pub data_exchanges: std::vec::Vec<crate::model::DataExchange>,
5477
5478 /// A token to request the next page of results.
5479 pub next_page_token: std::string::String,
5480
5481 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5482}
5483
5484impl ListDataExchangesResponse {
5485 /// Creates a new default instance.
5486 pub fn new() -> Self {
5487 std::default::Default::default()
5488 }
5489
5490 /// Sets the value of [data_exchanges][crate::model::ListDataExchangesResponse::data_exchanges].
5491 ///
5492 /// # Example
5493 /// ```ignore,no_run
5494 /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesResponse;
5495 /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5496 /// let x = ListDataExchangesResponse::new()
5497 /// .set_data_exchanges([
5498 /// DataExchange::default()/* use setters */,
5499 /// DataExchange::default()/* use (different) setters */,
5500 /// ]);
5501 /// ```
5502 pub fn set_data_exchanges<T, V>(mut self, v: T) -> Self
5503 where
5504 T: std::iter::IntoIterator<Item = V>,
5505 V: std::convert::Into<crate::model::DataExchange>,
5506 {
5507 use std::iter::Iterator;
5508 self.data_exchanges = v.into_iter().map(|i| i.into()).collect();
5509 self
5510 }
5511
5512 /// Sets the value of [next_page_token][crate::model::ListDataExchangesResponse::next_page_token].
5513 ///
5514 /// # Example
5515 /// ```ignore,no_run
5516 /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesResponse;
5517 /// let x = ListDataExchangesResponse::new().set_next_page_token("example");
5518 /// ```
5519 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5520 self.next_page_token = v.into();
5521 self
5522 }
5523}
5524
5525impl wkt::message::Message for ListDataExchangesResponse {
5526 fn typename() -> &'static str {
5527 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse"
5528 }
5529}
5530
5531#[doc(hidden)]
5532impl google_cloud_gax::paginator::internal::PageableResponse for ListDataExchangesResponse {
5533 type PageItem = crate::model::DataExchange;
5534
5535 fn items(self) -> std::vec::Vec<Self::PageItem> {
5536 self.data_exchanges
5537 }
5538
5539 fn next_page_token(&self) -> std::string::String {
5540 use std::clone::Clone;
5541 self.next_page_token.clone()
5542 }
5543}
5544
5545/// Message for requesting the list of data exchanges from projects in an
5546/// organization and location.
5547#[derive(Clone, Default, PartialEq)]
5548#[non_exhaustive]
5549pub struct ListOrgDataExchangesRequest {
5550 /// Required. The organization resource path of the projects containing
5551 /// DataExchanges. e.g. `organizations/myorg/locations/us`.
5552 pub organization: std::string::String,
5553
5554 /// The maximum number of results to return in a single response page. Leverage
5555 /// the page tokens to iterate through the entire collection.
5556 pub page_size: i32,
5557
5558 /// Page token, returned by a previous call, to request the next page of
5559 /// results.
5560 pub page_token: std::string::String,
5561
5562 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5563}
5564
5565impl ListOrgDataExchangesRequest {
5566 /// Creates a new default instance.
5567 pub fn new() -> Self {
5568 std::default::Default::default()
5569 }
5570
5571 /// Sets the value of [organization][crate::model::ListOrgDataExchangesRequest::organization].
5572 ///
5573 /// # Example
5574 /// ```ignore,no_run
5575 /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesRequest;
5576 /// let x = ListOrgDataExchangesRequest::new().set_organization("example");
5577 /// ```
5578 pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5579 self.organization = v.into();
5580 self
5581 }
5582
5583 /// Sets the value of [page_size][crate::model::ListOrgDataExchangesRequest::page_size].
5584 ///
5585 /// # Example
5586 /// ```ignore,no_run
5587 /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesRequest;
5588 /// let x = ListOrgDataExchangesRequest::new().set_page_size(42);
5589 /// ```
5590 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5591 self.page_size = v.into();
5592 self
5593 }
5594
5595 /// Sets the value of [page_token][crate::model::ListOrgDataExchangesRequest::page_token].
5596 ///
5597 /// # Example
5598 /// ```ignore,no_run
5599 /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesRequest;
5600 /// let x = ListOrgDataExchangesRequest::new().set_page_token("example");
5601 /// ```
5602 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5603 self.page_token = v.into();
5604 self
5605 }
5606}
5607
5608impl wkt::message::Message for ListOrgDataExchangesRequest {
5609 fn typename() -> &'static str {
5610 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest"
5611 }
5612}
5613
5614/// Message for response to listing data exchanges in an organization and
5615/// location.
5616#[derive(Clone, Default, PartialEq)]
5617#[non_exhaustive]
5618pub struct ListOrgDataExchangesResponse {
5619 /// The list of data exchanges.
5620 pub data_exchanges: std::vec::Vec<crate::model::DataExchange>,
5621
5622 /// A token to request the next page of results.
5623 pub next_page_token: std::string::String,
5624
5625 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5626}
5627
5628impl ListOrgDataExchangesResponse {
5629 /// Creates a new default instance.
5630 pub fn new() -> Self {
5631 std::default::Default::default()
5632 }
5633
5634 /// Sets the value of [data_exchanges][crate::model::ListOrgDataExchangesResponse::data_exchanges].
5635 ///
5636 /// # Example
5637 /// ```ignore,no_run
5638 /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesResponse;
5639 /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5640 /// let x = ListOrgDataExchangesResponse::new()
5641 /// .set_data_exchanges([
5642 /// DataExchange::default()/* use setters */,
5643 /// DataExchange::default()/* use (different) setters */,
5644 /// ]);
5645 /// ```
5646 pub fn set_data_exchanges<T, V>(mut self, v: T) -> Self
5647 where
5648 T: std::iter::IntoIterator<Item = V>,
5649 V: std::convert::Into<crate::model::DataExchange>,
5650 {
5651 use std::iter::Iterator;
5652 self.data_exchanges = v.into_iter().map(|i| i.into()).collect();
5653 self
5654 }
5655
5656 /// Sets the value of [next_page_token][crate::model::ListOrgDataExchangesResponse::next_page_token].
5657 ///
5658 /// # Example
5659 /// ```ignore,no_run
5660 /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesResponse;
5661 /// let x = ListOrgDataExchangesResponse::new().set_next_page_token("example");
5662 /// ```
5663 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5664 self.next_page_token = v.into();
5665 self
5666 }
5667}
5668
5669impl wkt::message::Message for ListOrgDataExchangesResponse {
5670 fn typename() -> &'static str {
5671 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse"
5672 }
5673}
5674
5675#[doc(hidden)]
5676impl google_cloud_gax::paginator::internal::PageableResponse for ListOrgDataExchangesResponse {
5677 type PageItem = crate::model::DataExchange;
5678
5679 fn items(self) -> std::vec::Vec<Self::PageItem> {
5680 self.data_exchanges
5681 }
5682
5683 fn next_page_token(&self) -> std::string::String {
5684 use std::clone::Clone;
5685 self.next_page_token.clone()
5686 }
5687}
5688
5689/// Message for getting a data exchange.
5690#[derive(Clone, Default, PartialEq)]
5691#[non_exhaustive]
5692pub struct GetDataExchangeRequest {
5693 /// Required. The resource name of the data exchange.
5694 /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
5695 pub name: std::string::String,
5696
5697 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5698}
5699
5700impl GetDataExchangeRequest {
5701 /// Creates a new default instance.
5702 pub fn new() -> Self {
5703 std::default::Default::default()
5704 }
5705
5706 /// Sets the value of [name][crate::model::GetDataExchangeRequest::name].
5707 ///
5708 /// # Example
5709 /// ```ignore,no_run
5710 /// # use google_cloud_bigquery_analyticshub_v1::model::GetDataExchangeRequest;
5711 /// # let project_id = "project_id";
5712 /// # let location_id = "location_id";
5713 /// # let data_exchange_id = "data_exchange_id";
5714 /// let x = GetDataExchangeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
5715 /// ```
5716 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5717 self.name = v.into();
5718 self
5719 }
5720}
5721
5722impl wkt::message::Message for GetDataExchangeRequest {
5723 fn typename() -> &'static str {
5724 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest"
5725 }
5726}
5727
5728/// Message for creating a data exchange.
5729#[derive(Clone, Default, PartialEq)]
5730#[non_exhaustive]
5731pub struct CreateDataExchangeRequest {
5732 /// Required. The parent resource path of the data exchange.
5733 /// e.g. `projects/myproject/locations/us`.
5734 pub parent: std::string::String,
5735
5736 /// Required. The ID of the data exchange.
5737 /// Must contain only Unicode letters, numbers (0-9), underscores (_).
5738 /// Max length: 100 bytes.
5739 pub data_exchange_id: std::string::String,
5740
5741 /// Required. The data exchange to create.
5742 pub data_exchange: std::option::Option<crate::model::DataExchange>,
5743
5744 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5745}
5746
5747impl CreateDataExchangeRequest {
5748 /// Creates a new default instance.
5749 pub fn new() -> Self {
5750 std::default::Default::default()
5751 }
5752
5753 /// Sets the value of [parent][crate::model::CreateDataExchangeRequest::parent].
5754 ///
5755 /// # Example
5756 /// ```ignore,no_run
5757 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5758 /// # let project_id = "project_id";
5759 /// # let location_id = "location_id";
5760 /// let x = CreateDataExchangeRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5761 /// ```
5762 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5763 self.parent = v.into();
5764 self
5765 }
5766
5767 /// Sets the value of [data_exchange_id][crate::model::CreateDataExchangeRequest::data_exchange_id].
5768 ///
5769 /// # Example
5770 /// ```ignore,no_run
5771 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5772 /// let x = CreateDataExchangeRequest::new().set_data_exchange_id("example");
5773 /// ```
5774 pub fn set_data_exchange_id<T: std::convert::Into<std::string::String>>(
5775 mut self,
5776 v: T,
5777 ) -> Self {
5778 self.data_exchange_id = v.into();
5779 self
5780 }
5781
5782 /// Sets the value of [data_exchange][crate::model::CreateDataExchangeRequest::data_exchange].
5783 ///
5784 /// # Example
5785 /// ```ignore,no_run
5786 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5787 /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5788 /// let x = CreateDataExchangeRequest::new().set_data_exchange(DataExchange::default()/* use setters */);
5789 /// ```
5790 pub fn set_data_exchange<T>(mut self, v: T) -> Self
5791 where
5792 T: std::convert::Into<crate::model::DataExchange>,
5793 {
5794 self.data_exchange = std::option::Option::Some(v.into());
5795 self
5796 }
5797
5798 /// Sets or clears the value of [data_exchange][crate::model::CreateDataExchangeRequest::data_exchange].
5799 ///
5800 /// # Example
5801 /// ```ignore,no_run
5802 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5803 /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5804 /// let x = CreateDataExchangeRequest::new().set_or_clear_data_exchange(Some(DataExchange::default()/* use setters */));
5805 /// let x = CreateDataExchangeRequest::new().set_or_clear_data_exchange(None::<DataExchange>);
5806 /// ```
5807 pub fn set_or_clear_data_exchange<T>(mut self, v: std::option::Option<T>) -> Self
5808 where
5809 T: std::convert::Into<crate::model::DataExchange>,
5810 {
5811 self.data_exchange = v.map(|x| x.into());
5812 self
5813 }
5814}
5815
5816impl wkt::message::Message for CreateDataExchangeRequest {
5817 fn typename() -> &'static str {
5818 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest"
5819 }
5820}
5821
5822/// Message for updating a data exchange.
5823#[derive(Clone, Default, PartialEq)]
5824#[non_exhaustive]
5825pub struct UpdateDataExchangeRequest {
5826 /// Required. Field mask specifies the fields to update in the data exchange
5827 /// resource. The fields specified in the
5828 /// `updateMask` are relative to the resource and are not a full request.
5829 pub update_mask: std::option::Option<wkt::FieldMask>,
5830
5831 /// Required. The data exchange to update.
5832 pub data_exchange: std::option::Option<crate::model::DataExchange>,
5833
5834 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5835}
5836
5837impl UpdateDataExchangeRequest {
5838 /// Creates a new default instance.
5839 pub fn new() -> Self {
5840 std::default::Default::default()
5841 }
5842
5843 /// Sets the value of [update_mask][crate::model::UpdateDataExchangeRequest::update_mask].
5844 ///
5845 /// # Example
5846 /// ```ignore,no_run
5847 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5848 /// use wkt::FieldMask;
5849 /// let x = UpdateDataExchangeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5850 /// ```
5851 pub fn set_update_mask<T>(mut self, v: T) -> Self
5852 where
5853 T: std::convert::Into<wkt::FieldMask>,
5854 {
5855 self.update_mask = std::option::Option::Some(v.into());
5856 self
5857 }
5858
5859 /// Sets or clears the value of [update_mask][crate::model::UpdateDataExchangeRequest::update_mask].
5860 ///
5861 /// # Example
5862 /// ```ignore,no_run
5863 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5864 /// use wkt::FieldMask;
5865 /// let x = UpdateDataExchangeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5866 /// let x = UpdateDataExchangeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5867 /// ```
5868 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5869 where
5870 T: std::convert::Into<wkt::FieldMask>,
5871 {
5872 self.update_mask = v.map(|x| x.into());
5873 self
5874 }
5875
5876 /// Sets the value of [data_exchange][crate::model::UpdateDataExchangeRequest::data_exchange].
5877 ///
5878 /// # Example
5879 /// ```ignore,no_run
5880 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5881 /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5882 /// let x = UpdateDataExchangeRequest::new().set_data_exchange(DataExchange::default()/* use setters */);
5883 /// ```
5884 pub fn set_data_exchange<T>(mut self, v: T) -> Self
5885 where
5886 T: std::convert::Into<crate::model::DataExchange>,
5887 {
5888 self.data_exchange = std::option::Option::Some(v.into());
5889 self
5890 }
5891
5892 /// Sets or clears the value of [data_exchange][crate::model::UpdateDataExchangeRequest::data_exchange].
5893 ///
5894 /// # Example
5895 /// ```ignore,no_run
5896 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5897 /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5898 /// let x = UpdateDataExchangeRequest::new().set_or_clear_data_exchange(Some(DataExchange::default()/* use setters */));
5899 /// let x = UpdateDataExchangeRequest::new().set_or_clear_data_exchange(None::<DataExchange>);
5900 /// ```
5901 pub fn set_or_clear_data_exchange<T>(mut self, v: std::option::Option<T>) -> Self
5902 where
5903 T: std::convert::Into<crate::model::DataExchange>,
5904 {
5905 self.data_exchange = v.map(|x| x.into());
5906 self
5907 }
5908}
5909
5910impl wkt::message::Message for UpdateDataExchangeRequest {
5911 fn typename() -> &'static str {
5912 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest"
5913 }
5914}
5915
5916/// Message for deleting a data exchange.
5917#[derive(Clone, Default, PartialEq)]
5918#[non_exhaustive]
5919pub struct DeleteDataExchangeRequest {
5920 /// Required. The full name of the data exchange resource that you want to
5921 /// delete. For example, `projects/myproject/locations/us/dataExchanges/123`.
5922 pub name: std::string::String,
5923
5924 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5925}
5926
5927impl DeleteDataExchangeRequest {
5928 /// Creates a new default instance.
5929 pub fn new() -> Self {
5930 std::default::Default::default()
5931 }
5932
5933 /// Sets the value of [name][crate::model::DeleteDataExchangeRequest::name].
5934 ///
5935 /// # Example
5936 /// ```ignore,no_run
5937 /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteDataExchangeRequest;
5938 /// # let project_id = "project_id";
5939 /// # let location_id = "location_id";
5940 /// # let data_exchange_id = "data_exchange_id";
5941 /// let x = DeleteDataExchangeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
5942 /// ```
5943 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5944 self.name = v.into();
5945 self
5946 }
5947}
5948
5949impl wkt::message::Message for DeleteDataExchangeRequest {
5950 fn typename() -> &'static str {
5951 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest"
5952 }
5953}
5954
5955/// Message for requesting the list of listings.
5956#[derive(Clone, Default, PartialEq)]
5957#[non_exhaustive]
5958pub struct ListListingsRequest {
5959 /// Required. The parent resource path of the listing.
5960 /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
5961 pub parent: std::string::String,
5962
5963 /// The maximum number of results to return in a single response page. Leverage
5964 /// the page tokens to iterate through the entire collection.
5965 pub page_size: i32,
5966
5967 /// Page token, returned by a previous call, to request the next page of
5968 /// results.
5969 pub page_token: std::string::String,
5970
5971 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5972}
5973
5974impl ListListingsRequest {
5975 /// Creates a new default instance.
5976 pub fn new() -> Self {
5977 std::default::Default::default()
5978 }
5979
5980 /// Sets the value of [parent][crate::model::ListListingsRequest::parent].
5981 ///
5982 /// # Example
5983 /// ```ignore,no_run
5984 /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsRequest;
5985 /// # let project_id = "project_id";
5986 /// # let location_id = "location_id";
5987 /// # let data_exchange_id = "data_exchange_id";
5988 /// let x = ListListingsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
5989 /// ```
5990 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5991 self.parent = v.into();
5992 self
5993 }
5994
5995 /// Sets the value of [page_size][crate::model::ListListingsRequest::page_size].
5996 ///
5997 /// # Example
5998 /// ```ignore,no_run
5999 /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsRequest;
6000 /// let x = ListListingsRequest::new().set_page_size(42);
6001 /// ```
6002 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6003 self.page_size = v.into();
6004 self
6005 }
6006
6007 /// Sets the value of [page_token][crate::model::ListListingsRequest::page_token].
6008 ///
6009 /// # Example
6010 /// ```ignore,no_run
6011 /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsRequest;
6012 /// let x = ListListingsRequest::new().set_page_token("example");
6013 /// ```
6014 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6015 self.page_token = v.into();
6016 self
6017 }
6018}
6019
6020impl wkt::message::Message for ListListingsRequest {
6021 fn typename() -> &'static str {
6022 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListListingsRequest"
6023 }
6024}
6025
6026/// Message for response to the list of Listings.
6027#[derive(Clone, Default, PartialEq)]
6028#[non_exhaustive]
6029pub struct ListListingsResponse {
6030 /// The list of Listing.
6031 pub listings: std::vec::Vec<crate::model::Listing>,
6032
6033 /// A token to request the next page of results.
6034 pub next_page_token: std::string::String,
6035
6036 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6037}
6038
6039impl ListListingsResponse {
6040 /// Creates a new default instance.
6041 pub fn new() -> Self {
6042 std::default::Default::default()
6043 }
6044
6045 /// Sets the value of [listings][crate::model::ListListingsResponse::listings].
6046 ///
6047 /// # Example
6048 /// ```ignore,no_run
6049 /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsResponse;
6050 /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6051 /// let x = ListListingsResponse::new()
6052 /// .set_listings([
6053 /// Listing::default()/* use setters */,
6054 /// Listing::default()/* use (different) setters */,
6055 /// ]);
6056 /// ```
6057 pub fn set_listings<T, V>(mut self, v: T) -> Self
6058 where
6059 T: std::iter::IntoIterator<Item = V>,
6060 V: std::convert::Into<crate::model::Listing>,
6061 {
6062 use std::iter::Iterator;
6063 self.listings = v.into_iter().map(|i| i.into()).collect();
6064 self
6065 }
6066
6067 /// Sets the value of [next_page_token][crate::model::ListListingsResponse::next_page_token].
6068 ///
6069 /// # Example
6070 /// ```ignore,no_run
6071 /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsResponse;
6072 /// let x = ListListingsResponse::new().set_next_page_token("example");
6073 /// ```
6074 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6075 self.next_page_token = v.into();
6076 self
6077 }
6078}
6079
6080impl wkt::message::Message for ListListingsResponse {
6081 fn typename() -> &'static str {
6082 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListListingsResponse"
6083 }
6084}
6085
6086#[doc(hidden)]
6087impl google_cloud_gax::paginator::internal::PageableResponse for ListListingsResponse {
6088 type PageItem = crate::model::Listing;
6089
6090 fn items(self) -> std::vec::Vec<Self::PageItem> {
6091 self.listings
6092 }
6093
6094 fn next_page_token(&self) -> std::string::String {
6095 use std::clone::Clone;
6096 self.next_page_token.clone()
6097 }
6098}
6099
6100/// Message for getting a listing.
6101#[derive(Clone, Default, PartialEq)]
6102#[non_exhaustive]
6103pub struct GetListingRequest {
6104 /// Required. The resource name of the listing.
6105 /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
6106 pub name: std::string::String,
6107
6108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6109}
6110
6111impl GetListingRequest {
6112 /// Creates a new default instance.
6113 pub fn new() -> Self {
6114 std::default::Default::default()
6115 }
6116
6117 /// Sets the value of [name][crate::model::GetListingRequest::name].
6118 ///
6119 /// # Example
6120 /// ```ignore,no_run
6121 /// # use google_cloud_bigquery_analyticshub_v1::model::GetListingRequest;
6122 /// # let project_id = "project_id";
6123 /// # let location_id = "location_id";
6124 /// # let data_exchange_id = "data_exchange_id";
6125 /// # let listing_id = "listing_id";
6126 /// let x = GetListingRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/listings/{listing_id}"));
6127 /// ```
6128 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6129 self.name = v.into();
6130 self
6131 }
6132}
6133
6134impl wkt::message::Message for GetListingRequest {
6135 fn typename() -> &'static str {
6136 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetListingRequest"
6137 }
6138}
6139
6140/// Message for creating a listing.
6141#[derive(Clone, Default, PartialEq)]
6142#[non_exhaustive]
6143pub struct CreateListingRequest {
6144 /// Required. The parent resource path of the listing.
6145 /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
6146 pub parent: std::string::String,
6147
6148 /// Required. The ID of the listing to create.
6149 /// Must contain only Unicode letters, numbers (0-9), underscores (_).
6150 /// Max length: 100 bytes.
6151 pub listing_id: std::string::String,
6152
6153 /// Required. The listing to create.
6154 pub listing: std::option::Option<crate::model::Listing>,
6155
6156 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6157}
6158
6159impl CreateListingRequest {
6160 /// Creates a new default instance.
6161 pub fn new() -> Self {
6162 std::default::Default::default()
6163 }
6164
6165 /// Sets the value of [parent][crate::model::CreateListingRequest::parent].
6166 ///
6167 /// # Example
6168 /// ```ignore,no_run
6169 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6170 /// # let project_id = "project_id";
6171 /// # let location_id = "location_id";
6172 /// # let data_exchange_id = "data_exchange_id";
6173 /// let x = CreateListingRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
6174 /// ```
6175 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6176 self.parent = v.into();
6177 self
6178 }
6179
6180 /// Sets the value of [listing_id][crate::model::CreateListingRequest::listing_id].
6181 ///
6182 /// # Example
6183 /// ```ignore,no_run
6184 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6185 /// let x = CreateListingRequest::new().set_listing_id("example");
6186 /// ```
6187 pub fn set_listing_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6188 self.listing_id = v.into();
6189 self
6190 }
6191
6192 /// Sets the value of [listing][crate::model::CreateListingRequest::listing].
6193 ///
6194 /// # Example
6195 /// ```ignore,no_run
6196 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6197 /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6198 /// let x = CreateListingRequest::new().set_listing(Listing::default()/* use setters */);
6199 /// ```
6200 pub fn set_listing<T>(mut self, v: T) -> Self
6201 where
6202 T: std::convert::Into<crate::model::Listing>,
6203 {
6204 self.listing = std::option::Option::Some(v.into());
6205 self
6206 }
6207
6208 /// Sets or clears the value of [listing][crate::model::CreateListingRequest::listing].
6209 ///
6210 /// # Example
6211 /// ```ignore,no_run
6212 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6213 /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6214 /// let x = CreateListingRequest::new().set_or_clear_listing(Some(Listing::default()/* use setters */));
6215 /// let x = CreateListingRequest::new().set_or_clear_listing(None::<Listing>);
6216 /// ```
6217 pub fn set_or_clear_listing<T>(mut self, v: std::option::Option<T>) -> Self
6218 where
6219 T: std::convert::Into<crate::model::Listing>,
6220 {
6221 self.listing = v.map(|x| x.into());
6222 self
6223 }
6224}
6225
6226impl wkt::message::Message for CreateListingRequest {
6227 fn typename() -> &'static str {
6228 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateListingRequest"
6229 }
6230}
6231
6232/// Message for updating a Listing.
6233#[derive(Clone, Default, PartialEq)]
6234#[non_exhaustive]
6235pub struct UpdateListingRequest {
6236 /// Required. Field mask specifies the fields to update in the listing
6237 /// resource. The fields specified in the `updateMask` are relative to the
6238 /// resource and are not a full request.
6239 pub update_mask: std::option::Option<wkt::FieldMask>,
6240
6241 /// Required. The listing to update.
6242 pub listing: std::option::Option<crate::model::Listing>,
6243
6244 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6245}
6246
6247impl UpdateListingRequest {
6248 /// Creates a new default instance.
6249 pub fn new() -> Self {
6250 std::default::Default::default()
6251 }
6252
6253 /// Sets the value of [update_mask][crate::model::UpdateListingRequest::update_mask].
6254 ///
6255 /// # Example
6256 /// ```ignore,no_run
6257 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6258 /// use wkt::FieldMask;
6259 /// let x = UpdateListingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6260 /// ```
6261 pub fn set_update_mask<T>(mut self, v: T) -> Self
6262 where
6263 T: std::convert::Into<wkt::FieldMask>,
6264 {
6265 self.update_mask = std::option::Option::Some(v.into());
6266 self
6267 }
6268
6269 /// Sets or clears the value of [update_mask][crate::model::UpdateListingRequest::update_mask].
6270 ///
6271 /// # Example
6272 /// ```ignore,no_run
6273 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6274 /// use wkt::FieldMask;
6275 /// let x = UpdateListingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6276 /// let x = UpdateListingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6277 /// ```
6278 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6279 where
6280 T: std::convert::Into<wkt::FieldMask>,
6281 {
6282 self.update_mask = v.map(|x| x.into());
6283 self
6284 }
6285
6286 /// Sets the value of [listing][crate::model::UpdateListingRequest::listing].
6287 ///
6288 /// # Example
6289 /// ```ignore,no_run
6290 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6291 /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6292 /// let x = UpdateListingRequest::new().set_listing(Listing::default()/* use setters */);
6293 /// ```
6294 pub fn set_listing<T>(mut self, v: T) -> Self
6295 where
6296 T: std::convert::Into<crate::model::Listing>,
6297 {
6298 self.listing = std::option::Option::Some(v.into());
6299 self
6300 }
6301
6302 /// Sets or clears the value of [listing][crate::model::UpdateListingRequest::listing].
6303 ///
6304 /// # Example
6305 /// ```ignore,no_run
6306 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6307 /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6308 /// let x = UpdateListingRequest::new().set_or_clear_listing(Some(Listing::default()/* use setters */));
6309 /// let x = UpdateListingRequest::new().set_or_clear_listing(None::<Listing>);
6310 /// ```
6311 pub fn set_or_clear_listing<T>(mut self, v: std::option::Option<T>) -> Self
6312 where
6313 T: std::convert::Into<crate::model::Listing>,
6314 {
6315 self.listing = v.map(|x| x.into());
6316 self
6317 }
6318}
6319
6320impl wkt::message::Message for UpdateListingRequest {
6321 fn typename() -> &'static str {
6322 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateListingRequest"
6323 }
6324}
6325
6326/// Message for deleting a listing.
6327#[derive(Clone, Default, PartialEq)]
6328#[non_exhaustive]
6329pub struct DeleteListingRequest {
6330 /// Required. Resource name of the listing to delete.
6331 /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
6332 pub name: std::string::String,
6333
6334 /// Optional. If the listing is commercial then this field must be set to true,
6335 /// otherwise a failure is thrown. This acts as a safety guard to avoid
6336 /// deleting commercial listings accidentally.
6337 pub delete_commercial: bool,
6338
6339 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6340}
6341
6342impl DeleteListingRequest {
6343 /// Creates a new default instance.
6344 pub fn new() -> Self {
6345 std::default::Default::default()
6346 }
6347
6348 /// Sets the value of [name][crate::model::DeleteListingRequest::name].
6349 ///
6350 /// # Example
6351 /// ```ignore,no_run
6352 /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteListingRequest;
6353 /// # let project_id = "project_id";
6354 /// # let location_id = "location_id";
6355 /// # let data_exchange_id = "data_exchange_id";
6356 /// # let listing_id = "listing_id";
6357 /// let x = DeleteListingRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/listings/{listing_id}"));
6358 /// ```
6359 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6360 self.name = v.into();
6361 self
6362 }
6363
6364 /// Sets the value of [delete_commercial][crate::model::DeleteListingRequest::delete_commercial].
6365 ///
6366 /// # Example
6367 /// ```ignore,no_run
6368 /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteListingRequest;
6369 /// let x = DeleteListingRequest::new().set_delete_commercial(true);
6370 /// ```
6371 pub fn set_delete_commercial<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6372 self.delete_commercial = v.into();
6373 self
6374 }
6375}
6376
6377impl wkt::message::Message for DeleteListingRequest {
6378 fn typename() -> &'static str {
6379 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteListingRequest"
6380 }
6381}
6382
6383/// Message for subscribing to a listing.
6384#[derive(Clone, Default, PartialEq)]
6385#[non_exhaustive]
6386pub struct SubscribeListingRequest {
6387 /// Required. Resource name of the listing that you want to subscribe to.
6388 /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
6389 pub name: std::string::String,
6390
6391 /// Resulting destination of the listing that you subscribed to.
6392 pub destination: std::option::Option<crate::model::subscribe_listing_request::Destination>,
6393
6394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6395}
6396
6397impl SubscribeListingRequest {
6398 /// Creates a new default instance.
6399 pub fn new() -> Self {
6400 std::default::Default::default()
6401 }
6402
6403 /// Sets the value of [name][crate::model::SubscribeListingRequest::name].
6404 ///
6405 /// # Example
6406 /// ```ignore,no_run
6407 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6408 /// # let project_id = "project_id";
6409 /// # let location_id = "location_id";
6410 /// # let data_exchange_id = "data_exchange_id";
6411 /// # let listing_id = "listing_id";
6412 /// let x = SubscribeListingRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/listings/{listing_id}"));
6413 /// ```
6414 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6415 self.name = v.into();
6416 self
6417 }
6418
6419 /// Sets the value of [destination][crate::model::SubscribeListingRequest::destination].
6420 ///
6421 /// Note that all the setters affecting `destination` are mutually
6422 /// exclusive.
6423 ///
6424 /// # Example
6425 /// ```ignore,no_run
6426 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6427 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6428 /// let x = SubscribeListingRequest::new().set_destination(Some(
6429 /// google_cloud_bigquery_analyticshub_v1::model::subscribe_listing_request::Destination::DestinationDataset(DestinationDataset::default().into())));
6430 /// ```
6431 pub fn set_destination<
6432 T: std::convert::Into<
6433 std::option::Option<crate::model::subscribe_listing_request::Destination>,
6434 >,
6435 >(
6436 mut self,
6437 v: T,
6438 ) -> Self {
6439 self.destination = v.into();
6440 self
6441 }
6442
6443 /// The value of [destination][crate::model::SubscribeListingRequest::destination]
6444 /// if it holds a `DestinationDataset`, `None` if the field is not set or
6445 /// holds a different branch.
6446 pub fn destination_dataset(
6447 &self,
6448 ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationDataset>> {
6449 #[allow(unreachable_patterns)]
6450 self.destination.as_ref().and_then(|v| match v {
6451 crate::model::subscribe_listing_request::Destination::DestinationDataset(v) => {
6452 std::option::Option::Some(v)
6453 }
6454 _ => std::option::Option::None,
6455 })
6456 }
6457
6458 /// Sets the value of [destination][crate::model::SubscribeListingRequest::destination]
6459 /// to hold a `DestinationDataset`.
6460 ///
6461 /// Note that all the setters affecting `destination` are
6462 /// mutually exclusive.
6463 ///
6464 /// # Example
6465 /// ```ignore,no_run
6466 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6467 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6468 /// let x = SubscribeListingRequest::new().set_destination_dataset(DestinationDataset::default()/* use setters */);
6469 /// assert!(x.destination_dataset().is_some());
6470 /// assert!(x.destination_pubsub_subscription().is_none());
6471 /// ```
6472 pub fn set_destination_dataset<
6473 T: std::convert::Into<std::boxed::Box<crate::model::DestinationDataset>>,
6474 >(
6475 mut self,
6476 v: T,
6477 ) -> Self {
6478 self.destination = std::option::Option::Some(
6479 crate::model::subscribe_listing_request::Destination::DestinationDataset(v.into()),
6480 );
6481 self
6482 }
6483
6484 /// The value of [destination][crate::model::SubscribeListingRequest::destination]
6485 /// if it holds a `DestinationPubsubSubscription`, `None` if the field is not set or
6486 /// holds a different branch.
6487 pub fn destination_pubsub_subscription(
6488 &self,
6489 ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationPubSubSubscription>> {
6490 #[allow(unreachable_patterns)]
6491 self.destination.as_ref().and_then(|v| match v {
6492 crate::model::subscribe_listing_request::Destination::DestinationPubsubSubscription(
6493 v,
6494 ) => std::option::Option::Some(v),
6495 _ => std::option::Option::None,
6496 })
6497 }
6498
6499 /// Sets the value of [destination][crate::model::SubscribeListingRequest::destination]
6500 /// to hold a `DestinationPubsubSubscription`.
6501 ///
6502 /// Note that all the setters affecting `destination` are
6503 /// mutually exclusive.
6504 ///
6505 /// # Example
6506 /// ```ignore,no_run
6507 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6508 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationPubSubSubscription;
6509 /// let x = SubscribeListingRequest::new().set_destination_pubsub_subscription(DestinationPubSubSubscription::default()/* use setters */);
6510 /// assert!(x.destination_pubsub_subscription().is_some());
6511 /// assert!(x.destination_dataset().is_none());
6512 /// ```
6513 pub fn set_destination_pubsub_subscription<
6514 T: std::convert::Into<std::boxed::Box<crate::model::DestinationPubSubSubscription>>,
6515 >(
6516 mut self,
6517 v: T,
6518 ) -> Self {
6519 self.destination = std::option::Option::Some(
6520 crate::model::subscribe_listing_request::Destination::DestinationPubsubSubscription(
6521 v.into(),
6522 ),
6523 );
6524 self
6525 }
6526}
6527
6528impl wkt::message::Message for SubscribeListingRequest {
6529 fn typename() -> &'static str {
6530 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest"
6531 }
6532}
6533
6534/// Defines additional types related to [SubscribeListingRequest].
6535pub mod subscribe_listing_request {
6536 #[allow(unused_imports)]
6537 use super::*;
6538
6539 /// Resulting destination of the listing that you subscribed to.
6540 #[derive(Clone, Debug, PartialEq)]
6541 #[non_exhaustive]
6542 pub enum Destination {
6543 /// Input only. BigQuery destination dataset to create for the subscriber.
6544 DestinationDataset(std::boxed::Box<crate::model::DestinationDataset>),
6545 /// Input only. Destination Pub/Sub subscription to create for the
6546 /// subscriber.
6547 DestinationPubsubSubscription(std::boxed::Box<crate::model::DestinationPubSubSubscription>),
6548 }
6549}
6550
6551/// Message for response when you subscribe to a listing.
6552#[derive(Clone, Default, PartialEq)]
6553#[non_exhaustive]
6554pub struct SubscribeListingResponse {
6555 /// Subscription object created from this subscribe action.
6556 pub subscription: std::option::Option<crate::model::Subscription>,
6557
6558 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6559}
6560
6561impl SubscribeListingResponse {
6562 /// Creates a new default instance.
6563 pub fn new() -> Self {
6564 std::default::Default::default()
6565 }
6566
6567 /// Sets the value of [subscription][crate::model::SubscribeListingResponse::subscription].
6568 ///
6569 /// # Example
6570 /// ```ignore,no_run
6571 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingResponse;
6572 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6573 /// let x = SubscribeListingResponse::new().set_subscription(Subscription::default()/* use setters */);
6574 /// ```
6575 pub fn set_subscription<T>(mut self, v: T) -> Self
6576 where
6577 T: std::convert::Into<crate::model::Subscription>,
6578 {
6579 self.subscription = std::option::Option::Some(v.into());
6580 self
6581 }
6582
6583 /// Sets or clears the value of [subscription][crate::model::SubscribeListingResponse::subscription].
6584 ///
6585 /// # Example
6586 /// ```ignore,no_run
6587 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingResponse;
6588 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6589 /// let x = SubscribeListingResponse::new().set_or_clear_subscription(Some(Subscription::default()/* use setters */));
6590 /// let x = SubscribeListingResponse::new().set_or_clear_subscription(None::<Subscription>);
6591 /// ```
6592 pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
6593 where
6594 T: std::convert::Into<crate::model::Subscription>,
6595 {
6596 self.subscription = v.map(|x| x.into());
6597 self
6598 }
6599}
6600
6601impl wkt::message::Message for SubscribeListingResponse {
6602 fn typename() -> &'static str {
6603 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse"
6604 }
6605}
6606
6607/// Message for subscribing to a Data Exchange.
6608#[derive(Clone, Default, PartialEq)]
6609#[non_exhaustive]
6610pub struct SubscribeDataExchangeRequest {
6611 /// Required. Resource name of the Data Exchange.
6612 /// e.g. `projects/publisherproject/locations/us/dataExchanges/123`
6613 pub name: std::string::String,
6614
6615 /// Required. The parent resource path of the Subscription.
6616 /// e.g. `projects/subscriberproject/locations/us`
6617 pub destination: std::string::String,
6618
6619 /// Optional. BigQuery destination dataset to create for the subscriber.
6620 pub destination_dataset: std::option::Option<crate::model::DestinationDataset>,
6621
6622 /// Required. Name of the subscription to create.
6623 /// e.g. `subscription1`
6624 pub subscription: std::string::String,
6625
6626 /// Email of the subscriber.
6627 pub subscriber_contact: std::string::String,
6628
6629 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6630}
6631
6632impl SubscribeDataExchangeRequest {
6633 /// Creates a new default instance.
6634 pub fn new() -> Self {
6635 std::default::Default::default()
6636 }
6637
6638 /// Sets the value of [name][crate::model::SubscribeDataExchangeRequest::name].
6639 ///
6640 /// # Example
6641 /// ```ignore,no_run
6642 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6643 /// # let project_id = "project_id";
6644 /// # let location_id = "location_id";
6645 /// # let data_exchange_id = "data_exchange_id";
6646 /// let x = SubscribeDataExchangeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
6647 /// ```
6648 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6649 self.name = v.into();
6650 self
6651 }
6652
6653 /// Sets the value of [destination][crate::model::SubscribeDataExchangeRequest::destination].
6654 ///
6655 /// # Example
6656 /// ```ignore,no_run
6657 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6658 /// let x = SubscribeDataExchangeRequest::new().set_destination("example");
6659 /// ```
6660 pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6661 self.destination = v.into();
6662 self
6663 }
6664
6665 /// Sets the value of [destination_dataset][crate::model::SubscribeDataExchangeRequest::destination_dataset].
6666 ///
6667 /// # Example
6668 /// ```ignore,no_run
6669 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6670 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6671 /// let x = SubscribeDataExchangeRequest::new().set_destination_dataset(DestinationDataset::default()/* use setters */);
6672 /// ```
6673 pub fn set_destination_dataset<T>(mut self, v: T) -> Self
6674 where
6675 T: std::convert::Into<crate::model::DestinationDataset>,
6676 {
6677 self.destination_dataset = std::option::Option::Some(v.into());
6678 self
6679 }
6680
6681 /// Sets or clears the value of [destination_dataset][crate::model::SubscribeDataExchangeRequest::destination_dataset].
6682 ///
6683 /// # Example
6684 /// ```ignore,no_run
6685 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6686 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6687 /// let x = SubscribeDataExchangeRequest::new().set_or_clear_destination_dataset(Some(DestinationDataset::default()/* use setters */));
6688 /// let x = SubscribeDataExchangeRequest::new().set_or_clear_destination_dataset(None::<DestinationDataset>);
6689 /// ```
6690 pub fn set_or_clear_destination_dataset<T>(mut self, v: std::option::Option<T>) -> Self
6691 where
6692 T: std::convert::Into<crate::model::DestinationDataset>,
6693 {
6694 self.destination_dataset = v.map(|x| x.into());
6695 self
6696 }
6697
6698 /// Sets the value of [subscription][crate::model::SubscribeDataExchangeRequest::subscription].
6699 ///
6700 /// # Example
6701 /// ```ignore,no_run
6702 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6703 /// let x = SubscribeDataExchangeRequest::new().set_subscription("example");
6704 /// ```
6705 pub fn set_subscription<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6706 self.subscription = v.into();
6707 self
6708 }
6709
6710 /// Sets the value of [subscriber_contact][crate::model::SubscribeDataExchangeRequest::subscriber_contact].
6711 ///
6712 /// # Example
6713 /// ```ignore,no_run
6714 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6715 /// let x = SubscribeDataExchangeRequest::new().set_subscriber_contact("example");
6716 /// ```
6717 pub fn set_subscriber_contact<T: std::convert::Into<std::string::String>>(
6718 mut self,
6719 v: T,
6720 ) -> Self {
6721 self.subscriber_contact = v.into();
6722 self
6723 }
6724}
6725
6726impl wkt::message::Message for SubscribeDataExchangeRequest {
6727 fn typename() -> &'static str {
6728 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeDataExchangeRequest"
6729 }
6730}
6731
6732/// Message for response when you subscribe to a Data Exchange.
6733#[derive(Clone, Default, PartialEq)]
6734#[non_exhaustive]
6735pub struct SubscribeDataExchangeResponse {
6736 /// Subscription object created from this subscribe action.
6737 pub subscription: std::option::Option<crate::model::Subscription>,
6738
6739 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6740}
6741
6742impl SubscribeDataExchangeResponse {
6743 /// Creates a new default instance.
6744 pub fn new() -> Self {
6745 std::default::Default::default()
6746 }
6747
6748 /// Sets the value of [subscription][crate::model::SubscribeDataExchangeResponse::subscription].
6749 ///
6750 /// # Example
6751 /// ```ignore,no_run
6752 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeResponse;
6753 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6754 /// let x = SubscribeDataExchangeResponse::new().set_subscription(Subscription::default()/* use setters */);
6755 /// ```
6756 pub fn set_subscription<T>(mut self, v: T) -> Self
6757 where
6758 T: std::convert::Into<crate::model::Subscription>,
6759 {
6760 self.subscription = std::option::Option::Some(v.into());
6761 self
6762 }
6763
6764 /// Sets or clears the value of [subscription][crate::model::SubscribeDataExchangeResponse::subscription].
6765 ///
6766 /// # Example
6767 /// ```ignore,no_run
6768 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeResponse;
6769 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6770 /// let x = SubscribeDataExchangeResponse::new().set_or_clear_subscription(Some(Subscription::default()/* use setters */));
6771 /// let x = SubscribeDataExchangeResponse::new().set_or_clear_subscription(None::<Subscription>);
6772 /// ```
6773 pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
6774 where
6775 T: std::convert::Into<crate::model::Subscription>,
6776 {
6777 self.subscription = v.map(|x| x.into());
6778 self
6779 }
6780}
6781
6782impl wkt::message::Message for SubscribeDataExchangeResponse {
6783 fn typename() -> &'static str {
6784 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeDataExchangeResponse"
6785 }
6786}
6787
6788/// Message for refreshing a subscription.
6789#[derive(Clone, Default, PartialEq)]
6790#[non_exhaustive]
6791pub struct RefreshSubscriptionRequest {
6792 /// Required. Resource name of the Subscription to refresh.
6793 /// e.g. `projects/subscriberproject/locations/us/subscriptions/123`
6794 pub name: std::string::String,
6795
6796 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6797}
6798
6799impl RefreshSubscriptionRequest {
6800 /// Creates a new default instance.
6801 pub fn new() -> Self {
6802 std::default::Default::default()
6803 }
6804
6805 /// Sets the value of [name][crate::model::RefreshSubscriptionRequest::name].
6806 ///
6807 /// # Example
6808 /// ```ignore,no_run
6809 /// # use google_cloud_bigquery_analyticshub_v1::model::RefreshSubscriptionRequest;
6810 /// # let project_id = "project_id";
6811 /// # let location_id = "location_id";
6812 /// # let subscription_id = "subscription_id";
6813 /// let x = RefreshSubscriptionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/subscriptions/{subscription_id}"));
6814 /// ```
6815 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6816 self.name = v.into();
6817 self
6818 }
6819}
6820
6821impl wkt::message::Message for RefreshSubscriptionRequest {
6822 fn typename() -> &'static str {
6823 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RefreshSubscriptionRequest"
6824 }
6825}
6826
6827/// Message for response when you refresh a subscription.
6828#[derive(Clone, Default, PartialEq)]
6829#[non_exhaustive]
6830pub struct RefreshSubscriptionResponse {
6831 /// The refreshed subscription resource.
6832 pub subscription: std::option::Option<crate::model::Subscription>,
6833
6834 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6835}
6836
6837impl RefreshSubscriptionResponse {
6838 /// Creates a new default instance.
6839 pub fn new() -> Self {
6840 std::default::Default::default()
6841 }
6842
6843 /// Sets the value of [subscription][crate::model::RefreshSubscriptionResponse::subscription].
6844 ///
6845 /// # Example
6846 /// ```ignore,no_run
6847 /// # use google_cloud_bigquery_analyticshub_v1::model::RefreshSubscriptionResponse;
6848 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6849 /// let x = RefreshSubscriptionResponse::new().set_subscription(Subscription::default()/* use setters */);
6850 /// ```
6851 pub fn set_subscription<T>(mut self, v: T) -> Self
6852 where
6853 T: std::convert::Into<crate::model::Subscription>,
6854 {
6855 self.subscription = std::option::Option::Some(v.into());
6856 self
6857 }
6858
6859 /// Sets or clears the value of [subscription][crate::model::RefreshSubscriptionResponse::subscription].
6860 ///
6861 /// # Example
6862 /// ```ignore,no_run
6863 /// # use google_cloud_bigquery_analyticshub_v1::model::RefreshSubscriptionResponse;
6864 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6865 /// let x = RefreshSubscriptionResponse::new().set_or_clear_subscription(Some(Subscription::default()/* use setters */));
6866 /// let x = RefreshSubscriptionResponse::new().set_or_clear_subscription(None::<Subscription>);
6867 /// ```
6868 pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
6869 where
6870 T: std::convert::Into<crate::model::Subscription>,
6871 {
6872 self.subscription = v.map(|x| x.into());
6873 self
6874 }
6875}
6876
6877impl wkt::message::Message for RefreshSubscriptionResponse {
6878 fn typename() -> &'static str {
6879 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RefreshSubscriptionResponse"
6880 }
6881}
6882
6883/// Message for getting a subscription.
6884#[derive(Clone, Default, PartialEq)]
6885#[non_exhaustive]
6886pub struct GetSubscriptionRequest {
6887 /// Required. Resource name of the subscription.
6888 /// e.g. projects/123/locations/us/subscriptions/456
6889 pub name: std::string::String,
6890
6891 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6892}
6893
6894impl GetSubscriptionRequest {
6895 /// Creates a new default instance.
6896 pub fn new() -> Self {
6897 std::default::Default::default()
6898 }
6899
6900 /// Sets the value of [name][crate::model::GetSubscriptionRequest::name].
6901 ///
6902 /// # Example
6903 /// ```ignore,no_run
6904 /// # use google_cloud_bigquery_analyticshub_v1::model::GetSubscriptionRequest;
6905 /// # let project_id = "project_id";
6906 /// # let location_id = "location_id";
6907 /// # let subscription_id = "subscription_id";
6908 /// let x = GetSubscriptionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/subscriptions/{subscription_id}"));
6909 /// ```
6910 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6911 self.name = v.into();
6912 self
6913 }
6914}
6915
6916impl wkt::message::Message for GetSubscriptionRequest {
6917 fn typename() -> &'static str {
6918 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetSubscriptionRequest"
6919 }
6920}
6921
6922/// Message for listing subscriptions.
6923#[derive(Clone, Default, PartialEq)]
6924#[non_exhaustive]
6925pub struct ListSubscriptionsRequest {
6926 /// Required. The parent resource path of the subscription.
6927 /// e.g. projects/myproject/locations/us
6928 pub parent: std::string::String,
6929
6930 /// An expression for filtering the results of the request. Eligible
6931 /// fields for filtering are:
6932 ///
6933 /// + `listing`
6934 /// + `data_exchange`
6935 ///
6936 /// Alternatively, a literal wrapped in double quotes may be provided.
6937 /// This will be checked for an exact match against both fields above.
6938 ///
6939 /// In all cases, the full Data Exchange or Listing resource name must
6940 /// be provided. Some example of using filters:
6941 ///
6942 /// + data_exchange="projects/myproject/locations/us/dataExchanges/123"
6943 /// + listing="projects/123/locations/us/dataExchanges/456/listings/789"
6944 /// + "projects/myproject/locations/us/dataExchanges/123"
6945 pub filter: std::string::String,
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 ListSubscriptionsRequest {
6957 /// Creates a new default instance.
6958 pub fn new() -> Self {
6959 std::default::Default::default()
6960 }
6961
6962 /// Sets the value of [parent][crate::model::ListSubscriptionsRequest::parent].
6963 ///
6964 /// # Example
6965 /// ```ignore,no_run
6966 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6967 /// # let project_id = "project_id";
6968 /// # let location_id = "location_id";
6969 /// let x = ListSubscriptionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
6970 /// ```
6971 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6972 self.parent = v.into();
6973 self
6974 }
6975
6976 /// Sets the value of [filter][crate::model::ListSubscriptionsRequest::filter].
6977 ///
6978 /// # Example
6979 /// ```ignore,no_run
6980 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6981 /// let x = ListSubscriptionsRequest::new().set_filter("example");
6982 /// ```
6983 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6984 self.filter = v.into();
6985 self
6986 }
6987
6988 /// Sets the value of [page_size][crate::model::ListSubscriptionsRequest::page_size].
6989 ///
6990 /// # Example
6991 /// ```ignore,no_run
6992 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6993 /// let x = ListSubscriptionsRequest::new().set_page_size(42);
6994 /// ```
6995 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6996 self.page_size = v.into();
6997 self
6998 }
6999
7000 /// Sets the value of [page_token][crate::model::ListSubscriptionsRequest::page_token].
7001 ///
7002 /// # Example
7003 /// ```ignore,no_run
7004 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
7005 /// let x = ListSubscriptionsRequest::new().set_page_token("example");
7006 /// ```
7007 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7008 self.page_token = v.into();
7009 self
7010 }
7011}
7012
7013impl wkt::message::Message for ListSubscriptionsRequest {
7014 fn typename() -> &'static str {
7015 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSubscriptionsRequest"
7016 }
7017}
7018
7019/// Message for response to the listing of subscriptions.
7020#[derive(Clone, Default, PartialEq)]
7021#[non_exhaustive]
7022pub struct ListSubscriptionsResponse {
7023 /// The list of subscriptions.
7024 pub subscriptions: std::vec::Vec<crate::model::Subscription>,
7025
7026 /// Next page token.
7027 pub next_page_token: std::string::String,
7028
7029 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7030}
7031
7032impl ListSubscriptionsResponse {
7033 /// Creates a new default instance.
7034 pub fn new() -> Self {
7035 std::default::Default::default()
7036 }
7037
7038 /// Sets the value of [subscriptions][crate::model::ListSubscriptionsResponse::subscriptions].
7039 ///
7040 /// # Example
7041 /// ```ignore,no_run
7042 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsResponse;
7043 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
7044 /// let x = ListSubscriptionsResponse::new()
7045 /// .set_subscriptions([
7046 /// Subscription::default()/* use setters */,
7047 /// Subscription::default()/* use (different) setters */,
7048 /// ]);
7049 /// ```
7050 pub fn set_subscriptions<T, V>(mut self, v: T) -> Self
7051 where
7052 T: std::iter::IntoIterator<Item = V>,
7053 V: std::convert::Into<crate::model::Subscription>,
7054 {
7055 use std::iter::Iterator;
7056 self.subscriptions = v.into_iter().map(|i| i.into()).collect();
7057 self
7058 }
7059
7060 /// Sets the value of [next_page_token][crate::model::ListSubscriptionsResponse::next_page_token].
7061 ///
7062 /// # Example
7063 /// ```ignore,no_run
7064 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsResponse;
7065 /// let x = ListSubscriptionsResponse::new().set_next_page_token("example");
7066 /// ```
7067 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7068 self.next_page_token = v.into();
7069 self
7070 }
7071}
7072
7073impl wkt::message::Message for ListSubscriptionsResponse {
7074 fn typename() -> &'static str {
7075 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSubscriptionsResponse"
7076 }
7077}
7078
7079#[doc(hidden)]
7080impl google_cloud_gax::paginator::internal::PageableResponse for ListSubscriptionsResponse {
7081 type PageItem = crate::model::Subscription;
7082
7083 fn items(self) -> std::vec::Vec<Self::PageItem> {
7084 self.subscriptions
7085 }
7086
7087 fn next_page_token(&self) -> std::string::String {
7088 use std::clone::Clone;
7089 self.next_page_token.clone()
7090 }
7091}
7092
7093/// Message for listing subscriptions of a shared resource.
7094#[derive(Clone, Default, PartialEq)]
7095#[non_exhaustive]
7096pub struct ListSharedResourceSubscriptionsRequest {
7097 /// Required. Resource name of the requested target. This resource may be
7098 /// either a Listing or a DataExchange. e.g.
7099 /// projects/123/locations/us/dataExchanges/456 OR e.g.
7100 /// projects/123/locations/us/dataExchanges/456/listings/789
7101 pub resource: std::string::String,
7102
7103 /// If selected, includes deleted subscriptions in the response
7104 /// (up to 63 days after deletion).
7105 pub include_deleted_subscriptions: bool,
7106
7107 /// The maximum number of results to return in a single response page.
7108 pub page_size: i32,
7109
7110 /// Page token, returned by a previous call.
7111 pub page_token: std::string::String,
7112
7113 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7114}
7115
7116impl ListSharedResourceSubscriptionsRequest {
7117 /// Creates a new default instance.
7118 pub fn new() -> Self {
7119 std::default::Default::default()
7120 }
7121
7122 /// Sets the value of [resource][crate::model::ListSharedResourceSubscriptionsRequest::resource].
7123 ///
7124 /// # Example
7125 /// ```ignore,no_run
7126 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
7127 /// let x = ListSharedResourceSubscriptionsRequest::new().set_resource("example");
7128 /// ```
7129 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7130 self.resource = v.into();
7131 self
7132 }
7133
7134 /// Sets the value of [include_deleted_subscriptions][crate::model::ListSharedResourceSubscriptionsRequest::include_deleted_subscriptions].
7135 ///
7136 /// # Example
7137 /// ```ignore,no_run
7138 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
7139 /// let x = ListSharedResourceSubscriptionsRequest::new().set_include_deleted_subscriptions(true);
7140 /// ```
7141 pub fn set_include_deleted_subscriptions<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7142 self.include_deleted_subscriptions = v.into();
7143 self
7144 }
7145
7146 /// Sets the value of [page_size][crate::model::ListSharedResourceSubscriptionsRequest::page_size].
7147 ///
7148 /// # Example
7149 /// ```ignore,no_run
7150 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
7151 /// let x = ListSharedResourceSubscriptionsRequest::new().set_page_size(42);
7152 /// ```
7153 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7154 self.page_size = v.into();
7155 self
7156 }
7157
7158 /// Sets the value of [page_token][crate::model::ListSharedResourceSubscriptionsRequest::page_token].
7159 ///
7160 /// # Example
7161 /// ```ignore,no_run
7162 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
7163 /// let x = ListSharedResourceSubscriptionsRequest::new().set_page_token("example");
7164 /// ```
7165 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7166 self.page_token = v.into();
7167 self
7168 }
7169}
7170
7171impl wkt::message::Message for ListSharedResourceSubscriptionsRequest {
7172 fn typename() -> &'static str {
7173 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSharedResourceSubscriptionsRequest"
7174 }
7175}
7176
7177/// Message for response to the listing of shared resource subscriptions.
7178#[derive(Clone, Default, PartialEq)]
7179#[non_exhaustive]
7180pub struct ListSharedResourceSubscriptionsResponse {
7181 /// The list of subscriptions.
7182 pub shared_resource_subscriptions: std::vec::Vec<crate::model::Subscription>,
7183
7184 /// Next page token.
7185 pub next_page_token: std::string::String,
7186
7187 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7188}
7189
7190impl ListSharedResourceSubscriptionsResponse {
7191 /// Creates a new default instance.
7192 pub fn new() -> Self {
7193 std::default::Default::default()
7194 }
7195
7196 /// Sets the value of [shared_resource_subscriptions][crate::model::ListSharedResourceSubscriptionsResponse::shared_resource_subscriptions].
7197 ///
7198 /// # Example
7199 /// ```ignore,no_run
7200 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsResponse;
7201 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
7202 /// let x = ListSharedResourceSubscriptionsResponse::new()
7203 /// .set_shared_resource_subscriptions([
7204 /// Subscription::default()/* use setters */,
7205 /// Subscription::default()/* use (different) setters */,
7206 /// ]);
7207 /// ```
7208 pub fn set_shared_resource_subscriptions<T, V>(mut self, v: T) -> Self
7209 where
7210 T: std::iter::IntoIterator<Item = V>,
7211 V: std::convert::Into<crate::model::Subscription>,
7212 {
7213 use std::iter::Iterator;
7214 self.shared_resource_subscriptions = v.into_iter().map(|i| i.into()).collect();
7215 self
7216 }
7217
7218 /// Sets the value of [next_page_token][crate::model::ListSharedResourceSubscriptionsResponse::next_page_token].
7219 ///
7220 /// # Example
7221 /// ```ignore,no_run
7222 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsResponse;
7223 /// let x = ListSharedResourceSubscriptionsResponse::new().set_next_page_token("example");
7224 /// ```
7225 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7226 self.next_page_token = v.into();
7227 self
7228 }
7229}
7230
7231impl wkt::message::Message for ListSharedResourceSubscriptionsResponse {
7232 fn typename() -> &'static str {
7233 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSharedResourceSubscriptionsResponse"
7234 }
7235}
7236
7237#[doc(hidden)]
7238impl google_cloud_gax::paginator::internal::PageableResponse
7239 for ListSharedResourceSubscriptionsResponse
7240{
7241 type PageItem = crate::model::Subscription;
7242
7243 fn items(self) -> std::vec::Vec<Self::PageItem> {
7244 self.shared_resource_subscriptions
7245 }
7246
7247 fn next_page_token(&self) -> std::string::String {
7248 use std::clone::Clone;
7249 self.next_page_token.clone()
7250 }
7251}
7252
7253/// Message for revoking a subscription.
7254#[derive(Clone, Default, PartialEq)]
7255#[non_exhaustive]
7256pub struct RevokeSubscriptionRequest {
7257 /// Required. Resource name of the subscription to revoke.
7258 /// e.g. projects/123/locations/us/subscriptions/456
7259 pub name: std::string::String,
7260
7261 /// Optional. If the subscription is commercial then this field must be set to
7262 /// true, otherwise a failure is thrown. This acts as a safety guard to avoid
7263 /// revoking commercial subscriptions accidentally.
7264 pub revoke_commercial: bool,
7265
7266 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7267}
7268
7269impl RevokeSubscriptionRequest {
7270 /// Creates a new default instance.
7271 pub fn new() -> Self {
7272 std::default::Default::default()
7273 }
7274
7275 /// Sets the value of [name][crate::model::RevokeSubscriptionRequest::name].
7276 ///
7277 /// # Example
7278 /// ```ignore,no_run
7279 /// # use google_cloud_bigquery_analyticshub_v1::model::RevokeSubscriptionRequest;
7280 /// # let project_id = "project_id";
7281 /// # let location_id = "location_id";
7282 /// # let subscription_id = "subscription_id";
7283 /// let x = RevokeSubscriptionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/subscriptions/{subscription_id}"));
7284 /// ```
7285 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7286 self.name = v.into();
7287 self
7288 }
7289
7290 /// Sets the value of [revoke_commercial][crate::model::RevokeSubscriptionRequest::revoke_commercial].
7291 ///
7292 /// # Example
7293 /// ```ignore,no_run
7294 /// # use google_cloud_bigquery_analyticshub_v1::model::RevokeSubscriptionRequest;
7295 /// let x = RevokeSubscriptionRequest::new().set_revoke_commercial(true);
7296 /// ```
7297 pub fn set_revoke_commercial<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7298 self.revoke_commercial = v.into();
7299 self
7300 }
7301}
7302
7303impl wkt::message::Message for RevokeSubscriptionRequest {
7304 fn typename() -> &'static str {
7305 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RevokeSubscriptionRequest"
7306 }
7307}
7308
7309/// Message for response when you revoke a subscription.
7310/// Empty for now.
7311#[derive(Clone, Default, PartialEq)]
7312#[non_exhaustive]
7313pub struct RevokeSubscriptionResponse {
7314 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7315}
7316
7317impl RevokeSubscriptionResponse {
7318 /// Creates a new default instance.
7319 pub fn new() -> Self {
7320 std::default::Default::default()
7321 }
7322}
7323
7324impl wkt::message::Message for RevokeSubscriptionResponse {
7325 fn typename() -> &'static str {
7326 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RevokeSubscriptionResponse"
7327 }
7328}
7329
7330/// Message for deleting a subscription.
7331#[derive(Clone, Default, PartialEq)]
7332#[non_exhaustive]
7333pub struct DeleteSubscriptionRequest {
7334 /// Required. Resource name of the subscription to delete.
7335 /// e.g. projects/123/locations/us/subscriptions/456
7336 pub name: std::string::String,
7337
7338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7339}
7340
7341impl DeleteSubscriptionRequest {
7342 /// Creates a new default instance.
7343 pub fn new() -> Self {
7344 std::default::Default::default()
7345 }
7346
7347 /// Sets the value of [name][crate::model::DeleteSubscriptionRequest::name].
7348 ///
7349 /// # Example
7350 /// ```ignore,no_run
7351 /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteSubscriptionRequest;
7352 /// # let project_id = "project_id";
7353 /// # let location_id = "location_id";
7354 /// # let subscription_id = "subscription_id";
7355 /// let x = DeleteSubscriptionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/subscriptions/{subscription_id}"));
7356 /// ```
7357 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7358 self.name = v.into();
7359 self
7360 }
7361}
7362
7363impl wkt::message::Message for DeleteSubscriptionRequest {
7364 fn typename() -> &'static str {
7365 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteSubscriptionRequest"
7366 }
7367}
7368
7369/// Represents the metadata of a long-running operation in Analytics Hub.
7370#[derive(Clone, Default, PartialEq)]
7371#[non_exhaustive]
7372pub struct OperationMetadata {
7373 /// Output only. The time the operation was created.
7374 pub create_time: std::option::Option<wkt::Timestamp>,
7375
7376 /// Output only. The time the operation finished running.
7377 pub end_time: std::option::Option<wkt::Timestamp>,
7378
7379 /// Output only. Server-defined resource path for the target of the operation.
7380 pub target: std::string::String,
7381
7382 /// Output only. Name of the verb executed by the operation.
7383 pub verb: std::string::String,
7384
7385 /// Output only. Human-readable status of the operation, if any.
7386 pub status_message: std::string::String,
7387
7388 /// Output only. Identifies whether the user has requested cancellation
7389 /// of the operation. Operations that have successfully been cancelled
7390 /// have [Operation.error][] value with a
7391 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
7392 /// `Code.CANCELLED`.
7393 pub requested_cancellation: bool,
7394
7395 /// Output only. API version used to start the operation.
7396 pub api_version: std::string::String,
7397
7398 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7399}
7400
7401impl OperationMetadata {
7402 /// Creates a new default instance.
7403 pub fn new() -> Self {
7404 std::default::Default::default()
7405 }
7406
7407 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
7408 ///
7409 /// # Example
7410 /// ```ignore,no_run
7411 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7412 /// use wkt::Timestamp;
7413 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
7414 /// ```
7415 pub fn set_create_time<T>(mut self, v: T) -> Self
7416 where
7417 T: std::convert::Into<wkt::Timestamp>,
7418 {
7419 self.create_time = std::option::Option::Some(v.into());
7420 self
7421 }
7422
7423 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
7424 ///
7425 /// # Example
7426 /// ```ignore,no_run
7427 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7428 /// use wkt::Timestamp;
7429 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7430 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
7431 /// ```
7432 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7433 where
7434 T: std::convert::Into<wkt::Timestamp>,
7435 {
7436 self.create_time = v.map(|x| x.into());
7437 self
7438 }
7439
7440 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
7441 ///
7442 /// # Example
7443 /// ```ignore,no_run
7444 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7445 /// use wkt::Timestamp;
7446 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7447 /// ```
7448 pub fn set_end_time<T>(mut self, v: T) -> Self
7449 where
7450 T: std::convert::Into<wkt::Timestamp>,
7451 {
7452 self.end_time = std::option::Option::Some(v.into());
7453 self
7454 }
7455
7456 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
7457 ///
7458 /// # Example
7459 /// ```ignore,no_run
7460 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7461 /// use wkt::Timestamp;
7462 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7463 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7464 /// ```
7465 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7466 where
7467 T: std::convert::Into<wkt::Timestamp>,
7468 {
7469 self.end_time = v.map(|x| x.into());
7470 self
7471 }
7472
7473 /// Sets the value of [target][crate::model::OperationMetadata::target].
7474 ///
7475 /// # Example
7476 /// ```ignore,no_run
7477 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7478 /// let x = OperationMetadata::new().set_target("example");
7479 /// ```
7480 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7481 self.target = v.into();
7482 self
7483 }
7484
7485 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
7486 ///
7487 /// # Example
7488 /// ```ignore,no_run
7489 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7490 /// let x = OperationMetadata::new().set_verb("example");
7491 /// ```
7492 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7493 self.verb = v.into();
7494 self
7495 }
7496
7497 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
7498 ///
7499 /// # Example
7500 /// ```ignore,no_run
7501 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7502 /// let x = OperationMetadata::new().set_status_message("example");
7503 /// ```
7504 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7505 self.status_message = v.into();
7506 self
7507 }
7508
7509 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
7510 ///
7511 /// # Example
7512 /// ```ignore,no_run
7513 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7514 /// let x = OperationMetadata::new().set_requested_cancellation(true);
7515 /// ```
7516 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7517 self.requested_cancellation = v.into();
7518 self
7519 }
7520
7521 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
7522 ///
7523 /// # Example
7524 /// ```ignore,no_run
7525 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7526 /// let x = OperationMetadata::new().set_api_version("example");
7527 /// ```
7528 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7529 self.api_version = v.into();
7530 self
7531 }
7532}
7533
7534impl wkt::message::Message for OperationMetadata {
7535 fn typename() -> &'static str {
7536 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.OperationMetadata"
7537 }
7538}
7539
7540/// Defines the destination Pub/Sub subscription.
7541/// If none of `push_config`, `bigquery_config`, `cloud_storage_config`,
7542/// `pubsub_export_config`, or `pubsublite_export_config`
7543/// is set, then the subscriber will pull and ack messages using API methods. At
7544/// most one of these fields may be set.
7545#[derive(Clone, Default, PartialEq)]
7546#[non_exhaustive]
7547pub struct PubSubSubscription {
7548 /// Required. Name of the subscription.
7549 /// Format is `projects/{project}/subscriptions/{sub}`.
7550 pub name: std::string::String,
7551
7552 /// Optional. If push delivery is used with this subscription, this field is
7553 /// used to configure it.
7554 pub push_config: std::option::Option<crate::model::PushConfig>,
7555
7556 /// Optional. If delivery to BigQuery is used with this subscription, this
7557 /// field is used to configure it.
7558 pub bigquery_config: std::option::Option<crate::model::BigQueryConfig>,
7559
7560 /// Optional. If delivery to Google Cloud Storage is used with this
7561 /// subscription, this field is used to configure it.
7562 pub cloud_storage_config: std::option::Option<crate::model::CloudStorageConfig>,
7563
7564 /// Optional. The approximate amount of time (on a best-effort basis) Pub/Sub
7565 /// waits for the subscriber to acknowledge receipt before resending the
7566 /// message. In the interval after the message is delivered and before it is
7567 /// acknowledged, it is considered to be _outstanding_. During that time
7568 /// period, the message will not be redelivered (on a best-effort basis).
7569 ///
7570 /// For pull subscriptions, this value is used as the initial value for the ack
7571 /// deadline. To override this value for a given message, call
7572 /// `ModifyAckDeadline` with the corresponding `ack_id` if using
7573 /// non-streaming pull or send the `ack_id` in a
7574 /// `StreamingModifyAckDeadlineRequest` if using streaming pull.
7575 /// The minimum custom deadline you can specify is 10 seconds.
7576 /// The maximum custom deadline you can specify is 600 seconds (10 minutes).
7577 /// If this parameter is 0, a default value of 10 seconds is used.
7578 ///
7579 /// For push delivery, this value is also used to set the request timeout for
7580 /// the call to the push endpoint.
7581 ///
7582 /// If the subscriber never acknowledges the message, the Pub/Sub
7583 /// system will eventually redeliver the message.
7584 pub ack_deadline_seconds: i32,
7585
7586 /// Optional. Indicates whether to retain acknowledged messages. If true, then
7587 /// messages are not expunged from the subscription's backlog, even if they are
7588 /// acknowledged, until they fall out of the `message_retention_duration`
7589 /// window. This must be true if you would like to [`Seek` to a timestamp]
7590 /// (<https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time>) in
7591 /// the past to replay previously-acknowledged messages.
7592 pub retain_acked_messages: bool,
7593
7594 /// Optional. How long to retain unacknowledged messages in the subscription's
7595 /// backlog, from the moment a message is published. If `retain_acked_messages`
7596 /// is true, then this also configures the retention of acknowledged messages,
7597 /// and thus configures how far back in time a `Seek` can be done. Defaults to
7598 /// 7 days. Cannot be more than 31 days or less than 10 minutes.
7599 pub message_retention_duration: std::option::Option<wkt::Duration>,
7600
7601 /// Optional. See [Creating and managing
7602 /// labels](https://cloud.google.com/pubsub/docs/labels).
7603 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7604
7605 /// Optional. If true, messages published with the same `ordering_key` in
7606 /// `PubsubMessage` will be delivered to the subscribers in the order in which
7607 /// they are received by the Pub/Sub system. Otherwise, they may be delivered
7608 /// in any order.
7609 pub enable_message_ordering: bool,
7610
7611 /// Optional. A policy that specifies the conditions for this subscription's
7612 /// expiration. A subscription is considered active as long as any connected
7613 /// subscriber is successfully consuming messages from the subscription or is
7614 /// issuing operations on the subscription. If `expiration_policy` is not set,
7615 /// a *default policy* with `ttl` of 31 days will be used. The minimum allowed
7616 /// value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
7617 /// but `expiration_policy.ttl` is not set, the subscription never expires.
7618 pub expiration_policy: std::option::Option<crate::model::ExpirationPolicy>,
7619
7620 /// Optional. An expression written in the Pub/Sub [filter
7621 /// language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
7622 /// then only `PubsubMessage`s whose `attributes` field matches the filter are
7623 /// delivered on this subscription. If empty, then no messages are filtered
7624 /// out.
7625 pub filter: std::string::String,
7626
7627 /// Optional. A policy that specifies the conditions for dead lettering
7628 /// messages in this subscription. If dead_letter_policy is not set, dead
7629 /// lettering is disabled.
7630 ///
7631 /// The Pub/Sub service account associated with this subscriptions's
7632 /// parent project (i.e.,
7633 /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
7634 /// permission to Acknowledge() messages on this subscription.
7635 pub dead_letter_policy: std::option::Option<crate::model::DeadLetterPolicy>,
7636
7637 /// Optional. A policy that specifies how Pub/Sub retries message delivery for
7638 /// this subscription.
7639 ///
7640 /// If not set, the default retry policy is applied. This generally implies
7641 /// that messages will be retried as soon as possible for healthy subscribers.
7642 /// RetryPolicy will be triggered on NACKs or acknowledgement deadline
7643 /// exceeded events for a given message.
7644 pub retry_policy: std::option::Option<crate::model::RetryPolicy>,
7645
7646 /// Optional. Indicates whether the subscription is detached from its topic.
7647 /// Detached subscriptions don't receive messages from their topic and don't
7648 /// retain any backlog. `Pull` and `StreamingPull` requests will return
7649 /// FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
7650 /// the endpoint will not be made.
7651 pub detached: bool,
7652
7653 /// Optional. If true, Pub/Sub provides the following guarantees for the
7654 /// delivery of a message with a given value of `message_id` on this
7655 /// subscription:
7656 ///
7657 /// * The message sent to a subscriber is guaranteed not to be resent
7658 /// before the message's acknowledgement deadline expires.
7659 /// * An acknowledged message will not be resent to a subscriber.
7660 ///
7661 /// Note that subscribers may still receive multiple copies of a message
7662 /// when `enable_exactly_once_delivery` is true if the message was published
7663 /// multiple times by a publisher client. These copies are considered distinct
7664 /// by Pub/Sub and have distinct `message_id` values.
7665 pub enable_exactly_once_delivery: bool,
7666
7667 /// Optional. Transforms to be applied to messages before they are delivered to
7668 /// subscribers. Transforms are applied in the order specified.
7669 pub message_transforms: std::vec::Vec<crate::model::MessageTransform>,
7670
7671 /// Optional. Input only. Immutable. Tag keys/values directly bound to this
7672 /// resource. For example:
7673 /// "123/environment": "production",
7674 /// "123/costCenter": "marketing"
7675 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
7676
7677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7678}
7679
7680impl PubSubSubscription {
7681 /// Creates a new default instance.
7682 pub fn new() -> Self {
7683 std::default::Default::default()
7684 }
7685
7686 /// Sets the value of [name][crate::model::PubSubSubscription::name].
7687 ///
7688 /// # Example
7689 /// ```ignore,no_run
7690 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7691 /// let x = PubSubSubscription::new().set_name("example");
7692 /// ```
7693 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7694 self.name = v.into();
7695 self
7696 }
7697
7698 /// Sets the value of [push_config][crate::model::PubSubSubscription::push_config].
7699 ///
7700 /// # Example
7701 /// ```ignore,no_run
7702 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7703 /// use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
7704 /// let x = PubSubSubscription::new().set_push_config(PushConfig::default()/* use setters */);
7705 /// ```
7706 pub fn set_push_config<T>(mut self, v: T) -> Self
7707 where
7708 T: std::convert::Into<crate::model::PushConfig>,
7709 {
7710 self.push_config = std::option::Option::Some(v.into());
7711 self
7712 }
7713
7714 /// Sets or clears the value of [push_config][crate::model::PubSubSubscription::push_config].
7715 ///
7716 /// # Example
7717 /// ```ignore,no_run
7718 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7719 /// use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
7720 /// let x = PubSubSubscription::new().set_or_clear_push_config(Some(PushConfig::default()/* use setters */));
7721 /// let x = PubSubSubscription::new().set_or_clear_push_config(None::<PushConfig>);
7722 /// ```
7723 pub fn set_or_clear_push_config<T>(mut self, v: std::option::Option<T>) -> Self
7724 where
7725 T: std::convert::Into<crate::model::PushConfig>,
7726 {
7727 self.push_config = v.map(|x| x.into());
7728 self
7729 }
7730
7731 /// Sets the value of [bigquery_config][crate::model::PubSubSubscription::bigquery_config].
7732 ///
7733 /// # Example
7734 /// ```ignore,no_run
7735 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7736 /// use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
7737 /// let x = PubSubSubscription::new().set_bigquery_config(BigQueryConfig::default()/* use setters */);
7738 /// ```
7739 pub fn set_bigquery_config<T>(mut self, v: T) -> Self
7740 where
7741 T: std::convert::Into<crate::model::BigQueryConfig>,
7742 {
7743 self.bigquery_config = std::option::Option::Some(v.into());
7744 self
7745 }
7746
7747 /// Sets or clears the value of [bigquery_config][crate::model::PubSubSubscription::bigquery_config].
7748 ///
7749 /// # Example
7750 /// ```ignore,no_run
7751 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7752 /// use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
7753 /// let x = PubSubSubscription::new().set_or_clear_bigquery_config(Some(BigQueryConfig::default()/* use setters */));
7754 /// let x = PubSubSubscription::new().set_or_clear_bigquery_config(None::<BigQueryConfig>);
7755 /// ```
7756 pub fn set_or_clear_bigquery_config<T>(mut self, v: std::option::Option<T>) -> Self
7757 where
7758 T: std::convert::Into<crate::model::BigQueryConfig>,
7759 {
7760 self.bigquery_config = v.map(|x| x.into());
7761 self
7762 }
7763
7764 /// Sets the value of [cloud_storage_config][crate::model::PubSubSubscription::cloud_storage_config].
7765 ///
7766 /// # Example
7767 /// ```ignore,no_run
7768 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7769 /// use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
7770 /// let x = PubSubSubscription::new().set_cloud_storage_config(CloudStorageConfig::default()/* use setters */);
7771 /// ```
7772 pub fn set_cloud_storage_config<T>(mut self, v: T) -> Self
7773 where
7774 T: std::convert::Into<crate::model::CloudStorageConfig>,
7775 {
7776 self.cloud_storage_config = std::option::Option::Some(v.into());
7777 self
7778 }
7779
7780 /// Sets or clears the value of [cloud_storage_config][crate::model::PubSubSubscription::cloud_storage_config].
7781 ///
7782 /// # Example
7783 /// ```ignore,no_run
7784 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7785 /// use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
7786 /// let x = PubSubSubscription::new().set_or_clear_cloud_storage_config(Some(CloudStorageConfig::default()/* use setters */));
7787 /// let x = PubSubSubscription::new().set_or_clear_cloud_storage_config(None::<CloudStorageConfig>);
7788 /// ```
7789 pub fn set_or_clear_cloud_storage_config<T>(mut self, v: std::option::Option<T>) -> Self
7790 where
7791 T: std::convert::Into<crate::model::CloudStorageConfig>,
7792 {
7793 self.cloud_storage_config = v.map(|x| x.into());
7794 self
7795 }
7796
7797 /// Sets the value of [ack_deadline_seconds][crate::model::PubSubSubscription::ack_deadline_seconds].
7798 ///
7799 /// # Example
7800 /// ```ignore,no_run
7801 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7802 /// let x = PubSubSubscription::new().set_ack_deadline_seconds(42);
7803 /// ```
7804 pub fn set_ack_deadline_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7805 self.ack_deadline_seconds = v.into();
7806 self
7807 }
7808
7809 /// Sets the value of [retain_acked_messages][crate::model::PubSubSubscription::retain_acked_messages].
7810 ///
7811 /// # Example
7812 /// ```ignore,no_run
7813 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7814 /// let x = PubSubSubscription::new().set_retain_acked_messages(true);
7815 /// ```
7816 pub fn set_retain_acked_messages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7817 self.retain_acked_messages = v.into();
7818 self
7819 }
7820
7821 /// Sets the value of [message_retention_duration][crate::model::PubSubSubscription::message_retention_duration].
7822 ///
7823 /// # Example
7824 /// ```ignore,no_run
7825 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7826 /// use wkt::Duration;
7827 /// let x = PubSubSubscription::new().set_message_retention_duration(Duration::default()/* use setters */);
7828 /// ```
7829 pub fn set_message_retention_duration<T>(mut self, v: T) -> Self
7830 where
7831 T: std::convert::Into<wkt::Duration>,
7832 {
7833 self.message_retention_duration = std::option::Option::Some(v.into());
7834 self
7835 }
7836
7837 /// Sets or clears the value of [message_retention_duration][crate::model::PubSubSubscription::message_retention_duration].
7838 ///
7839 /// # Example
7840 /// ```ignore,no_run
7841 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7842 /// use wkt::Duration;
7843 /// let x = PubSubSubscription::new().set_or_clear_message_retention_duration(Some(Duration::default()/* use setters */));
7844 /// let x = PubSubSubscription::new().set_or_clear_message_retention_duration(None::<Duration>);
7845 /// ```
7846 pub fn set_or_clear_message_retention_duration<T>(mut self, v: std::option::Option<T>) -> Self
7847 where
7848 T: std::convert::Into<wkt::Duration>,
7849 {
7850 self.message_retention_duration = v.map(|x| x.into());
7851 self
7852 }
7853
7854 /// Sets the value of [labels][crate::model::PubSubSubscription::labels].
7855 ///
7856 /// # Example
7857 /// ```ignore,no_run
7858 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7859 /// let x = PubSubSubscription::new().set_labels([
7860 /// ("key0", "abc"),
7861 /// ("key1", "xyz"),
7862 /// ]);
7863 /// ```
7864 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7865 where
7866 T: std::iter::IntoIterator<Item = (K, V)>,
7867 K: std::convert::Into<std::string::String>,
7868 V: std::convert::Into<std::string::String>,
7869 {
7870 use std::iter::Iterator;
7871 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7872 self
7873 }
7874
7875 /// Sets the value of [enable_message_ordering][crate::model::PubSubSubscription::enable_message_ordering].
7876 ///
7877 /// # Example
7878 /// ```ignore,no_run
7879 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7880 /// let x = PubSubSubscription::new().set_enable_message_ordering(true);
7881 /// ```
7882 pub fn set_enable_message_ordering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7883 self.enable_message_ordering = v.into();
7884 self
7885 }
7886
7887 /// Sets the value of [expiration_policy][crate::model::PubSubSubscription::expiration_policy].
7888 ///
7889 /// # Example
7890 /// ```ignore,no_run
7891 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7892 /// use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
7893 /// let x = PubSubSubscription::new().set_expiration_policy(ExpirationPolicy::default()/* use setters */);
7894 /// ```
7895 pub fn set_expiration_policy<T>(mut self, v: T) -> Self
7896 where
7897 T: std::convert::Into<crate::model::ExpirationPolicy>,
7898 {
7899 self.expiration_policy = std::option::Option::Some(v.into());
7900 self
7901 }
7902
7903 /// Sets or clears the value of [expiration_policy][crate::model::PubSubSubscription::expiration_policy].
7904 ///
7905 /// # Example
7906 /// ```ignore,no_run
7907 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7908 /// use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
7909 /// let x = PubSubSubscription::new().set_or_clear_expiration_policy(Some(ExpirationPolicy::default()/* use setters */));
7910 /// let x = PubSubSubscription::new().set_or_clear_expiration_policy(None::<ExpirationPolicy>);
7911 /// ```
7912 pub fn set_or_clear_expiration_policy<T>(mut self, v: std::option::Option<T>) -> Self
7913 where
7914 T: std::convert::Into<crate::model::ExpirationPolicy>,
7915 {
7916 self.expiration_policy = v.map(|x| x.into());
7917 self
7918 }
7919
7920 /// Sets the value of [filter][crate::model::PubSubSubscription::filter].
7921 ///
7922 /// # Example
7923 /// ```ignore,no_run
7924 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7925 /// let x = PubSubSubscription::new().set_filter("example");
7926 /// ```
7927 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7928 self.filter = v.into();
7929 self
7930 }
7931
7932 /// Sets the value of [dead_letter_policy][crate::model::PubSubSubscription::dead_letter_policy].
7933 ///
7934 /// # Example
7935 /// ```ignore,no_run
7936 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7937 /// use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
7938 /// let x = PubSubSubscription::new().set_dead_letter_policy(DeadLetterPolicy::default()/* use setters */);
7939 /// ```
7940 pub fn set_dead_letter_policy<T>(mut self, v: T) -> Self
7941 where
7942 T: std::convert::Into<crate::model::DeadLetterPolicy>,
7943 {
7944 self.dead_letter_policy = std::option::Option::Some(v.into());
7945 self
7946 }
7947
7948 /// Sets or clears the value of [dead_letter_policy][crate::model::PubSubSubscription::dead_letter_policy].
7949 ///
7950 /// # Example
7951 /// ```ignore,no_run
7952 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7953 /// use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
7954 /// let x = PubSubSubscription::new().set_or_clear_dead_letter_policy(Some(DeadLetterPolicy::default()/* use setters */));
7955 /// let x = PubSubSubscription::new().set_or_clear_dead_letter_policy(None::<DeadLetterPolicy>);
7956 /// ```
7957 pub fn set_or_clear_dead_letter_policy<T>(mut self, v: std::option::Option<T>) -> Self
7958 where
7959 T: std::convert::Into<crate::model::DeadLetterPolicy>,
7960 {
7961 self.dead_letter_policy = v.map(|x| x.into());
7962 self
7963 }
7964
7965 /// Sets the value of [retry_policy][crate::model::PubSubSubscription::retry_policy].
7966 ///
7967 /// # Example
7968 /// ```ignore,no_run
7969 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7970 /// use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7971 /// let x = PubSubSubscription::new().set_retry_policy(RetryPolicy::default()/* use setters */);
7972 /// ```
7973 pub fn set_retry_policy<T>(mut self, v: T) -> Self
7974 where
7975 T: std::convert::Into<crate::model::RetryPolicy>,
7976 {
7977 self.retry_policy = std::option::Option::Some(v.into());
7978 self
7979 }
7980
7981 /// Sets or clears the value of [retry_policy][crate::model::PubSubSubscription::retry_policy].
7982 ///
7983 /// # Example
7984 /// ```ignore,no_run
7985 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7986 /// use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7987 /// let x = PubSubSubscription::new().set_or_clear_retry_policy(Some(RetryPolicy::default()/* use setters */));
7988 /// let x = PubSubSubscription::new().set_or_clear_retry_policy(None::<RetryPolicy>);
7989 /// ```
7990 pub fn set_or_clear_retry_policy<T>(mut self, v: std::option::Option<T>) -> Self
7991 where
7992 T: std::convert::Into<crate::model::RetryPolicy>,
7993 {
7994 self.retry_policy = v.map(|x| x.into());
7995 self
7996 }
7997
7998 /// Sets the value of [detached][crate::model::PubSubSubscription::detached].
7999 ///
8000 /// # Example
8001 /// ```ignore,no_run
8002 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
8003 /// let x = PubSubSubscription::new().set_detached(true);
8004 /// ```
8005 pub fn set_detached<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8006 self.detached = v.into();
8007 self
8008 }
8009
8010 /// Sets the value of [enable_exactly_once_delivery][crate::model::PubSubSubscription::enable_exactly_once_delivery].
8011 ///
8012 /// # Example
8013 /// ```ignore,no_run
8014 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
8015 /// let x = PubSubSubscription::new().set_enable_exactly_once_delivery(true);
8016 /// ```
8017 pub fn set_enable_exactly_once_delivery<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8018 self.enable_exactly_once_delivery = v.into();
8019 self
8020 }
8021
8022 /// Sets the value of [message_transforms][crate::model::PubSubSubscription::message_transforms].
8023 ///
8024 /// # Example
8025 /// ```ignore,no_run
8026 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
8027 /// use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
8028 /// let x = PubSubSubscription::new()
8029 /// .set_message_transforms([
8030 /// MessageTransform::default()/* use setters */,
8031 /// MessageTransform::default()/* use (different) setters */,
8032 /// ]);
8033 /// ```
8034 pub fn set_message_transforms<T, V>(mut self, v: T) -> Self
8035 where
8036 T: std::iter::IntoIterator<Item = V>,
8037 V: std::convert::Into<crate::model::MessageTransform>,
8038 {
8039 use std::iter::Iterator;
8040 self.message_transforms = v.into_iter().map(|i| i.into()).collect();
8041 self
8042 }
8043
8044 /// Sets the value of [tags][crate::model::PubSubSubscription::tags].
8045 ///
8046 /// # Example
8047 /// ```ignore,no_run
8048 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
8049 /// let x = PubSubSubscription::new().set_tags([
8050 /// ("key0", "abc"),
8051 /// ("key1", "xyz"),
8052 /// ]);
8053 /// ```
8054 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
8055 where
8056 T: std::iter::IntoIterator<Item = (K, V)>,
8057 K: std::convert::Into<std::string::String>,
8058 V: std::convert::Into<std::string::String>,
8059 {
8060 use std::iter::Iterator;
8061 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8062 self
8063 }
8064}
8065
8066impl wkt::message::Message for PubSubSubscription {
8067 fn typename() -> &'static str {
8068 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PubSubSubscription"
8069 }
8070}
8071
8072/// A policy that specifies how Pub/Sub retries message delivery.
8073///
8074/// Retry delay will be exponential based on provided minimum and maximum
8075/// backoffs. <https://en.wikipedia.org/wiki/Exponential_backoff>.
8076///
8077/// RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded
8078/// events for a given message.
8079///
8080/// Retry Policy is implemented on a best effort basis. At times, the delay
8081/// between consecutive deliveries may not match the configuration. That is,
8082/// delay can be more or less than configured backoff.
8083#[derive(Clone, Default, PartialEq)]
8084#[non_exhaustive]
8085pub struct RetryPolicy {
8086 /// Optional. The minimum delay between consecutive deliveries of a given
8087 /// message. Value should be between 0 and 600 seconds. Defaults to 10 seconds.
8088 pub minimum_backoff: std::option::Option<wkt::Duration>,
8089
8090 /// Optional. The maximum delay between consecutive deliveries of a given
8091 /// message. Value should be between 0 and 600 seconds. Defaults to 600
8092 /// seconds.
8093 pub maximum_backoff: std::option::Option<wkt::Duration>,
8094
8095 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8096}
8097
8098impl RetryPolicy {
8099 /// Creates a new default instance.
8100 pub fn new() -> Self {
8101 std::default::Default::default()
8102 }
8103
8104 /// Sets the value of [minimum_backoff][crate::model::RetryPolicy::minimum_backoff].
8105 ///
8106 /// # Example
8107 /// ```ignore,no_run
8108 /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
8109 /// use wkt::Duration;
8110 /// let x = RetryPolicy::new().set_minimum_backoff(Duration::default()/* use setters */);
8111 /// ```
8112 pub fn set_minimum_backoff<T>(mut self, v: T) -> Self
8113 where
8114 T: std::convert::Into<wkt::Duration>,
8115 {
8116 self.minimum_backoff = std::option::Option::Some(v.into());
8117 self
8118 }
8119
8120 /// Sets or clears the value of [minimum_backoff][crate::model::RetryPolicy::minimum_backoff].
8121 ///
8122 /// # Example
8123 /// ```ignore,no_run
8124 /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
8125 /// use wkt::Duration;
8126 /// let x = RetryPolicy::new().set_or_clear_minimum_backoff(Some(Duration::default()/* use setters */));
8127 /// let x = RetryPolicy::new().set_or_clear_minimum_backoff(None::<Duration>);
8128 /// ```
8129 pub fn set_or_clear_minimum_backoff<T>(mut self, v: std::option::Option<T>) -> Self
8130 where
8131 T: std::convert::Into<wkt::Duration>,
8132 {
8133 self.minimum_backoff = v.map(|x| x.into());
8134 self
8135 }
8136
8137 /// Sets the value of [maximum_backoff][crate::model::RetryPolicy::maximum_backoff].
8138 ///
8139 /// # Example
8140 /// ```ignore,no_run
8141 /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
8142 /// use wkt::Duration;
8143 /// let x = RetryPolicy::new().set_maximum_backoff(Duration::default()/* use setters */);
8144 /// ```
8145 pub fn set_maximum_backoff<T>(mut self, v: T) -> Self
8146 where
8147 T: std::convert::Into<wkt::Duration>,
8148 {
8149 self.maximum_backoff = std::option::Option::Some(v.into());
8150 self
8151 }
8152
8153 /// Sets or clears the value of [maximum_backoff][crate::model::RetryPolicy::maximum_backoff].
8154 ///
8155 /// # Example
8156 /// ```ignore,no_run
8157 /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
8158 /// use wkt::Duration;
8159 /// let x = RetryPolicy::new().set_or_clear_maximum_backoff(Some(Duration::default()/* use setters */));
8160 /// let x = RetryPolicy::new().set_or_clear_maximum_backoff(None::<Duration>);
8161 /// ```
8162 pub fn set_or_clear_maximum_backoff<T>(mut self, v: std::option::Option<T>) -> Self
8163 where
8164 T: std::convert::Into<wkt::Duration>,
8165 {
8166 self.maximum_backoff = v.map(|x| x.into());
8167 self
8168 }
8169}
8170
8171impl wkt::message::Message for RetryPolicy {
8172 fn typename() -> &'static str {
8173 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RetryPolicy"
8174 }
8175}
8176
8177/// Dead lettering is done on a best effort basis. The same message might be
8178/// dead lettered multiple times.
8179///
8180/// If validation on any of the fields fails at subscription creation/updation,
8181/// the create/update subscription request will fail.
8182#[derive(Clone, Default, PartialEq)]
8183#[non_exhaustive]
8184pub struct DeadLetterPolicy {
8185 /// Optional. The name of the topic to which dead letter messages should be
8186 /// published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub
8187 /// service account associated with the enclosing subscription's parent project
8188 /// (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must
8189 /// have permission to Publish() to this topic.
8190 ///
8191 /// The operation will fail if the topic does not exist.
8192 /// Users should ensure that there is a subscription attached to this topic
8193 /// since messages published to a topic with no subscriptions are lost.
8194 pub dead_letter_topic: std::string::String,
8195
8196 /// Optional. The maximum number of delivery attempts for any message. The
8197 /// value must be between 5 and 100.
8198 ///
8199 /// The number of delivery attempts is defined as 1 + (the sum of number of
8200 /// NACKs and number of times the acknowledgement deadline has been exceeded
8201 /// for the message).
8202 ///
8203 /// A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
8204 /// client libraries may automatically extend ack_deadlines.
8205 ///
8206 /// This field will be honored on a best effort basis.
8207 ///
8208 /// If this parameter is 0, a default value of 5 is used.
8209 pub max_delivery_attempts: i32,
8210
8211 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8212}
8213
8214impl DeadLetterPolicy {
8215 /// Creates a new default instance.
8216 pub fn new() -> Self {
8217 std::default::Default::default()
8218 }
8219
8220 /// Sets the value of [dead_letter_topic][crate::model::DeadLetterPolicy::dead_letter_topic].
8221 ///
8222 /// # Example
8223 /// ```ignore,no_run
8224 /// # use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
8225 /// let x = DeadLetterPolicy::new().set_dead_letter_topic("example");
8226 /// ```
8227 pub fn set_dead_letter_topic<T: std::convert::Into<std::string::String>>(
8228 mut self,
8229 v: T,
8230 ) -> Self {
8231 self.dead_letter_topic = v.into();
8232 self
8233 }
8234
8235 /// Sets the value of [max_delivery_attempts][crate::model::DeadLetterPolicy::max_delivery_attempts].
8236 ///
8237 /// # Example
8238 /// ```ignore,no_run
8239 /// # use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
8240 /// let x = DeadLetterPolicy::new().set_max_delivery_attempts(42);
8241 /// ```
8242 pub fn set_max_delivery_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8243 self.max_delivery_attempts = v.into();
8244 self
8245 }
8246}
8247
8248impl wkt::message::Message for DeadLetterPolicy {
8249 fn typename() -> &'static str {
8250 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeadLetterPolicy"
8251 }
8252}
8253
8254/// A policy that specifies the conditions for resource expiration (i.e.,
8255/// automatic resource deletion).
8256#[derive(Clone, Default, PartialEq)]
8257#[non_exhaustive]
8258pub struct ExpirationPolicy {
8259 /// Optional. Specifies the "time-to-live" duration for an associated resource.
8260 /// The resource expires if it is not active for a period of `ttl`. The
8261 /// definition of "activity" depends on the type of the associated resource.
8262 /// The minimum and maximum allowed values for `ttl` depend on the type of the
8263 /// associated resource, as well. If `ttl` is not set, the associated resource
8264 /// never expires.
8265 pub ttl: std::option::Option<wkt::Duration>,
8266
8267 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8268}
8269
8270impl ExpirationPolicy {
8271 /// Creates a new default instance.
8272 pub fn new() -> Self {
8273 std::default::Default::default()
8274 }
8275
8276 /// Sets the value of [ttl][crate::model::ExpirationPolicy::ttl].
8277 ///
8278 /// # Example
8279 /// ```ignore,no_run
8280 /// # use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
8281 /// use wkt::Duration;
8282 /// let x = ExpirationPolicy::new().set_ttl(Duration::default()/* use setters */);
8283 /// ```
8284 pub fn set_ttl<T>(mut self, v: T) -> Self
8285 where
8286 T: std::convert::Into<wkt::Duration>,
8287 {
8288 self.ttl = std::option::Option::Some(v.into());
8289 self
8290 }
8291
8292 /// Sets or clears the value of [ttl][crate::model::ExpirationPolicy::ttl].
8293 ///
8294 /// # Example
8295 /// ```ignore,no_run
8296 /// # use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
8297 /// use wkt::Duration;
8298 /// let x = ExpirationPolicy::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
8299 /// let x = ExpirationPolicy::new().set_or_clear_ttl(None::<Duration>);
8300 /// ```
8301 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
8302 where
8303 T: std::convert::Into<wkt::Duration>,
8304 {
8305 self.ttl = v.map(|x| x.into());
8306 self
8307 }
8308}
8309
8310impl wkt::message::Message for ExpirationPolicy {
8311 fn typename() -> &'static str {
8312 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ExpirationPolicy"
8313 }
8314}
8315
8316/// Configuration for a push delivery endpoint.
8317#[derive(Clone, Default, PartialEq)]
8318#[non_exhaustive]
8319pub struct PushConfig {
8320 /// Optional. A URL locating the endpoint to which messages should be pushed.
8321 /// For example, a Webhook endpoint might use `<https://example.com/push>`.
8322 pub push_endpoint: std::string::String,
8323
8324 /// Optional. Endpoint configuration attributes that can be used to control
8325 /// different aspects of the message delivery.
8326 ///
8327 /// The only currently supported attribute is `x-goog-version`, which you can
8328 /// use to change the format of the pushed message. This attribute
8329 /// indicates the version of the data expected by the endpoint. This
8330 /// controls the shape of the pushed message (i.e., its fields and metadata).
8331 ///
8332 /// If not present during the `CreateSubscription` call, it will default to
8333 /// the version of the Pub/Sub API used to make such call. If not present in a
8334 /// `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
8335 /// calls will always return a valid version, even if the subscription was
8336 /// created without this attribute.
8337 ///
8338 /// The only supported values for the `x-goog-version` attribute are:
8339 ///
8340 /// * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
8341 /// * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
8342 ///
8343 /// For example:
8344 /// `attributes { "x-goog-version": "v1" }`
8345 pub attributes: std::collections::HashMap<std::string::String, std::string::String>,
8346
8347 /// An authentication method used by push endpoints to verify the source of
8348 /// push requests. This can be used with push endpoints that are private by
8349 /// default to allow requests only from the Pub/Sub system, for example.
8350 /// This field is optional and should be set only by users interested in
8351 /// authenticated push.
8352 pub authentication_method: std::option::Option<crate::model::push_config::AuthenticationMethod>,
8353
8354 /// The format of the delivered message to the push endpoint is defined by
8355 /// the chosen wrapper. When unset, `PubsubWrapper` is used.
8356 pub wrapper: std::option::Option<crate::model::push_config::Wrapper>,
8357
8358 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8359}
8360
8361impl PushConfig {
8362 /// Creates a new default instance.
8363 pub fn new() -> Self {
8364 std::default::Default::default()
8365 }
8366
8367 /// Sets the value of [push_endpoint][crate::model::PushConfig::push_endpoint].
8368 ///
8369 /// # Example
8370 /// ```ignore,no_run
8371 /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8372 /// let x = PushConfig::new().set_push_endpoint("example");
8373 /// ```
8374 pub fn set_push_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8375 self.push_endpoint = v.into();
8376 self
8377 }
8378
8379 /// Sets the value of [attributes][crate::model::PushConfig::attributes].
8380 ///
8381 /// # Example
8382 /// ```ignore,no_run
8383 /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8384 /// let x = PushConfig::new().set_attributes([
8385 /// ("key0", "abc"),
8386 /// ("key1", "xyz"),
8387 /// ]);
8388 /// ```
8389 pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
8390 where
8391 T: std::iter::IntoIterator<Item = (K, V)>,
8392 K: std::convert::Into<std::string::String>,
8393 V: std::convert::Into<std::string::String>,
8394 {
8395 use std::iter::Iterator;
8396 self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8397 self
8398 }
8399
8400 /// Sets the value of [authentication_method][crate::model::PushConfig::authentication_method].
8401 ///
8402 /// Note that all the setters affecting `authentication_method` are mutually
8403 /// exclusive.
8404 ///
8405 /// # Example
8406 /// ```ignore,no_run
8407 /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8408 /// use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8409 /// let x = PushConfig::new().set_authentication_method(Some(
8410 /// google_cloud_bigquery_analyticshub_v1::model::push_config::AuthenticationMethod::OidcToken(OidcToken::default().into())));
8411 /// ```
8412 pub fn set_authentication_method<
8413 T: std::convert::Into<std::option::Option<crate::model::push_config::AuthenticationMethod>>,
8414 >(
8415 mut self,
8416 v: T,
8417 ) -> Self {
8418 self.authentication_method = v.into();
8419 self
8420 }
8421
8422 /// The value of [authentication_method][crate::model::PushConfig::authentication_method]
8423 /// if it holds a `OidcToken`, `None` if the field is not set or
8424 /// holds a different branch.
8425 pub fn oidc_token(
8426 &self,
8427 ) -> std::option::Option<&std::boxed::Box<crate::model::push_config::OidcToken>> {
8428 #[allow(unreachable_patterns)]
8429 self.authentication_method.as_ref().and_then(|v| match v {
8430 crate::model::push_config::AuthenticationMethod::OidcToken(v) => {
8431 std::option::Option::Some(v)
8432 }
8433 _ => std::option::Option::None,
8434 })
8435 }
8436
8437 /// Sets the value of [authentication_method][crate::model::PushConfig::authentication_method]
8438 /// to hold a `OidcToken`.
8439 ///
8440 /// Note that all the setters affecting `authentication_method` are
8441 /// mutually exclusive.
8442 ///
8443 /// # Example
8444 /// ```ignore,no_run
8445 /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8446 /// use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8447 /// let x = PushConfig::new().set_oidc_token(OidcToken::default()/* use setters */);
8448 /// assert!(x.oidc_token().is_some());
8449 /// ```
8450 pub fn set_oidc_token<
8451 T: std::convert::Into<std::boxed::Box<crate::model::push_config::OidcToken>>,
8452 >(
8453 mut self,
8454 v: T,
8455 ) -> Self {
8456 self.authentication_method = std::option::Option::Some(
8457 crate::model::push_config::AuthenticationMethod::OidcToken(v.into()),
8458 );
8459 self
8460 }
8461
8462 /// Sets the value of [wrapper][crate::model::PushConfig::wrapper].
8463 ///
8464 /// Note that all the setters affecting `wrapper` are mutually
8465 /// exclusive.
8466 ///
8467 /// # Example
8468 /// ```ignore,no_run
8469 /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8470 /// use google_cloud_bigquery_analyticshub_v1::model::push_config::PubsubWrapper;
8471 /// let x = PushConfig::new().set_wrapper(Some(
8472 /// google_cloud_bigquery_analyticshub_v1::model::push_config::Wrapper::PubsubWrapper(PubsubWrapper::default().into())));
8473 /// ```
8474 pub fn set_wrapper<
8475 T: std::convert::Into<std::option::Option<crate::model::push_config::Wrapper>>,
8476 >(
8477 mut self,
8478 v: T,
8479 ) -> Self {
8480 self.wrapper = v.into();
8481 self
8482 }
8483
8484 /// The value of [wrapper][crate::model::PushConfig::wrapper]
8485 /// if it holds a `PubsubWrapper`, `None` if the field is not set or
8486 /// holds a different branch.
8487 pub fn pubsub_wrapper(
8488 &self,
8489 ) -> std::option::Option<&std::boxed::Box<crate::model::push_config::PubsubWrapper>> {
8490 #[allow(unreachable_patterns)]
8491 self.wrapper.as_ref().and_then(|v| match v {
8492 crate::model::push_config::Wrapper::PubsubWrapper(v) => std::option::Option::Some(v),
8493 _ => std::option::Option::None,
8494 })
8495 }
8496
8497 /// Sets the value of [wrapper][crate::model::PushConfig::wrapper]
8498 /// to hold a `PubsubWrapper`.
8499 ///
8500 /// Note that all the setters affecting `wrapper` are
8501 /// mutually exclusive.
8502 ///
8503 /// # Example
8504 /// ```ignore,no_run
8505 /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8506 /// use google_cloud_bigquery_analyticshub_v1::model::push_config::PubsubWrapper;
8507 /// let x = PushConfig::new().set_pubsub_wrapper(PubsubWrapper::default()/* use setters */);
8508 /// assert!(x.pubsub_wrapper().is_some());
8509 /// assert!(x.no_wrapper().is_none());
8510 /// ```
8511 pub fn set_pubsub_wrapper<
8512 T: std::convert::Into<std::boxed::Box<crate::model::push_config::PubsubWrapper>>,
8513 >(
8514 mut self,
8515 v: T,
8516 ) -> Self {
8517 self.wrapper =
8518 std::option::Option::Some(crate::model::push_config::Wrapper::PubsubWrapper(v.into()));
8519 self
8520 }
8521
8522 /// The value of [wrapper][crate::model::PushConfig::wrapper]
8523 /// if it holds a `NoWrapper`, `None` if the field is not set or
8524 /// holds a different branch.
8525 pub fn no_wrapper(
8526 &self,
8527 ) -> std::option::Option<&std::boxed::Box<crate::model::push_config::NoWrapper>> {
8528 #[allow(unreachable_patterns)]
8529 self.wrapper.as_ref().and_then(|v| match v {
8530 crate::model::push_config::Wrapper::NoWrapper(v) => std::option::Option::Some(v),
8531 _ => std::option::Option::None,
8532 })
8533 }
8534
8535 /// Sets the value of [wrapper][crate::model::PushConfig::wrapper]
8536 /// to hold a `NoWrapper`.
8537 ///
8538 /// Note that all the setters affecting `wrapper` are
8539 /// mutually exclusive.
8540 ///
8541 /// # Example
8542 /// ```ignore,no_run
8543 /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8544 /// use google_cloud_bigquery_analyticshub_v1::model::push_config::NoWrapper;
8545 /// let x = PushConfig::new().set_no_wrapper(NoWrapper::default()/* use setters */);
8546 /// assert!(x.no_wrapper().is_some());
8547 /// assert!(x.pubsub_wrapper().is_none());
8548 /// ```
8549 pub fn set_no_wrapper<
8550 T: std::convert::Into<std::boxed::Box<crate::model::push_config::NoWrapper>>,
8551 >(
8552 mut self,
8553 v: T,
8554 ) -> Self {
8555 self.wrapper =
8556 std::option::Option::Some(crate::model::push_config::Wrapper::NoWrapper(v.into()));
8557 self
8558 }
8559}
8560
8561impl wkt::message::Message for PushConfig {
8562 fn typename() -> &'static str {
8563 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig"
8564 }
8565}
8566
8567/// Defines additional types related to [PushConfig].
8568pub mod push_config {
8569 #[allow(unused_imports)]
8570 use super::*;
8571
8572 /// Contains information needed for generating an
8573 /// [OpenID Connect
8574 /// token](https://developers.google.com/identity/protocols/OpenIDConnect).
8575 #[derive(Clone, Default, PartialEq)]
8576 #[non_exhaustive]
8577 pub struct OidcToken {
8578 /// Optional. [Service account
8579 /// email](https://cloud.google.com/iam/docs/service-accounts)
8580 /// used for generating the OIDC token. For more information
8581 /// on setting up authentication, see
8582 /// [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
8583 pub service_account_email: std::string::String,
8584
8585 /// Optional. Audience to be used when generating OIDC token. The audience
8586 /// claim identifies the recipients that the JWT is intended for. The
8587 /// audience value is a single case-sensitive string. Having multiple values
8588 /// (array) for the audience field is not supported. More info about the OIDC
8589 /// JWT token audience here:
8590 /// <https://tools.ietf.org/html/rfc7519#section-4.1.3> Note: if not specified,
8591 /// the Push endpoint URL will be used.
8592 pub audience: std::string::String,
8593
8594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8595 }
8596
8597 impl OidcToken {
8598 /// Creates a new default instance.
8599 pub fn new() -> Self {
8600 std::default::Default::default()
8601 }
8602
8603 /// Sets the value of [service_account_email][crate::model::push_config::OidcToken::service_account_email].
8604 ///
8605 /// # Example
8606 /// ```ignore,no_run
8607 /// # use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8608 /// let x = OidcToken::new().set_service_account_email("example");
8609 /// ```
8610 pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
8611 mut self,
8612 v: T,
8613 ) -> Self {
8614 self.service_account_email = v.into();
8615 self
8616 }
8617
8618 /// Sets the value of [audience][crate::model::push_config::OidcToken::audience].
8619 ///
8620 /// # Example
8621 /// ```ignore,no_run
8622 /// # use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8623 /// let x = OidcToken::new().set_audience("example");
8624 /// ```
8625 pub fn set_audience<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8626 self.audience = v.into();
8627 self
8628 }
8629 }
8630
8631 impl wkt::message::Message for OidcToken {
8632 fn typename() -> &'static str {
8633 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig.OidcToken"
8634 }
8635 }
8636
8637 /// The payload to the push endpoint is in the form of the JSON representation
8638 /// of a PubsubMessage
8639 /// (<https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage>).
8640 #[derive(Clone, Default, PartialEq)]
8641 #[non_exhaustive]
8642 pub struct PubsubWrapper {
8643 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8644 }
8645
8646 impl PubsubWrapper {
8647 /// Creates a new default instance.
8648 pub fn new() -> Self {
8649 std::default::Default::default()
8650 }
8651 }
8652
8653 impl wkt::message::Message for PubsubWrapper {
8654 fn typename() -> &'static str {
8655 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig.PubsubWrapper"
8656 }
8657 }
8658
8659 /// Sets the `data` field as the HTTP body for delivery.
8660 #[derive(Clone, Default, PartialEq)]
8661 #[non_exhaustive]
8662 pub struct NoWrapper {
8663 /// Optional. When true, writes the Pub/Sub message metadata to
8664 /// `x-goog-pubsub-<KEY>:<VAL>` headers of the HTTP request. Writes the
8665 /// Pub/Sub message attributes to `<KEY>:<VAL>` headers of the HTTP request.
8666 pub write_metadata: bool,
8667
8668 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8669 }
8670
8671 impl NoWrapper {
8672 /// Creates a new default instance.
8673 pub fn new() -> Self {
8674 std::default::Default::default()
8675 }
8676
8677 /// Sets the value of [write_metadata][crate::model::push_config::NoWrapper::write_metadata].
8678 ///
8679 /// # Example
8680 /// ```ignore,no_run
8681 /// # use google_cloud_bigquery_analyticshub_v1::model::push_config::NoWrapper;
8682 /// let x = NoWrapper::new().set_write_metadata(true);
8683 /// ```
8684 pub fn set_write_metadata<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8685 self.write_metadata = v.into();
8686 self
8687 }
8688 }
8689
8690 impl wkt::message::Message for NoWrapper {
8691 fn typename() -> &'static str {
8692 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig.NoWrapper"
8693 }
8694 }
8695
8696 /// An authentication method used by push endpoints to verify the source of
8697 /// push requests. This can be used with push endpoints that are private by
8698 /// default to allow requests only from the Pub/Sub system, for example.
8699 /// This field is optional and should be set only by users interested in
8700 /// authenticated push.
8701 #[derive(Clone, Debug, PartialEq)]
8702 #[non_exhaustive]
8703 pub enum AuthenticationMethod {
8704 /// Optional. If specified, Pub/Sub will generate and attach an OIDC JWT
8705 /// token as an `Authorization` header in the HTTP request for every pushed
8706 /// message.
8707 OidcToken(std::boxed::Box<crate::model::push_config::OidcToken>),
8708 }
8709
8710 /// The format of the delivered message to the push endpoint is defined by
8711 /// the chosen wrapper. When unset, `PubsubWrapper` is used.
8712 #[derive(Clone, Debug, PartialEq)]
8713 #[non_exhaustive]
8714 pub enum Wrapper {
8715 /// Optional. When set, the payload to the push endpoint is in the form of
8716 /// the JSON representation of a PubsubMessage
8717 /// (<https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage>).
8718 PubsubWrapper(std::boxed::Box<crate::model::push_config::PubsubWrapper>),
8719 /// Optional. When set, the payload to the push endpoint is not wrapped.
8720 NoWrapper(std::boxed::Box<crate::model::push_config::NoWrapper>),
8721 }
8722}
8723
8724/// Configuration for a BigQuery subscription.
8725#[derive(Clone, Default, PartialEq)]
8726#[non_exhaustive]
8727pub struct BigQueryConfig {
8728 /// Optional. The name of the table to which to write data, of the form
8729 /// {projectId}.{datasetId}.{tableId}
8730 pub table: std::string::String,
8731
8732 /// Optional. When true, use the topic's schema as the columns to write to in
8733 /// BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
8734 /// enabled at the same time.
8735 pub use_topic_schema: bool,
8736
8737 /// Optional. When true, write the subscription name, message_id, publish_time,
8738 /// attributes, and ordering_key to additional columns in the table. The
8739 /// subscription name, message_id, and publish_time fields are put in their own
8740 /// columns while all other message properties (other than data) are written to
8741 /// a JSON object in the attributes column.
8742 pub write_metadata: bool,
8743
8744 /// Optional. When true and use_topic_schema is true, any fields that are a
8745 /// part of the topic schema that are not part of the BigQuery table schema are
8746 /// dropped when writing to BigQuery. Otherwise, the schemas must be kept in
8747 /// sync and any messages with extra fields are not written and remain in the
8748 /// subscription's backlog.
8749 pub drop_unknown_fields: bool,
8750
8751 /// Optional. When true, use the BigQuery table's schema as the columns to
8752 /// write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
8753 /// enabled at the same time.
8754 pub use_table_schema: bool,
8755
8756 /// Optional. The service account to use to write to BigQuery. The subscription
8757 /// creator or updater that specifies this field must have
8758 /// `iam.serviceAccounts.actAs` permission on the service account. If not
8759 /// specified, the Pub/Sub [service
8760 /// agent](https://cloud.google.com/iam/docs/service-agents),
8761 /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
8762 pub service_account_email: std::string::String,
8763
8764 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8765}
8766
8767impl BigQueryConfig {
8768 /// Creates a new default instance.
8769 pub fn new() -> Self {
8770 std::default::Default::default()
8771 }
8772
8773 /// Sets the value of [table][crate::model::BigQueryConfig::table].
8774 ///
8775 /// # Example
8776 /// ```ignore,no_run
8777 /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8778 /// let x = BigQueryConfig::new().set_table("example");
8779 /// ```
8780 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8781 self.table = v.into();
8782 self
8783 }
8784
8785 /// Sets the value of [use_topic_schema][crate::model::BigQueryConfig::use_topic_schema].
8786 ///
8787 /// # Example
8788 /// ```ignore,no_run
8789 /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8790 /// let x = BigQueryConfig::new().set_use_topic_schema(true);
8791 /// ```
8792 pub fn set_use_topic_schema<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8793 self.use_topic_schema = v.into();
8794 self
8795 }
8796
8797 /// Sets the value of [write_metadata][crate::model::BigQueryConfig::write_metadata].
8798 ///
8799 /// # Example
8800 /// ```ignore,no_run
8801 /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8802 /// let x = BigQueryConfig::new().set_write_metadata(true);
8803 /// ```
8804 pub fn set_write_metadata<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8805 self.write_metadata = v.into();
8806 self
8807 }
8808
8809 /// Sets the value of [drop_unknown_fields][crate::model::BigQueryConfig::drop_unknown_fields].
8810 ///
8811 /// # Example
8812 /// ```ignore,no_run
8813 /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8814 /// let x = BigQueryConfig::new().set_drop_unknown_fields(true);
8815 /// ```
8816 pub fn set_drop_unknown_fields<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8817 self.drop_unknown_fields = v.into();
8818 self
8819 }
8820
8821 /// Sets the value of [use_table_schema][crate::model::BigQueryConfig::use_table_schema].
8822 ///
8823 /// # Example
8824 /// ```ignore,no_run
8825 /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8826 /// let x = BigQueryConfig::new().set_use_table_schema(true);
8827 /// ```
8828 pub fn set_use_table_schema<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8829 self.use_table_schema = v.into();
8830 self
8831 }
8832
8833 /// Sets the value of [service_account_email][crate::model::BigQueryConfig::service_account_email].
8834 ///
8835 /// # Example
8836 /// ```ignore,no_run
8837 /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8838 /// let x = BigQueryConfig::new().set_service_account_email("example");
8839 /// ```
8840 pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
8841 mut self,
8842 v: T,
8843 ) -> Self {
8844 self.service_account_email = v.into();
8845 self
8846 }
8847}
8848
8849impl wkt::message::Message for BigQueryConfig {
8850 fn typename() -> &'static str {
8851 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.BigQueryConfig"
8852 }
8853}
8854
8855/// Configuration for a Cloud Storage subscription.
8856#[derive(Clone, Default, PartialEq)]
8857#[non_exhaustive]
8858pub struct CloudStorageConfig {
8859 /// Required. User-provided name for the Cloud Storage bucket.
8860 /// The bucket must be created by the user. The bucket name must be without
8861 /// any prefix like "gs://". See the [bucket naming
8862 /// requirements] (<https://cloud.google.com/storage/docs/buckets#naming>).
8863 pub bucket: std::string::String,
8864
8865 /// Optional. User-provided prefix for Cloud Storage filename. See the [object
8866 /// naming requirements](https://cloud.google.com/storage/docs/objects#naming).
8867 pub filename_prefix: std::string::String,
8868
8869 /// Optional. User-provided suffix for Cloud Storage filename. See the [object
8870 /// naming requirements](https://cloud.google.com/storage/docs/objects#naming).
8871 /// Must not end in "/".
8872 pub filename_suffix: std::string::String,
8873
8874 /// Optional. User-provided format string specifying how to represent datetimes
8875 /// in Cloud Storage filenames. See the [datetime format
8876 /// guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names).
8877 pub filename_datetime_format: std::string::String,
8878
8879 /// Optional. File batching settings.
8880 /// If no max_duration setting is specified, a max_duration of 5 minutes will
8881 /// be set by default. max_duration is required regardless of whether other
8882 /// file batching settings are specified.
8883 ///
8884 /// The maximum duration that can elapse before a new Cloud Storage file is
8885 /// created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
8886 /// the subscription's acknowledgement deadline.
8887 pub max_duration: std::option::Option<wkt::Duration>,
8888
8889 /// Optional. The maximum bytes that can be written to a Cloud Storage file
8890 /// before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may
8891 /// be exceeded in cases where messages are larger than the limit.
8892 pub max_bytes: i64,
8893
8894 /// Optional. The maximum number of messages that can be written to a Cloud
8895 /// Storage file before a new file is created. Min 1000 messages.
8896 pub max_messages: i64,
8897
8898 /// Optional. The service account to use to write to Cloud Storage. The
8899 /// subscription creator or updater that specifies this field must have
8900 /// `iam.serviceAccounts.actAs` permission on the service account. If not
8901 /// specified, the Pub/Sub
8902 /// [service agent](https://cloud.google.com/iam/docs/service-agents),
8903 /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
8904 pub service_account_email: std::string::String,
8905
8906 /// Defaults to text format.
8907 pub output_format: std::option::Option<crate::model::cloud_storage_config::OutputFormat>,
8908
8909 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8910}
8911
8912impl CloudStorageConfig {
8913 /// Creates a new default instance.
8914 pub fn new() -> Self {
8915 std::default::Default::default()
8916 }
8917
8918 /// Sets the value of [bucket][crate::model::CloudStorageConfig::bucket].
8919 ///
8920 /// # Example
8921 /// ```ignore,no_run
8922 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8923 /// let x = CloudStorageConfig::new().set_bucket("example");
8924 /// ```
8925 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8926 self.bucket = v.into();
8927 self
8928 }
8929
8930 /// Sets the value of [filename_prefix][crate::model::CloudStorageConfig::filename_prefix].
8931 ///
8932 /// # Example
8933 /// ```ignore,no_run
8934 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8935 /// let x = CloudStorageConfig::new().set_filename_prefix("example");
8936 /// ```
8937 pub fn set_filename_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8938 self.filename_prefix = v.into();
8939 self
8940 }
8941
8942 /// Sets the value of [filename_suffix][crate::model::CloudStorageConfig::filename_suffix].
8943 ///
8944 /// # Example
8945 /// ```ignore,no_run
8946 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8947 /// let x = CloudStorageConfig::new().set_filename_suffix("example");
8948 /// ```
8949 pub fn set_filename_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8950 self.filename_suffix = v.into();
8951 self
8952 }
8953
8954 /// Sets the value of [filename_datetime_format][crate::model::CloudStorageConfig::filename_datetime_format].
8955 ///
8956 /// # Example
8957 /// ```ignore,no_run
8958 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8959 /// let x = CloudStorageConfig::new().set_filename_datetime_format("example");
8960 /// ```
8961 pub fn set_filename_datetime_format<T: std::convert::Into<std::string::String>>(
8962 mut self,
8963 v: T,
8964 ) -> Self {
8965 self.filename_datetime_format = v.into();
8966 self
8967 }
8968
8969 /// Sets the value of [max_duration][crate::model::CloudStorageConfig::max_duration].
8970 ///
8971 /// # Example
8972 /// ```ignore,no_run
8973 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8974 /// use wkt::Duration;
8975 /// let x = CloudStorageConfig::new().set_max_duration(Duration::default()/* use setters */);
8976 /// ```
8977 pub fn set_max_duration<T>(mut self, v: T) -> Self
8978 where
8979 T: std::convert::Into<wkt::Duration>,
8980 {
8981 self.max_duration = std::option::Option::Some(v.into());
8982 self
8983 }
8984
8985 /// Sets or clears the value of [max_duration][crate::model::CloudStorageConfig::max_duration].
8986 ///
8987 /// # Example
8988 /// ```ignore,no_run
8989 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8990 /// use wkt::Duration;
8991 /// let x = CloudStorageConfig::new().set_or_clear_max_duration(Some(Duration::default()/* use setters */));
8992 /// let x = CloudStorageConfig::new().set_or_clear_max_duration(None::<Duration>);
8993 /// ```
8994 pub fn set_or_clear_max_duration<T>(mut self, v: std::option::Option<T>) -> Self
8995 where
8996 T: std::convert::Into<wkt::Duration>,
8997 {
8998 self.max_duration = v.map(|x| x.into());
8999 self
9000 }
9001
9002 /// Sets the value of [max_bytes][crate::model::CloudStorageConfig::max_bytes].
9003 ///
9004 /// # Example
9005 /// ```ignore,no_run
9006 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
9007 /// let x = CloudStorageConfig::new().set_max_bytes(42);
9008 /// ```
9009 pub fn set_max_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9010 self.max_bytes = v.into();
9011 self
9012 }
9013
9014 /// Sets the value of [max_messages][crate::model::CloudStorageConfig::max_messages].
9015 ///
9016 /// # Example
9017 /// ```ignore,no_run
9018 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
9019 /// let x = CloudStorageConfig::new().set_max_messages(42);
9020 /// ```
9021 pub fn set_max_messages<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9022 self.max_messages = v.into();
9023 self
9024 }
9025
9026 /// Sets the value of [service_account_email][crate::model::CloudStorageConfig::service_account_email].
9027 ///
9028 /// # Example
9029 /// ```ignore,no_run
9030 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
9031 /// let x = CloudStorageConfig::new().set_service_account_email("example");
9032 /// ```
9033 pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
9034 mut self,
9035 v: T,
9036 ) -> Self {
9037 self.service_account_email = v.into();
9038 self
9039 }
9040
9041 /// Sets the value of [output_format][crate::model::CloudStorageConfig::output_format].
9042 ///
9043 /// Note that all the setters affecting `output_format` are mutually
9044 /// exclusive.
9045 ///
9046 /// # Example
9047 /// ```ignore,no_run
9048 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
9049 /// use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::TextConfig;
9050 /// let x = CloudStorageConfig::new().set_output_format(Some(
9051 /// google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::OutputFormat::TextConfig(TextConfig::default().into())));
9052 /// ```
9053 pub fn set_output_format<
9054 T: std::convert::Into<std::option::Option<crate::model::cloud_storage_config::OutputFormat>>,
9055 >(
9056 mut self,
9057 v: T,
9058 ) -> Self {
9059 self.output_format = v.into();
9060 self
9061 }
9062
9063 /// The value of [output_format][crate::model::CloudStorageConfig::output_format]
9064 /// if it holds a `TextConfig`, `None` if the field is not set or
9065 /// holds a different branch.
9066 pub fn text_config(
9067 &self,
9068 ) -> std::option::Option<&std::boxed::Box<crate::model::cloud_storage_config::TextConfig>> {
9069 #[allow(unreachable_patterns)]
9070 self.output_format.as_ref().and_then(|v| match v {
9071 crate::model::cloud_storage_config::OutputFormat::TextConfig(v) => {
9072 std::option::Option::Some(v)
9073 }
9074 _ => std::option::Option::None,
9075 })
9076 }
9077
9078 /// Sets the value of [output_format][crate::model::CloudStorageConfig::output_format]
9079 /// to hold a `TextConfig`.
9080 ///
9081 /// Note that all the setters affecting `output_format` are
9082 /// mutually exclusive.
9083 ///
9084 /// # Example
9085 /// ```ignore,no_run
9086 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
9087 /// use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::TextConfig;
9088 /// let x = CloudStorageConfig::new().set_text_config(TextConfig::default()/* use setters */);
9089 /// assert!(x.text_config().is_some());
9090 /// assert!(x.avro_config().is_none());
9091 /// ```
9092 pub fn set_text_config<
9093 T: std::convert::Into<std::boxed::Box<crate::model::cloud_storage_config::TextConfig>>,
9094 >(
9095 mut self,
9096 v: T,
9097 ) -> Self {
9098 self.output_format = std::option::Option::Some(
9099 crate::model::cloud_storage_config::OutputFormat::TextConfig(v.into()),
9100 );
9101 self
9102 }
9103
9104 /// The value of [output_format][crate::model::CloudStorageConfig::output_format]
9105 /// if it holds a `AvroConfig`, `None` if the field is not set or
9106 /// holds a different branch.
9107 pub fn avro_config(
9108 &self,
9109 ) -> std::option::Option<&std::boxed::Box<crate::model::cloud_storage_config::AvroConfig>> {
9110 #[allow(unreachable_patterns)]
9111 self.output_format.as_ref().and_then(|v| match v {
9112 crate::model::cloud_storage_config::OutputFormat::AvroConfig(v) => {
9113 std::option::Option::Some(v)
9114 }
9115 _ => std::option::Option::None,
9116 })
9117 }
9118
9119 /// Sets the value of [output_format][crate::model::CloudStorageConfig::output_format]
9120 /// to hold a `AvroConfig`.
9121 ///
9122 /// Note that all the setters affecting `output_format` are
9123 /// mutually exclusive.
9124 ///
9125 /// # Example
9126 /// ```ignore,no_run
9127 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
9128 /// use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::AvroConfig;
9129 /// let x = CloudStorageConfig::new().set_avro_config(AvroConfig::default()/* use setters */);
9130 /// assert!(x.avro_config().is_some());
9131 /// assert!(x.text_config().is_none());
9132 /// ```
9133 pub fn set_avro_config<
9134 T: std::convert::Into<std::boxed::Box<crate::model::cloud_storage_config::AvroConfig>>,
9135 >(
9136 mut self,
9137 v: T,
9138 ) -> Self {
9139 self.output_format = std::option::Option::Some(
9140 crate::model::cloud_storage_config::OutputFormat::AvroConfig(v.into()),
9141 );
9142 self
9143 }
9144}
9145
9146impl wkt::message::Message for CloudStorageConfig {
9147 fn typename() -> &'static str {
9148 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CloudStorageConfig"
9149 }
9150}
9151
9152/// Defines additional types related to [CloudStorageConfig].
9153pub mod cloud_storage_config {
9154 #[allow(unused_imports)]
9155 use super::*;
9156
9157 /// Configuration for writing message data in text format.
9158 /// Message payloads will be written to files as raw text, separated by a
9159 /// newline.
9160 #[derive(Clone, Default, PartialEq)]
9161 #[non_exhaustive]
9162 pub struct TextConfig {
9163 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9164 }
9165
9166 impl TextConfig {
9167 /// Creates a new default instance.
9168 pub fn new() -> Self {
9169 std::default::Default::default()
9170 }
9171 }
9172
9173 impl wkt::message::Message for TextConfig {
9174 fn typename() -> &'static str {
9175 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CloudStorageConfig.TextConfig"
9176 }
9177 }
9178
9179 /// Configuration for writing message data in Avro format.
9180 /// Message payloads and metadata will be written to files as an Avro binary.
9181 #[derive(Clone, Default, PartialEq)]
9182 #[non_exhaustive]
9183 pub struct AvroConfig {
9184 /// Optional. When true, write the subscription name, message_id,
9185 /// publish_time, attributes, and ordering_key as additional fields in the
9186 /// output. The subscription name, message_id, and publish_time fields are
9187 /// put in their own fields while all other message properties other than
9188 /// data (for example, an ordering_key, if present) are added as entries in
9189 /// the attributes map.
9190 pub write_metadata: bool,
9191
9192 /// Optional. When true, the output Cloud Storage file will be serialized
9193 /// using the topic schema, if it exists.
9194 pub use_topic_schema: bool,
9195
9196 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9197 }
9198
9199 impl AvroConfig {
9200 /// Creates a new default instance.
9201 pub fn new() -> Self {
9202 std::default::Default::default()
9203 }
9204
9205 /// Sets the value of [write_metadata][crate::model::cloud_storage_config::AvroConfig::write_metadata].
9206 ///
9207 /// # Example
9208 /// ```ignore,no_run
9209 /// # use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::AvroConfig;
9210 /// let x = AvroConfig::new().set_write_metadata(true);
9211 /// ```
9212 pub fn set_write_metadata<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9213 self.write_metadata = v.into();
9214 self
9215 }
9216
9217 /// Sets the value of [use_topic_schema][crate::model::cloud_storage_config::AvroConfig::use_topic_schema].
9218 ///
9219 /// # Example
9220 /// ```ignore,no_run
9221 /// # use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::AvroConfig;
9222 /// let x = AvroConfig::new().set_use_topic_schema(true);
9223 /// ```
9224 pub fn set_use_topic_schema<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9225 self.use_topic_schema = v.into();
9226 self
9227 }
9228 }
9229
9230 impl wkt::message::Message for AvroConfig {
9231 fn typename() -> &'static str {
9232 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CloudStorageConfig.AvroConfig"
9233 }
9234 }
9235
9236 /// Defaults to text format.
9237 #[derive(Clone, Debug, PartialEq)]
9238 #[non_exhaustive]
9239 pub enum OutputFormat {
9240 /// Optional. If set, message data will be written to Cloud Storage in text
9241 /// format.
9242 TextConfig(std::boxed::Box<crate::model::cloud_storage_config::TextConfig>),
9243 /// Optional. If set, message data will be written to Cloud Storage in Avro
9244 /// format.
9245 AvroConfig(std::boxed::Box<crate::model::cloud_storage_config::AvroConfig>),
9246 }
9247}
9248
9249/// All supported message transforms types.
9250#[derive(Clone, Default, PartialEq)]
9251#[non_exhaustive]
9252pub struct MessageTransform {
9253 /// Optional. This field is deprecated, use the `disabled` field to disable
9254 /// transforms.
9255 #[deprecated]
9256 pub enabled: bool,
9257
9258 /// Optional. If true, the transform is disabled and will not be applied to
9259 /// messages. Defaults to `false`.
9260 pub disabled: bool,
9261
9262 /// The type of transform to apply to messages.
9263 pub transform: std::option::Option<crate::model::message_transform::Transform>,
9264
9265 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9266}
9267
9268impl MessageTransform {
9269 /// Creates a new default instance.
9270 pub fn new() -> Self {
9271 std::default::Default::default()
9272 }
9273
9274 /// Sets the value of [enabled][crate::model::MessageTransform::enabled].
9275 ///
9276 /// # Example
9277 /// ```ignore,no_run
9278 /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9279 /// let x = MessageTransform::new().set_enabled(true);
9280 /// ```
9281 #[deprecated]
9282 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9283 self.enabled = v.into();
9284 self
9285 }
9286
9287 /// Sets the value of [disabled][crate::model::MessageTransform::disabled].
9288 ///
9289 /// # Example
9290 /// ```ignore,no_run
9291 /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9292 /// let x = MessageTransform::new().set_disabled(true);
9293 /// ```
9294 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9295 self.disabled = v.into();
9296 self
9297 }
9298
9299 /// Sets the value of [transform][crate::model::MessageTransform::transform].
9300 ///
9301 /// Note that all the setters affecting `transform` are mutually
9302 /// exclusive.
9303 ///
9304 /// # Example
9305 /// ```ignore,no_run
9306 /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9307 /// use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9308 /// let x = MessageTransform::new().set_transform(Some(
9309 /// google_cloud_bigquery_analyticshub_v1::model::message_transform::Transform::JavascriptUdf(JavaScriptUDF::default().into())));
9310 /// ```
9311 pub fn set_transform<
9312 T: std::convert::Into<std::option::Option<crate::model::message_transform::Transform>>,
9313 >(
9314 mut self,
9315 v: T,
9316 ) -> Self {
9317 self.transform = v.into();
9318 self
9319 }
9320
9321 /// The value of [transform][crate::model::MessageTransform::transform]
9322 /// if it holds a `JavascriptUdf`, `None` if the field is not set or
9323 /// holds a different branch.
9324 pub fn javascript_udf(
9325 &self,
9326 ) -> std::option::Option<&std::boxed::Box<crate::model::JavaScriptUDF>> {
9327 #[allow(unreachable_patterns)]
9328 self.transform.as_ref().and_then(|v| match v {
9329 crate::model::message_transform::Transform::JavascriptUdf(v) => {
9330 std::option::Option::Some(v)
9331 }
9332 _ => std::option::Option::None,
9333 })
9334 }
9335
9336 /// Sets the value of [transform][crate::model::MessageTransform::transform]
9337 /// to hold a `JavascriptUdf`.
9338 ///
9339 /// Note that all the setters affecting `transform` are
9340 /// mutually exclusive.
9341 ///
9342 /// # Example
9343 /// ```ignore,no_run
9344 /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9345 /// use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9346 /// let x = MessageTransform::new().set_javascript_udf(JavaScriptUDF::default()/* use setters */);
9347 /// assert!(x.javascript_udf().is_some());
9348 /// ```
9349 pub fn set_javascript_udf<
9350 T: std::convert::Into<std::boxed::Box<crate::model::JavaScriptUDF>>,
9351 >(
9352 mut self,
9353 v: T,
9354 ) -> Self {
9355 self.transform = std::option::Option::Some(
9356 crate::model::message_transform::Transform::JavascriptUdf(v.into()),
9357 );
9358 self
9359 }
9360}
9361
9362impl wkt::message::Message for MessageTransform {
9363 fn typename() -> &'static str {
9364 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.MessageTransform"
9365 }
9366}
9367
9368/// Defines additional types related to [MessageTransform].
9369pub mod message_transform {
9370 #[allow(unused_imports)]
9371 use super::*;
9372
9373 /// The type of transform to apply to messages.
9374 #[derive(Clone, Debug, PartialEq)]
9375 #[non_exhaustive]
9376 pub enum Transform {
9377 /// Optional. JavaScript User Defined Function. If multiple JavaScriptUDF's
9378 /// are specified on a resource, each must have a unique `function_name`.
9379 JavascriptUdf(std::boxed::Box<crate::model::JavaScriptUDF>),
9380 }
9381}
9382
9383/// User-defined JavaScript function that can transform or filter a Pub/Sub
9384/// message.
9385#[derive(Clone, Default, PartialEq)]
9386#[non_exhaustive]
9387pub struct JavaScriptUDF {
9388 /// Required. Name of the JavasScript function that should applied to Pub/Sub
9389 /// messages.
9390 pub function_name: std::string::String,
9391
9392 /// Required. JavaScript code that contains a function `function_name` with the
9393 /// below signature:
9394 ///
9395 /// ```norust
9396 /// /**
9397 /// * Transforms a Pub/Sub message.
9398 ///
9399 /// * @return {(Object<string, (string | Object<string, string>)>|null)} - To
9400 /// * filter a message, return `null`. To transform a message return a map
9401 /// * with the following keys:
9402 /// * - (required) 'data' : {string}
9403 /// * - (optional) 'attributes' : {Object<string, string>}
9404 /// * Returning empty `attributes` will remove all attributes from the
9405 /// * message.
9406 /// *
9407 /// * @param {(Object<string, (string | Object<string, string>)>} Pub/Sub
9408 /// * message. Keys:
9409 /// * - (required) 'data' : {string}
9410 /// * - (required) 'attributes' : {Object<string, string>}
9411 /// *
9412 /// * @param {Object<string, any>} metadata - Pub/Sub message metadata.
9413 /// * Keys:
9414 /// * - (required) 'message_id' : {string}
9415 /// * - (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
9416 /// * - (optional) 'ordering_key': {string}
9417 /// */
9418 ///
9419 /// function <function_name>(message, metadata) {
9420 /// }
9421 /// ```
9422 pub code: std::string::String,
9423
9424 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9425}
9426
9427impl JavaScriptUDF {
9428 /// Creates a new default instance.
9429 pub fn new() -> Self {
9430 std::default::Default::default()
9431 }
9432
9433 /// Sets the value of [function_name][crate::model::JavaScriptUDF::function_name].
9434 ///
9435 /// # Example
9436 /// ```ignore,no_run
9437 /// # use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9438 /// let x = JavaScriptUDF::new().set_function_name("example");
9439 /// ```
9440 pub fn set_function_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9441 self.function_name = v.into();
9442 self
9443 }
9444
9445 /// Sets the value of [code][crate::model::JavaScriptUDF::code].
9446 ///
9447 /// # Example
9448 /// ```ignore,no_run
9449 /// # use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9450 /// let x = JavaScriptUDF::new().set_code("example");
9451 /// ```
9452 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9453 self.code = v.into();
9454 self
9455 }
9456}
9457
9458impl wkt::message::Message for JavaScriptUDF {
9459 fn typename() -> &'static str {
9460 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.JavaScriptUDF"
9461 }
9462}
9463
9464/// Specifies the type of discovery on the discovery page. Note that
9465/// this does not control the visibility of the exchange/listing which is
9466/// defined by IAM permission.
9467///
9468/// # Working with unknown values
9469///
9470/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9471/// additional enum variants at any time. Adding new variants is not considered
9472/// a breaking change. Applications should write their code in anticipation of:
9473///
9474/// - New values appearing in future releases of the client library, **and**
9475/// - New values received dynamically, without application changes.
9476///
9477/// Please consult the [Working with enums] section in the user guide for some
9478/// guidelines.
9479///
9480/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9481#[derive(Clone, Debug, PartialEq)]
9482#[non_exhaustive]
9483pub enum DiscoveryType {
9484 /// Unspecified. Defaults to DISCOVERY_TYPE_PRIVATE.
9485 Unspecified,
9486 /// The Data exchange/listing can be discovered in the 'Private' results
9487 /// list.
9488 Private,
9489 /// The Data exchange/listing can be discovered in the 'Public' results
9490 /// list.
9491 Public,
9492 /// If set, the enum was initialized with an unknown value.
9493 ///
9494 /// Applications can examine the value using [DiscoveryType::value] or
9495 /// [DiscoveryType::name].
9496 UnknownValue(discovery_type::UnknownValue),
9497}
9498
9499#[doc(hidden)]
9500pub mod discovery_type {
9501 #[allow(unused_imports)]
9502 use super::*;
9503 #[derive(Clone, Debug, PartialEq)]
9504 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9505}
9506
9507impl DiscoveryType {
9508 /// Gets the enum value.
9509 ///
9510 /// Returns `None` if the enum contains an unknown value deserialized from
9511 /// the string representation of enums.
9512 pub fn value(&self) -> std::option::Option<i32> {
9513 match self {
9514 Self::Unspecified => std::option::Option::Some(0),
9515 Self::Private => std::option::Option::Some(1),
9516 Self::Public => std::option::Option::Some(2),
9517 Self::UnknownValue(u) => u.0.value(),
9518 }
9519 }
9520
9521 /// Gets the enum value as a string.
9522 ///
9523 /// Returns `None` if the enum contains an unknown value deserialized from
9524 /// the integer representation of enums.
9525 pub fn name(&self) -> std::option::Option<&str> {
9526 match self {
9527 Self::Unspecified => std::option::Option::Some("DISCOVERY_TYPE_UNSPECIFIED"),
9528 Self::Private => std::option::Option::Some("DISCOVERY_TYPE_PRIVATE"),
9529 Self::Public => std::option::Option::Some("DISCOVERY_TYPE_PUBLIC"),
9530 Self::UnknownValue(u) => u.0.name(),
9531 }
9532 }
9533}
9534
9535impl std::default::Default for DiscoveryType {
9536 fn default() -> Self {
9537 use std::convert::From;
9538 Self::from(0)
9539 }
9540}
9541
9542impl std::fmt::Display for DiscoveryType {
9543 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9544 wkt::internal::display_enum(f, self.name(), self.value())
9545 }
9546}
9547
9548impl std::convert::From<i32> for DiscoveryType {
9549 fn from(value: i32) -> Self {
9550 match value {
9551 0 => Self::Unspecified,
9552 1 => Self::Private,
9553 2 => Self::Public,
9554 _ => Self::UnknownValue(discovery_type::UnknownValue(
9555 wkt::internal::UnknownEnumValue::Integer(value),
9556 )),
9557 }
9558 }
9559}
9560
9561impl std::convert::From<&str> for DiscoveryType {
9562 fn from(value: &str) -> Self {
9563 use std::string::ToString;
9564 match value {
9565 "DISCOVERY_TYPE_UNSPECIFIED" => Self::Unspecified,
9566 "DISCOVERY_TYPE_PRIVATE" => Self::Private,
9567 "DISCOVERY_TYPE_PUBLIC" => Self::Public,
9568 _ => Self::UnknownValue(discovery_type::UnknownValue(
9569 wkt::internal::UnknownEnumValue::String(value.to_string()),
9570 )),
9571 }
9572 }
9573}
9574
9575impl serde::ser::Serialize for DiscoveryType {
9576 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9577 where
9578 S: serde::Serializer,
9579 {
9580 match self {
9581 Self::Unspecified => serializer.serialize_i32(0),
9582 Self::Private => serializer.serialize_i32(1),
9583 Self::Public => serializer.serialize_i32(2),
9584 Self::UnknownValue(u) => u.0.serialize(serializer),
9585 }
9586 }
9587}
9588
9589impl<'de> serde::de::Deserialize<'de> for DiscoveryType {
9590 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9591 where
9592 D: serde::Deserializer<'de>,
9593 {
9594 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DiscoveryType>::new(
9595 ".google.cloud.bigquery.analyticshub.v1.DiscoveryType",
9596 ))
9597 }
9598}
9599
9600/// The underlying shared asset type shared in a listing by a publisher.
9601///
9602/// # Working with unknown values
9603///
9604/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9605/// additional enum variants at any time. Adding new variants is not considered
9606/// a breaking change. Applications should write their code in anticipation of:
9607///
9608/// - New values appearing in future releases of the client library, **and**
9609/// - New values received dynamically, without application changes.
9610///
9611/// Please consult the [Working with enums] section in the user guide for some
9612/// guidelines.
9613///
9614/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9615#[derive(Clone, Debug, PartialEq)]
9616#[non_exhaustive]
9617pub enum SharedResourceType {
9618 /// Not specified.
9619 Unspecified,
9620 /// BigQuery Dataset Asset.
9621 BigqueryDataset,
9622 /// Pub/Sub Topic Asset.
9623 PubsubTopic,
9624 /// If set, the enum was initialized with an unknown value.
9625 ///
9626 /// Applications can examine the value using [SharedResourceType::value] or
9627 /// [SharedResourceType::name].
9628 UnknownValue(shared_resource_type::UnknownValue),
9629}
9630
9631#[doc(hidden)]
9632pub mod shared_resource_type {
9633 #[allow(unused_imports)]
9634 use super::*;
9635 #[derive(Clone, Debug, PartialEq)]
9636 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9637}
9638
9639impl SharedResourceType {
9640 /// Gets the enum value.
9641 ///
9642 /// Returns `None` if the enum contains an unknown value deserialized from
9643 /// the string representation of enums.
9644 pub fn value(&self) -> std::option::Option<i32> {
9645 match self {
9646 Self::Unspecified => std::option::Option::Some(0),
9647 Self::BigqueryDataset => std::option::Option::Some(1),
9648 Self::PubsubTopic => std::option::Option::Some(2),
9649 Self::UnknownValue(u) => u.0.value(),
9650 }
9651 }
9652
9653 /// Gets the enum value as a string.
9654 ///
9655 /// Returns `None` if the enum contains an unknown value deserialized from
9656 /// the integer representation of enums.
9657 pub fn name(&self) -> std::option::Option<&str> {
9658 match self {
9659 Self::Unspecified => std::option::Option::Some("SHARED_RESOURCE_TYPE_UNSPECIFIED"),
9660 Self::BigqueryDataset => std::option::Option::Some("BIGQUERY_DATASET"),
9661 Self::PubsubTopic => std::option::Option::Some("PUBSUB_TOPIC"),
9662 Self::UnknownValue(u) => u.0.name(),
9663 }
9664 }
9665}
9666
9667impl std::default::Default for SharedResourceType {
9668 fn default() -> Self {
9669 use std::convert::From;
9670 Self::from(0)
9671 }
9672}
9673
9674impl std::fmt::Display for SharedResourceType {
9675 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9676 wkt::internal::display_enum(f, self.name(), self.value())
9677 }
9678}
9679
9680impl std::convert::From<i32> for SharedResourceType {
9681 fn from(value: i32) -> Self {
9682 match value {
9683 0 => Self::Unspecified,
9684 1 => Self::BigqueryDataset,
9685 2 => Self::PubsubTopic,
9686 _ => Self::UnknownValue(shared_resource_type::UnknownValue(
9687 wkt::internal::UnknownEnumValue::Integer(value),
9688 )),
9689 }
9690 }
9691}
9692
9693impl std::convert::From<&str> for SharedResourceType {
9694 fn from(value: &str) -> Self {
9695 use std::string::ToString;
9696 match value {
9697 "SHARED_RESOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
9698 "BIGQUERY_DATASET" => Self::BigqueryDataset,
9699 "PUBSUB_TOPIC" => Self::PubsubTopic,
9700 _ => Self::UnknownValue(shared_resource_type::UnknownValue(
9701 wkt::internal::UnknownEnumValue::String(value.to_string()),
9702 )),
9703 }
9704 }
9705}
9706
9707impl serde::ser::Serialize for SharedResourceType {
9708 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9709 where
9710 S: serde::Serializer,
9711 {
9712 match self {
9713 Self::Unspecified => serializer.serialize_i32(0),
9714 Self::BigqueryDataset => serializer.serialize_i32(1),
9715 Self::PubsubTopic => serializer.serialize_i32(2),
9716 Self::UnknownValue(u) => u.0.serialize(serializer),
9717 }
9718 }
9719}
9720
9721impl<'de> serde::de::Deserialize<'de> for SharedResourceType {
9722 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9723 where
9724 D: serde::Deserializer<'de>,
9725 {
9726 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SharedResourceType>::new(
9727 ".google.cloud.bigquery.analyticshub.v1.SharedResourceType",
9728 ))
9729 }
9730}