1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct DataExchange {
46 pub name: std::string::String,
49
50 pub display_name: std::string::String,
55
56 pub description: std::string::String,
62
63 pub primary_contact: std::string::String,
66
67 pub documentation: std::string::String,
69
70 pub listing_count: i32,
72
73 pub icon: ::bytes::Bytes,
79
80 pub sharing_environment_config: std::option::Option<crate::model::SharingEnvironmentConfig>,
82
83 pub discovery_type: std::option::Option<crate::model::DiscoveryType>,
87
88 pub log_linked_dataset_query_user_email: std::option::Option<bool>,
91
92 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
93}
94
95impl DataExchange {
96 pub fn new() -> Self {
97 std::default::Default::default()
98 }
99
100 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
102 self.name = v.into();
103 self
104 }
105
106 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
108 self.display_name = v.into();
109 self
110 }
111
112 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
114 self.description = v.into();
115 self
116 }
117
118 pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
120 self.primary_contact = v.into();
121 self
122 }
123
124 pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
126 self.documentation = v.into();
127 self
128 }
129
130 pub fn set_listing_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
132 self.listing_count = v.into();
133 self
134 }
135
136 pub fn set_icon<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
138 self.icon = v.into();
139 self
140 }
141
142 pub fn set_sharing_environment_config<T>(mut self, v: T) -> Self
144 where
145 T: std::convert::Into<crate::model::SharingEnvironmentConfig>,
146 {
147 self.sharing_environment_config = std::option::Option::Some(v.into());
148 self
149 }
150
151 pub fn set_or_clear_sharing_environment_config<T>(mut self, v: std::option::Option<T>) -> Self
153 where
154 T: std::convert::Into<crate::model::SharingEnvironmentConfig>,
155 {
156 self.sharing_environment_config = v.map(|x| x.into());
157 self
158 }
159
160 pub fn set_discovery_type<T>(mut self, v: T) -> Self
162 where
163 T: std::convert::Into<crate::model::DiscoveryType>,
164 {
165 self.discovery_type = std::option::Option::Some(v.into());
166 self
167 }
168
169 pub fn set_or_clear_discovery_type<T>(mut self, v: std::option::Option<T>) -> Self
171 where
172 T: std::convert::Into<crate::model::DiscoveryType>,
173 {
174 self.discovery_type = v.map(|x| x.into());
175 self
176 }
177
178 pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
180 where
181 T: std::convert::Into<bool>,
182 {
183 self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
184 self
185 }
186
187 pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
189 mut self,
190 v: std::option::Option<T>,
191 ) -> Self
192 where
193 T: std::convert::Into<bool>,
194 {
195 self.log_linked_dataset_query_user_email = v.map(|x| x.into());
196 self
197 }
198}
199
200impl wkt::message::Message for DataExchange {
201 fn typename() -> &'static str {
202 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DataExchange"
203 }
204}
205
206#[derive(Clone, Default, PartialEq)]
209#[non_exhaustive]
210pub struct QueryTemplate {
211 pub name: std::string::String,
214
215 pub display_name: std::string::String,
220
221 pub description: std::string::String,
226
227 pub proposer: std::string::String,
231
232 pub primary_contact: std::string::String,
235
236 pub documentation: std::string::String,
238
239 pub state: crate::model::query_template::State,
241
242 pub routine: std::option::Option<crate::model::Routine>,
244
245 pub create_time: std::option::Option<wkt::Timestamp>,
247
248 pub update_time: std::option::Option<wkt::Timestamp>,
250
251 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
252}
253
254impl QueryTemplate {
255 pub fn new() -> Self {
256 std::default::Default::default()
257 }
258
259 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
261 self.name = v.into();
262 self
263 }
264
265 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
267 self.display_name = v.into();
268 self
269 }
270
271 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
273 self.description = v.into();
274 self
275 }
276
277 pub fn set_proposer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
279 self.proposer = v.into();
280 self
281 }
282
283 pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
285 self.primary_contact = v.into();
286 self
287 }
288
289 pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
291 self.documentation = v.into();
292 self
293 }
294
295 pub fn set_state<T: std::convert::Into<crate::model::query_template::State>>(
297 mut self,
298 v: T,
299 ) -> Self {
300 self.state = v.into();
301 self
302 }
303
304 pub fn set_routine<T>(mut self, v: T) -> Self
306 where
307 T: std::convert::Into<crate::model::Routine>,
308 {
309 self.routine = std::option::Option::Some(v.into());
310 self
311 }
312
313 pub fn set_or_clear_routine<T>(mut self, v: std::option::Option<T>) -> Self
315 where
316 T: std::convert::Into<crate::model::Routine>,
317 {
318 self.routine = v.map(|x| x.into());
319 self
320 }
321
322 pub fn set_create_time<T>(mut self, v: T) -> Self
324 where
325 T: std::convert::Into<wkt::Timestamp>,
326 {
327 self.create_time = std::option::Option::Some(v.into());
328 self
329 }
330
331 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
333 where
334 T: std::convert::Into<wkt::Timestamp>,
335 {
336 self.create_time = v.map(|x| x.into());
337 self
338 }
339
340 pub fn set_update_time<T>(mut self, v: T) -> Self
342 where
343 T: std::convert::Into<wkt::Timestamp>,
344 {
345 self.update_time = std::option::Option::Some(v.into());
346 self
347 }
348
349 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
351 where
352 T: std::convert::Into<wkt::Timestamp>,
353 {
354 self.update_time = v.map(|x| x.into());
355 self
356 }
357}
358
359impl wkt::message::Message for QueryTemplate {
360 fn typename() -> &'static str {
361 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.QueryTemplate"
362 }
363}
364
365pub mod query_template {
367 #[allow(unused_imports)]
368 use super::*;
369
370 #[derive(Clone, Debug, PartialEq)]
386 #[non_exhaustive]
387 pub enum State {
388 Unspecified,
390 Drafted,
392 Pending,
394 Deleted,
396 Approved,
398 UnknownValue(state::UnknownValue),
403 }
404
405 #[doc(hidden)]
406 pub mod state {
407 #[allow(unused_imports)]
408 use super::*;
409 #[derive(Clone, Debug, PartialEq)]
410 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
411 }
412
413 impl State {
414 pub fn value(&self) -> std::option::Option<i32> {
419 match self {
420 Self::Unspecified => std::option::Option::Some(0),
421 Self::Drafted => std::option::Option::Some(1),
422 Self::Pending => std::option::Option::Some(2),
423 Self::Deleted => std::option::Option::Some(3),
424 Self::Approved => std::option::Option::Some(4),
425 Self::UnknownValue(u) => u.0.value(),
426 }
427 }
428
429 pub fn name(&self) -> std::option::Option<&str> {
434 match self {
435 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
436 Self::Drafted => std::option::Option::Some("DRAFTED"),
437 Self::Pending => std::option::Option::Some("PENDING"),
438 Self::Deleted => std::option::Option::Some("DELETED"),
439 Self::Approved => std::option::Option::Some("APPROVED"),
440 Self::UnknownValue(u) => u.0.name(),
441 }
442 }
443 }
444
445 impl std::default::Default for State {
446 fn default() -> Self {
447 use std::convert::From;
448 Self::from(0)
449 }
450 }
451
452 impl std::fmt::Display for State {
453 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
454 wkt::internal::display_enum(f, self.name(), self.value())
455 }
456 }
457
458 impl std::convert::From<i32> for State {
459 fn from(value: i32) -> Self {
460 match value {
461 0 => Self::Unspecified,
462 1 => Self::Drafted,
463 2 => Self::Pending,
464 3 => Self::Deleted,
465 4 => Self::Approved,
466 _ => Self::UnknownValue(state::UnknownValue(
467 wkt::internal::UnknownEnumValue::Integer(value),
468 )),
469 }
470 }
471 }
472
473 impl std::convert::From<&str> for State {
474 fn from(value: &str) -> Self {
475 use std::string::ToString;
476 match value {
477 "STATE_UNSPECIFIED" => Self::Unspecified,
478 "DRAFTED" => Self::Drafted,
479 "PENDING" => Self::Pending,
480 "DELETED" => Self::Deleted,
481 "APPROVED" => Self::Approved,
482 _ => Self::UnknownValue(state::UnknownValue(
483 wkt::internal::UnknownEnumValue::String(value.to_string()),
484 )),
485 }
486 }
487 }
488
489 impl serde::ser::Serialize for State {
490 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
491 where
492 S: serde::Serializer,
493 {
494 match self {
495 Self::Unspecified => serializer.serialize_i32(0),
496 Self::Drafted => serializer.serialize_i32(1),
497 Self::Pending => serializer.serialize_i32(2),
498 Self::Deleted => serializer.serialize_i32(3),
499 Self::Approved => serializer.serialize_i32(4),
500 Self::UnknownValue(u) => u.0.serialize(serializer),
501 }
502 }
503 }
504
505 impl<'de> serde::de::Deserialize<'de> for State {
506 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
507 where
508 D: serde::Deserializer<'de>,
509 {
510 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
511 ".google.cloud.bigquery.analyticshub.v1.QueryTemplate.State",
512 ))
513 }
514 }
515}
516
517#[derive(Clone, Default, PartialEq)]
519#[non_exhaustive]
520pub struct Routine {
521 pub routine_type: crate::model::routine::RoutineType,
523
524 pub definition_body: std::string::String,
526
527 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
528}
529
530impl Routine {
531 pub fn new() -> Self {
532 std::default::Default::default()
533 }
534
535 pub fn set_routine_type<T: std::convert::Into<crate::model::routine::RoutineType>>(
537 mut self,
538 v: T,
539 ) -> Self {
540 self.routine_type = v.into();
541 self
542 }
543
544 pub fn set_definition_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
546 self.definition_body = v.into();
547 self
548 }
549}
550
551impl wkt::message::Message for Routine {
552 fn typename() -> &'static str {
553 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Routine"
554 }
555}
556
557pub mod routine {
559 #[allow(unused_imports)]
560 use super::*;
561
562 #[derive(Clone, Debug, PartialEq)]
578 #[non_exhaustive]
579 pub enum RoutineType {
580 Unspecified,
582 TableValuedFunction,
584 UnknownValue(routine_type::UnknownValue),
589 }
590
591 #[doc(hidden)]
592 pub mod routine_type {
593 #[allow(unused_imports)]
594 use super::*;
595 #[derive(Clone, Debug, PartialEq)]
596 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
597 }
598
599 impl RoutineType {
600 pub fn value(&self) -> std::option::Option<i32> {
605 match self {
606 Self::Unspecified => std::option::Option::Some(0),
607 Self::TableValuedFunction => std::option::Option::Some(1),
608 Self::UnknownValue(u) => u.0.value(),
609 }
610 }
611
612 pub fn name(&self) -> std::option::Option<&str> {
617 match self {
618 Self::Unspecified => std::option::Option::Some("ROUTINE_TYPE_UNSPECIFIED"),
619 Self::TableValuedFunction => std::option::Option::Some("TABLE_VALUED_FUNCTION"),
620 Self::UnknownValue(u) => u.0.name(),
621 }
622 }
623 }
624
625 impl std::default::Default for RoutineType {
626 fn default() -> Self {
627 use std::convert::From;
628 Self::from(0)
629 }
630 }
631
632 impl std::fmt::Display for RoutineType {
633 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
634 wkt::internal::display_enum(f, self.name(), self.value())
635 }
636 }
637
638 impl std::convert::From<i32> for RoutineType {
639 fn from(value: i32) -> Self {
640 match value {
641 0 => Self::Unspecified,
642 1 => Self::TableValuedFunction,
643 _ => Self::UnknownValue(routine_type::UnknownValue(
644 wkt::internal::UnknownEnumValue::Integer(value),
645 )),
646 }
647 }
648 }
649
650 impl std::convert::From<&str> for RoutineType {
651 fn from(value: &str) -> Self {
652 use std::string::ToString;
653 match value {
654 "ROUTINE_TYPE_UNSPECIFIED" => Self::Unspecified,
655 "TABLE_VALUED_FUNCTION" => Self::TableValuedFunction,
656 _ => Self::UnknownValue(routine_type::UnknownValue(
657 wkt::internal::UnknownEnumValue::String(value.to_string()),
658 )),
659 }
660 }
661 }
662
663 impl serde::ser::Serialize for RoutineType {
664 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
665 where
666 S: serde::Serializer,
667 {
668 match self {
669 Self::Unspecified => serializer.serialize_i32(0),
670 Self::TableValuedFunction => serializer.serialize_i32(1),
671 Self::UnknownValue(u) => u.0.serialize(serializer),
672 }
673 }
674 }
675
676 impl<'de> serde::de::Deserialize<'de> for RoutineType {
677 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
678 where
679 D: serde::Deserializer<'de>,
680 {
681 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutineType>::new(
682 ".google.cloud.bigquery.analyticshub.v1.Routine.RoutineType",
683 ))
684 }
685 }
686}
687
688#[derive(Clone, Default, PartialEq)]
690#[non_exhaustive]
691pub struct CreateQueryTemplateRequest {
692 pub parent: std::string::String,
696
697 pub query_template_id: std::string::String,
701
702 pub query_template: std::option::Option<crate::model::QueryTemplate>,
704
705 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
706}
707
708impl CreateQueryTemplateRequest {
709 pub fn new() -> Self {
710 std::default::Default::default()
711 }
712
713 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
715 self.parent = v.into();
716 self
717 }
718
719 pub fn set_query_template_id<T: std::convert::Into<std::string::String>>(
721 mut self,
722 v: T,
723 ) -> Self {
724 self.query_template_id = v.into();
725 self
726 }
727
728 pub fn set_query_template<T>(mut self, v: T) -> Self
730 where
731 T: std::convert::Into<crate::model::QueryTemplate>,
732 {
733 self.query_template = std::option::Option::Some(v.into());
734 self
735 }
736
737 pub fn set_or_clear_query_template<T>(mut self, v: std::option::Option<T>) -> Self
739 where
740 T: std::convert::Into<crate::model::QueryTemplate>,
741 {
742 self.query_template = v.map(|x| x.into());
743 self
744 }
745}
746
747impl wkt::message::Message for CreateQueryTemplateRequest {
748 fn typename() -> &'static str {
749 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateQueryTemplateRequest"
750 }
751}
752
753#[derive(Clone, Default, PartialEq)]
755#[non_exhaustive]
756pub struct GetQueryTemplateRequest {
757 pub name: std::string::String,
761
762 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
763}
764
765impl GetQueryTemplateRequest {
766 pub fn new() -> Self {
767 std::default::Default::default()
768 }
769
770 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
772 self.name = v.into();
773 self
774 }
775}
776
777impl wkt::message::Message for GetQueryTemplateRequest {
778 fn typename() -> &'static str {
779 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetQueryTemplateRequest"
780 }
781}
782
783#[derive(Clone, Default, PartialEq)]
785#[non_exhaustive]
786pub struct ListQueryTemplatesRequest {
787 pub parent: std::string::String,
790
791 pub page_size: i32,
794
795 pub page_token: std::string::String,
798
799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
800}
801
802impl ListQueryTemplatesRequest {
803 pub fn new() -> Self {
804 std::default::Default::default()
805 }
806
807 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
809 self.parent = v.into();
810 self
811 }
812
813 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
815 self.page_size = v.into();
816 self
817 }
818
819 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
821 self.page_token = v.into();
822 self
823 }
824}
825
826impl wkt::message::Message for ListQueryTemplatesRequest {
827 fn typename() -> &'static str {
828 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListQueryTemplatesRequest"
829 }
830}
831
832#[derive(Clone, Default, PartialEq)]
834#[non_exhaustive]
835pub struct ListQueryTemplatesResponse {
836 pub query_templates: std::vec::Vec<crate::model::QueryTemplate>,
838
839 pub next_page_token: std::string::String,
841
842 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
843}
844
845impl ListQueryTemplatesResponse {
846 pub fn new() -> Self {
847 std::default::Default::default()
848 }
849
850 pub fn set_query_templates<T, V>(mut self, v: T) -> Self
852 where
853 T: std::iter::IntoIterator<Item = V>,
854 V: std::convert::Into<crate::model::QueryTemplate>,
855 {
856 use std::iter::Iterator;
857 self.query_templates = v.into_iter().map(|i| i.into()).collect();
858 self
859 }
860
861 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
863 self.next_page_token = v.into();
864 self
865 }
866}
867
868impl wkt::message::Message for ListQueryTemplatesResponse {
869 fn typename() -> &'static str {
870 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListQueryTemplatesResponse"
871 }
872}
873
874#[doc(hidden)]
875impl gax::paginator::internal::PageableResponse for ListQueryTemplatesResponse {
876 type PageItem = crate::model::QueryTemplate;
877
878 fn items(self) -> std::vec::Vec<Self::PageItem> {
879 self.query_templates
880 }
881
882 fn next_page_token(&self) -> std::string::String {
883 use std::clone::Clone;
884 self.next_page_token.clone()
885 }
886}
887
888#[derive(Clone, Default, PartialEq)]
890#[non_exhaustive]
891pub struct UpdateQueryTemplateRequest {
892 pub update_mask: std::option::Option<wkt::FieldMask>,
896
897 pub query_template: std::option::Option<crate::model::QueryTemplate>,
899
900 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
901}
902
903impl UpdateQueryTemplateRequest {
904 pub fn new() -> Self {
905 std::default::Default::default()
906 }
907
908 pub fn set_update_mask<T>(mut self, v: T) -> Self
910 where
911 T: std::convert::Into<wkt::FieldMask>,
912 {
913 self.update_mask = std::option::Option::Some(v.into());
914 self
915 }
916
917 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
919 where
920 T: std::convert::Into<wkt::FieldMask>,
921 {
922 self.update_mask = v.map(|x| x.into());
923 self
924 }
925
926 pub fn set_query_template<T>(mut self, v: T) -> Self
928 where
929 T: std::convert::Into<crate::model::QueryTemplate>,
930 {
931 self.query_template = std::option::Option::Some(v.into());
932 self
933 }
934
935 pub fn set_or_clear_query_template<T>(mut self, v: std::option::Option<T>) -> Self
937 where
938 T: std::convert::Into<crate::model::QueryTemplate>,
939 {
940 self.query_template = v.map(|x| x.into());
941 self
942 }
943}
944
945impl wkt::message::Message for UpdateQueryTemplateRequest {
946 fn typename() -> &'static str {
947 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateQueryTemplateRequest"
948 }
949}
950
951#[derive(Clone, Default, PartialEq)]
953#[non_exhaustive]
954pub struct DeleteQueryTemplateRequest {
955 pub name: std::string::String,
959
960 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
961}
962
963impl DeleteQueryTemplateRequest {
964 pub fn new() -> Self {
965 std::default::Default::default()
966 }
967
968 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
970 self.name = v.into();
971 self
972 }
973}
974
975impl wkt::message::Message for DeleteQueryTemplateRequest {
976 fn typename() -> &'static str {
977 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteQueryTemplateRequest"
978 }
979}
980
981#[derive(Clone, Default, PartialEq)]
983#[non_exhaustive]
984pub struct SubmitQueryTemplateRequest {
985 pub name: std::string::String,
989
990 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
991}
992
993impl SubmitQueryTemplateRequest {
994 pub fn new() -> Self {
995 std::default::Default::default()
996 }
997
998 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1000 self.name = v.into();
1001 self
1002 }
1003}
1004
1005impl wkt::message::Message for SubmitQueryTemplateRequest {
1006 fn typename() -> &'static str {
1007 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubmitQueryTemplateRequest"
1008 }
1009}
1010
1011#[derive(Clone, Default, PartialEq)]
1013#[non_exhaustive]
1014pub struct ApproveQueryTemplateRequest {
1015 pub name: std::string::String,
1019
1020 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1021}
1022
1023impl ApproveQueryTemplateRequest {
1024 pub fn new() -> Self {
1025 std::default::Default::default()
1026 }
1027
1028 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1030 self.name = v.into();
1031 self
1032 }
1033}
1034
1035impl wkt::message::Message for ApproveQueryTemplateRequest {
1036 fn typename() -> &'static str {
1037 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ApproveQueryTemplateRequest"
1038 }
1039}
1040
1041#[derive(Clone, Default, PartialEq)]
1044#[non_exhaustive]
1045pub struct SharingEnvironmentConfig {
1046 pub environment: std::option::Option<crate::model::sharing_environment_config::Environment>,
1047
1048 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1049}
1050
1051impl SharingEnvironmentConfig {
1052 pub fn new() -> Self {
1053 std::default::Default::default()
1054 }
1055
1056 pub fn set_environment<
1061 T: std::convert::Into<
1062 std::option::Option<crate::model::sharing_environment_config::Environment>,
1063 >,
1064 >(
1065 mut self,
1066 v: T,
1067 ) -> Self {
1068 self.environment = v.into();
1069 self
1070 }
1071
1072 pub fn default_exchange_config(
1076 &self,
1077 ) -> std::option::Option<
1078 &std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1079 > {
1080 #[allow(unreachable_patterns)]
1081 self.environment.as_ref().and_then(|v| match v {
1082 crate::model::sharing_environment_config::Environment::DefaultExchangeConfig(v) => {
1083 std::option::Option::Some(v)
1084 }
1085 _ => std::option::Option::None,
1086 })
1087 }
1088
1089 pub fn set_default_exchange_config<
1095 T: std::convert::Into<
1096 std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1097 >,
1098 >(
1099 mut self,
1100 v: T,
1101 ) -> Self {
1102 self.environment = std::option::Option::Some(
1103 crate::model::sharing_environment_config::Environment::DefaultExchangeConfig(v.into()),
1104 );
1105 self
1106 }
1107
1108 pub fn dcr_exchange_config(
1112 &self,
1113 ) -> std::option::Option<
1114 &std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1115 > {
1116 #[allow(unreachable_patterns)]
1117 self.environment.as_ref().and_then(|v| match v {
1118 crate::model::sharing_environment_config::Environment::DcrExchangeConfig(v) => {
1119 std::option::Option::Some(v)
1120 }
1121 _ => std::option::Option::None,
1122 })
1123 }
1124
1125 pub fn set_dcr_exchange_config<
1131 T: std::convert::Into<
1132 std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1133 >,
1134 >(
1135 mut self,
1136 v: T,
1137 ) -> Self {
1138 self.environment = std::option::Option::Some(
1139 crate::model::sharing_environment_config::Environment::DcrExchangeConfig(v.into()),
1140 );
1141 self
1142 }
1143}
1144
1145impl wkt::message::Message for SharingEnvironmentConfig {
1146 fn typename() -> &'static str {
1147 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig"
1148 }
1149}
1150
1151pub mod sharing_environment_config {
1153 #[allow(unused_imports)]
1154 use super::*;
1155
1156 #[derive(Clone, Default, PartialEq)]
1158 #[non_exhaustive]
1159 pub struct DefaultExchangeConfig {
1160 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1161 }
1162
1163 impl DefaultExchangeConfig {
1164 pub fn new() -> Self {
1165 std::default::Default::default()
1166 }
1167 }
1168
1169 impl wkt::message::Message for DefaultExchangeConfig {
1170 fn typename() -> &'static str {
1171 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DefaultExchangeConfig"
1172 }
1173 }
1174
1175 #[derive(Clone, Default, PartialEq)]
1177 #[non_exhaustive]
1178 pub struct DcrExchangeConfig {
1179 pub single_selected_resource_sharing_restriction: std::option::Option<bool>,
1186
1187 pub single_linked_dataset_per_cleanroom: std::option::Option<bool>,
1193
1194 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1195 }
1196
1197 impl DcrExchangeConfig {
1198 pub fn new() -> Self {
1199 std::default::Default::default()
1200 }
1201
1202 pub fn set_single_selected_resource_sharing_restriction<T>(mut self, v: T) -> Self
1204 where
1205 T: std::convert::Into<bool>,
1206 {
1207 self.single_selected_resource_sharing_restriction = std::option::Option::Some(v.into());
1208 self
1209 }
1210
1211 pub fn set_or_clear_single_selected_resource_sharing_restriction<T>(
1213 mut self,
1214 v: std::option::Option<T>,
1215 ) -> Self
1216 where
1217 T: std::convert::Into<bool>,
1218 {
1219 self.single_selected_resource_sharing_restriction = v.map(|x| x.into());
1220 self
1221 }
1222
1223 pub fn set_single_linked_dataset_per_cleanroom<T>(mut self, v: T) -> Self
1225 where
1226 T: std::convert::Into<bool>,
1227 {
1228 self.single_linked_dataset_per_cleanroom = std::option::Option::Some(v.into());
1229 self
1230 }
1231
1232 pub fn set_or_clear_single_linked_dataset_per_cleanroom<T>(
1234 mut self,
1235 v: std::option::Option<T>,
1236 ) -> Self
1237 where
1238 T: std::convert::Into<bool>,
1239 {
1240 self.single_linked_dataset_per_cleanroom = v.map(|x| x.into());
1241 self
1242 }
1243 }
1244
1245 impl wkt::message::Message for DcrExchangeConfig {
1246 fn typename() -> &'static str {
1247 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DcrExchangeConfig"
1248 }
1249 }
1250
1251 #[derive(Clone, Debug, PartialEq)]
1252 #[non_exhaustive]
1253 pub enum Environment {
1254 DefaultExchangeConfig(
1256 std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1257 ),
1258 DcrExchangeConfig(
1260 std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1261 ),
1262 }
1263}
1264
1265#[derive(Clone, Default, PartialEq)]
1267#[non_exhaustive]
1268pub struct DataProvider {
1269 pub name: std::string::String,
1271
1272 pub primary_contact: std::string::String,
1275
1276 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1277}
1278
1279impl DataProvider {
1280 pub fn new() -> Self {
1281 std::default::Default::default()
1282 }
1283
1284 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1286 self.name = v.into();
1287 self
1288 }
1289
1290 pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1292 self.primary_contact = v.into();
1293 self
1294 }
1295}
1296
1297impl wkt::message::Message for DataProvider {
1298 fn typename() -> &'static str {
1299 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DataProvider"
1300 }
1301}
1302
1303#[derive(Clone, Default, PartialEq)]
1305#[non_exhaustive]
1306pub struct Publisher {
1307 pub name: std::string::String,
1309
1310 pub primary_contact: std::string::String,
1313
1314 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1315}
1316
1317impl Publisher {
1318 pub fn new() -> Self {
1319 std::default::Default::default()
1320 }
1321
1322 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1324 self.name = v.into();
1325 self
1326 }
1327
1328 pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1330 self.primary_contact = v.into();
1331 self
1332 }
1333}
1334
1335impl wkt::message::Message for Publisher {
1336 fn typename() -> &'static str {
1337 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Publisher"
1338 }
1339}
1340
1341#[derive(Clone, Default, PartialEq)]
1342#[non_exhaustive]
1343pub struct DestinationDatasetReference {
1344 pub dataset_id: std::string::String,
1348
1349 pub project_id: std::string::String,
1351
1352 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1353}
1354
1355impl DestinationDatasetReference {
1356 pub fn new() -> Self {
1357 std::default::Default::default()
1358 }
1359
1360 pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1362 self.dataset_id = v.into();
1363 self
1364 }
1365
1366 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1368 self.project_id = v.into();
1369 self
1370 }
1371}
1372
1373impl wkt::message::Message for DestinationDatasetReference {
1374 fn typename() -> &'static str {
1375 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference"
1376 }
1377}
1378
1379#[derive(Clone, Default, PartialEq)]
1381#[non_exhaustive]
1382pub struct DestinationDataset {
1383 pub dataset_reference: std::option::Option<crate::model::DestinationDatasetReference>,
1385
1386 pub friendly_name: std::option::Option<wkt::StringValue>,
1388
1389 pub description: std::option::Option<wkt::StringValue>,
1391
1392 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1398
1399 pub location: std::string::String,
1403
1404 pub replica_locations: std::vec::Vec<std::string::String>,
1408
1409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1410}
1411
1412impl DestinationDataset {
1413 pub fn new() -> Self {
1414 std::default::Default::default()
1415 }
1416
1417 pub fn set_dataset_reference<T>(mut self, v: T) -> Self
1419 where
1420 T: std::convert::Into<crate::model::DestinationDatasetReference>,
1421 {
1422 self.dataset_reference = std::option::Option::Some(v.into());
1423 self
1424 }
1425
1426 pub fn set_or_clear_dataset_reference<T>(mut self, v: std::option::Option<T>) -> Self
1428 where
1429 T: std::convert::Into<crate::model::DestinationDatasetReference>,
1430 {
1431 self.dataset_reference = v.map(|x| x.into());
1432 self
1433 }
1434
1435 pub fn set_friendly_name<T>(mut self, v: T) -> Self
1437 where
1438 T: std::convert::Into<wkt::StringValue>,
1439 {
1440 self.friendly_name = std::option::Option::Some(v.into());
1441 self
1442 }
1443
1444 pub fn set_or_clear_friendly_name<T>(mut self, v: std::option::Option<T>) -> Self
1446 where
1447 T: std::convert::Into<wkt::StringValue>,
1448 {
1449 self.friendly_name = v.map(|x| x.into());
1450 self
1451 }
1452
1453 pub fn set_description<T>(mut self, v: T) -> Self
1455 where
1456 T: std::convert::Into<wkt::StringValue>,
1457 {
1458 self.description = std::option::Option::Some(v.into());
1459 self
1460 }
1461
1462 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
1464 where
1465 T: std::convert::Into<wkt::StringValue>,
1466 {
1467 self.description = v.map(|x| x.into());
1468 self
1469 }
1470
1471 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1473 where
1474 T: std::iter::IntoIterator<Item = (K, V)>,
1475 K: std::convert::Into<std::string::String>,
1476 V: std::convert::Into<std::string::String>,
1477 {
1478 use std::iter::Iterator;
1479 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1480 self
1481 }
1482
1483 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1485 self.location = v.into();
1486 self
1487 }
1488
1489 pub fn set_replica_locations<T, V>(mut self, v: T) -> Self
1491 where
1492 T: std::iter::IntoIterator<Item = V>,
1493 V: std::convert::Into<std::string::String>,
1494 {
1495 use std::iter::Iterator;
1496 self.replica_locations = v.into_iter().map(|i| i.into()).collect();
1497 self
1498 }
1499}
1500
1501impl wkt::message::Message for DestinationDataset {
1502 fn typename() -> &'static str {
1503 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationDataset"
1504 }
1505}
1506
1507#[derive(Clone, Default, PartialEq)]
1509#[non_exhaustive]
1510pub struct DestinationPubSubSubscription {
1511 pub pubsub_subscription: std::option::Option<crate::model::PubSubSubscription>,
1513
1514 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1515}
1516
1517impl DestinationPubSubSubscription {
1518 pub fn new() -> Self {
1519 std::default::Default::default()
1520 }
1521
1522 pub fn set_pubsub_subscription<T>(mut self, v: T) -> Self
1524 where
1525 T: std::convert::Into<crate::model::PubSubSubscription>,
1526 {
1527 self.pubsub_subscription = std::option::Option::Some(v.into());
1528 self
1529 }
1530
1531 pub fn set_or_clear_pubsub_subscription<T>(mut self, v: std::option::Option<T>) -> Self
1533 where
1534 T: std::convert::Into<crate::model::PubSubSubscription>,
1535 {
1536 self.pubsub_subscription = v.map(|x| x.into());
1537 self
1538 }
1539}
1540
1541impl wkt::message::Message for DestinationPubSubSubscription {
1542 fn typename() -> &'static str {
1543 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationPubSubSubscription"
1544 }
1545}
1546
1547#[derive(Clone, Default, PartialEq)]
1552#[non_exhaustive]
1553pub struct Listing {
1554 pub name: std::string::String,
1557
1558 pub display_name: std::string::String,
1563
1564 pub description: std::string::String,
1569
1570 pub primary_contact: std::string::String,
1573
1574 pub documentation: std::string::String,
1576
1577 pub state: crate::model::listing::State,
1579
1580 pub icon: ::bytes::Bytes,
1586
1587 pub data_provider: std::option::Option<crate::model::DataProvider>,
1589
1590 pub categories: std::vec::Vec<crate::model::listing::Category>,
1592
1593 pub publisher: std::option::Option<crate::model::Publisher>,
1596
1597 pub request_access: std::string::String,
1601
1602 pub restricted_export_config:
1605 std::option::Option<crate::model::listing::RestrictedExportConfig>,
1606
1607 pub stored_procedure_config: std::option::Option<crate::model::StoredProcedureConfig>,
1610
1611 pub discovery_type: std::option::Option<crate::model::DiscoveryType>,
1613
1614 pub resource_type: crate::model::SharedResourceType,
1616
1617 pub commercial_info: std::option::Option<crate::model::listing::CommercialInfo>,
1620
1621 pub log_linked_dataset_query_user_email: std::option::Option<bool>,
1624
1625 pub allow_only_metadata_sharing: std::option::Option<bool>,
1628
1629 pub source: std::option::Option<crate::model::listing::Source>,
1631
1632 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1633}
1634
1635impl Listing {
1636 pub fn new() -> Self {
1637 std::default::Default::default()
1638 }
1639
1640 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1642 self.name = v.into();
1643 self
1644 }
1645
1646 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1648 self.display_name = v.into();
1649 self
1650 }
1651
1652 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1654 self.description = v.into();
1655 self
1656 }
1657
1658 pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1660 self.primary_contact = v.into();
1661 self
1662 }
1663
1664 pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1666 self.documentation = v.into();
1667 self
1668 }
1669
1670 pub fn set_state<T: std::convert::Into<crate::model::listing::State>>(mut self, v: T) -> Self {
1672 self.state = v.into();
1673 self
1674 }
1675
1676 pub fn set_icon<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1678 self.icon = v.into();
1679 self
1680 }
1681
1682 pub fn set_data_provider<T>(mut self, v: T) -> Self
1684 where
1685 T: std::convert::Into<crate::model::DataProvider>,
1686 {
1687 self.data_provider = std::option::Option::Some(v.into());
1688 self
1689 }
1690
1691 pub fn set_or_clear_data_provider<T>(mut self, v: std::option::Option<T>) -> Self
1693 where
1694 T: std::convert::Into<crate::model::DataProvider>,
1695 {
1696 self.data_provider = v.map(|x| x.into());
1697 self
1698 }
1699
1700 pub fn set_categories<T, V>(mut self, v: T) -> Self
1702 where
1703 T: std::iter::IntoIterator<Item = V>,
1704 V: std::convert::Into<crate::model::listing::Category>,
1705 {
1706 use std::iter::Iterator;
1707 self.categories = v.into_iter().map(|i| i.into()).collect();
1708 self
1709 }
1710
1711 pub fn set_publisher<T>(mut self, v: T) -> Self
1713 where
1714 T: std::convert::Into<crate::model::Publisher>,
1715 {
1716 self.publisher = std::option::Option::Some(v.into());
1717 self
1718 }
1719
1720 pub fn set_or_clear_publisher<T>(mut self, v: std::option::Option<T>) -> Self
1722 where
1723 T: std::convert::Into<crate::model::Publisher>,
1724 {
1725 self.publisher = v.map(|x| x.into());
1726 self
1727 }
1728
1729 pub fn set_request_access<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1731 self.request_access = v.into();
1732 self
1733 }
1734
1735 pub fn set_restricted_export_config<T>(mut self, v: T) -> Self
1737 where
1738 T: std::convert::Into<crate::model::listing::RestrictedExportConfig>,
1739 {
1740 self.restricted_export_config = std::option::Option::Some(v.into());
1741 self
1742 }
1743
1744 pub fn set_or_clear_restricted_export_config<T>(mut self, v: std::option::Option<T>) -> Self
1746 where
1747 T: std::convert::Into<crate::model::listing::RestrictedExportConfig>,
1748 {
1749 self.restricted_export_config = v.map(|x| x.into());
1750 self
1751 }
1752
1753 pub fn set_stored_procedure_config<T>(mut self, v: T) -> Self
1755 where
1756 T: std::convert::Into<crate::model::StoredProcedureConfig>,
1757 {
1758 self.stored_procedure_config = std::option::Option::Some(v.into());
1759 self
1760 }
1761
1762 pub fn set_or_clear_stored_procedure_config<T>(mut self, v: std::option::Option<T>) -> Self
1764 where
1765 T: std::convert::Into<crate::model::StoredProcedureConfig>,
1766 {
1767 self.stored_procedure_config = v.map(|x| x.into());
1768 self
1769 }
1770
1771 pub fn set_discovery_type<T>(mut self, v: T) -> Self
1773 where
1774 T: std::convert::Into<crate::model::DiscoveryType>,
1775 {
1776 self.discovery_type = std::option::Option::Some(v.into());
1777 self
1778 }
1779
1780 pub fn set_or_clear_discovery_type<T>(mut self, v: std::option::Option<T>) -> Self
1782 where
1783 T: std::convert::Into<crate::model::DiscoveryType>,
1784 {
1785 self.discovery_type = v.map(|x| x.into());
1786 self
1787 }
1788
1789 pub fn set_resource_type<T: std::convert::Into<crate::model::SharedResourceType>>(
1791 mut self,
1792 v: T,
1793 ) -> Self {
1794 self.resource_type = v.into();
1795 self
1796 }
1797
1798 pub fn set_commercial_info<T>(mut self, v: T) -> Self
1800 where
1801 T: std::convert::Into<crate::model::listing::CommercialInfo>,
1802 {
1803 self.commercial_info = std::option::Option::Some(v.into());
1804 self
1805 }
1806
1807 pub fn set_or_clear_commercial_info<T>(mut self, v: std::option::Option<T>) -> Self
1809 where
1810 T: std::convert::Into<crate::model::listing::CommercialInfo>,
1811 {
1812 self.commercial_info = v.map(|x| x.into());
1813 self
1814 }
1815
1816 pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
1818 where
1819 T: std::convert::Into<bool>,
1820 {
1821 self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
1822 self
1823 }
1824
1825 pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
1827 mut self,
1828 v: std::option::Option<T>,
1829 ) -> Self
1830 where
1831 T: std::convert::Into<bool>,
1832 {
1833 self.log_linked_dataset_query_user_email = v.map(|x| x.into());
1834 self
1835 }
1836
1837 pub fn set_allow_only_metadata_sharing<T>(mut self, v: T) -> Self
1839 where
1840 T: std::convert::Into<bool>,
1841 {
1842 self.allow_only_metadata_sharing = std::option::Option::Some(v.into());
1843 self
1844 }
1845
1846 pub fn set_or_clear_allow_only_metadata_sharing<T>(mut self, v: std::option::Option<T>) -> Self
1848 where
1849 T: std::convert::Into<bool>,
1850 {
1851 self.allow_only_metadata_sharing = v.map(|x| x.into());
1852 self
1853 }
1854
1855 pub fn set_source<T: std::convert::Into<std::option::Option<crate::model::listing::Source>>>(
1860 mut self,
1861 v: T,
1862 ) -> Self {
1863 self.source = v.into();
1864 self
1865 }
1866
1867 pub fn bigquery_dataset(
1871 &self,
1872 ) -> std::option::Option<&std::boxed::Box<crate::model::listing::BigQueryDatasetSource>> {
1873 #[allow(unreachable_patterns)]
1874 self.source.as_ref().and_then(|v| match v {
1875 crate::model::listing::Source::BigqueryDataset(v) => std::option::Option::Some(v),
1876 _ => std::option::Option::None,
1877 })
1878 }
1879
1880 pub fn set_bigquery_dataset<
1886 T: std::convert::Into<std::boxed::Box<crate::model::listing::BigQueryDatasetSource>>,
1887 >(
1888 mut self,
1889 v: T,
1890 ) -> Self {
1891 self.source =
1892 std::option::Option::Some(crate::model::listing::Source::BigqueryDataset(v.into()));
1893 self
1894 }
1895
1896 pub fn pubsub_topic(
1900 &self,
1901 ) -> std::option::Option<&std::boxed::Box<crate::model::listing::PubSubTopicSource>> {
1902 #[allow(unreachable_patterns)]
1903 self.source.as_ref().and_then(|v| match v {
1904 crate::model::listing::Source::PubsubTopic(v) => std::option::Option::Some(v),
1905 _ => std::option::Option::None,
1906 })
1907 }
1908
1909 pub fn set_pubsub_topic<
1915 T: std::convert::Into<std::boxed::Box<crate::model::listing::PubSubTopicSource>>,
1916 >(
1917 mut self,
1918 v: T,
1919 ) -> Self {
1920 self.source =
1921 std::option::Option::Some(crate::model::listing::Source::PubsubTopic(v.into()));
1922 self
1923 }
1924}
1925
1926impl wkt::message::Message for Listing {
1927 fn typename() -> &'static str {
1928 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing"
1929 }
1930}
1931
1932pub mod listing {
1934 #[allow(unused_imports)]
1935 use super::*;
1936
1937 #[derive(Clone, Default, PartialEq)]
1945 #[non_exhaustive]
1946 pub struct BigQueryDatasetSource {
1947 pub dataset: std::string::String,
1950
1951 pub selected_resources:
1954 std::vec::Vec<crate::model::listing::big_query_dataset_source::SelectedResource>,
1955
1956 pub restricted_export_policy: std::option::Option<
1959 crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
1960 >,
1961
1962 pub replica_locations: std::vec::Vec<std::string::String>,
1965
1966 pub effective_replicas:
1971 std::vec::Vec<crate::model::listing::big_query_dataset_source::Replica>,
1972
1973 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1974 }
1975
1976 impl BigQueryDatasetSource {
1977 pub fn new() -> Self {
1978 std::default::Default::default()
1979 }
1980
1981 pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1983 self.dataset = v.into();
1984 self
1985 }
1986
1987 pub fn set_selected_resources<T, V>(mut self, v: T) -> Self
1989 where
1990 T: std::iter::IntoIterator<Item = V>,
1991 V: std::convert::Into<
1992 crate::model::listing::big_query_dataset_source::SelectedResource,
1993 >,
1994 {
1995 use std::iter::Iterator;
1996 self.selected_resources = v.into_iter().map(|i| i.into()).collect();
1997 self
1998 }
1999
2000 pub fn set_restricted_export_policy<T>(mut self, v: T) -> Self
2002 where
2003 T: std::convert::Into<
2004 crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2005 >,
2006 {
2007 self.restricted_export_policy = std::option::Option::Some(v.into());
2008 self
2009 }
2010
2011 pub fn set_or_clear_restricted_export_policy<T>(mut self, v: std::option::Option<T>) -> Self
2013 where
2014 T: std::convert::Into<
2015 crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2016 >,
2017 {
2018 self.restricted_export_policy = v.map(|x| x.into());
2019 self
2020 }
2021
2022 pub fn set_replica_locations<T, V>(mut self, v: T) -> Self
2024 where
2025 T: std::iter::IntoIterator<Item = V>,
2026 V: std::convert::Into<std::string::String>,
2027 {
2028 use std::iter::Iterator;
2029 self.replica_locations = v.into_iter().map(|i| i.into()).collect();
2030 self
2031 }
2032
2033 pub fn set_effective_replicas<T, V>(mut self, v: T) -> Self
2035 where
2036 T: std::iter::IntoIterator<Item = V>,
2037 V: std::convert::Into<crate::model::listing::big_query_dataset_source::Replica>,
2038 {
2039 use std::iter::Iterator;
2040 self.effective_replicas = v.into_iter().map(|i| i.into()).collect();
2041 self
2042 }
2043 }
2044
2045 impl wkt::message::Message for BigQueryDatasetSource {
2046 fn typename() -> &'static str {
2047 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource"
2048 }
2049 }
2050
2051 pub mod big_query_dataset_source {
2053 #[allow(unused_imports)]
2054 use super::*;
2055
2056 #[derive(Clone, Default, PartialEq)]
2058 #[non_exhaustive]
2059 pub struct SelectedResource {
2060 pub resource: std::option::Option<
2061 crate::model::listing::big_query_dataset_source::selected_resource::Resource,
2062 >,
2063
2064 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2065 }
2066
2067 impl SelectedResource {
2068 pub fn new() -> Self {
2069 std::default::Default::default()
2070 }
2071
2072 pub fn set_resource<T: std::convert::Into<std::option::Option<crate::model::listing::big_query_dataset_source::selected_resource::Resource>>>(mut self, v: T) -> Self
2077 {
2078 self.resource = v.into();
2079 self
2080 }
2081
2082 pub fn table(&self) -> std::option::Option<&std::string::String> {
2086 #[allow(unreachable_patterns)]
2087 self.resource.as_ref().and_then(|v| match v {
2088 crate::model::listing::big_query_dataset_source::selected_resource::Resource::Table(v) => std::option::Option::Some(v),
2089 _ => std::option::Option::None,
2090 })
2091 }
2092
2093 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2099 self.resource = std::option::Option::Some(
2100 crate::model::listing::big_query_dataset_source::selected_resource::Resource::Table(
2101 v.into()
2102 )
2103 );
2104 self
2105 }
2106
2107 pub fn routine(&self) -> std::option::Option<&std::string::String> {
2111 #[allow(unreachable_patterns)]
2112 self.resource.as_ref().and_then(|v| match v {
2113 crate::model::listing::big_query_dataset_source::selected_resource::Resource::Routine(v) => std::option::Option::Some(v),
2114 _ => std::option::Option::None,
2115 })
2116 }
2117
2118 pub fn set_routine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2124 self.resource = std::option::Option::Some(
2125 crate::model::listing::big_query_dataset_source::selected_resource::Resource::Routine(
2126 v.into()
2127 )
2128 );
2129 self
2130 }
2131 }
2132
2133 impl wkt::message::Message for SelectedResource {
2134 fn typename() -> &'static str {
2135 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.SelectedResource"
2136 }
2137 }
2138
2139 pub mod selected_resource {
2141 #[allow(unused_imports)]
2142 use super::*;
2143
2144 #[derive(Clone, Debug, PartialEq)]
2145 #[non_exhaustive]
2146 pub enum Resource {
2147 Table(std::string::String),
2152 Routine(std::string::String),
2157 }
2158 }
2159
2160 #[derive(Clone, Default, PartialEq)]
2163 #[non_exhaustive]
2164 pub struct RestrictedExportPolicy {
2165 pub enabled: std::option::Option<wkt::BoolValue>,
2167
2168 pub restrict_direct_table_access: std::option::Option<wkt::BoolValue>,
2171
2172 pub restrict_query_result: std::option::Option<wkt::BoolValue>,
2175
2176 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2177 }
2178
2179 impl RestrictedExportPolicy {
2180 pub fn new() -> Self {
2181 std::default::Default::default()
2182 }
2183
2184 pub fn set_enabled<T>(mut self, v: T) -> Self
2186 where
2187 T: std::convert::Into<wkt::BoolValue>,
2188 {
2189 self.enabled = std::option::Option::Some(v.into());
2190 self
2191 }
2192
2193 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
2195 where
2196 T: std::convert::Into<wkt::BoolValue>,
2197 {
2198 self.enabled = v.map(|x| x.into());
2199 self
2200 }
2201
2202 pub fn set_restrict_direct_table_access<T>(mut self, v: T) -> Self
2204 where
2205 T: std::convert::Into<wkt::BoolValue>,
2206 {
2207 self.restrict_direct_table_access = std::option::Option::Some(v.into());
2208 self
2209 }
2210
2211 pub fn set_or_clear_restrict_direct_table_access<T>(
2213 mut self,
2214 v: std::option::Option<T>,
2215 ) -> Self
2216 where
2217 T: std::convert::Into<wkt::BoolValue>,
2218 {
2219 self.restrict_direct_table_access = v.map(|x| x.into());
2220 self
2221 }
2222
2223 pub fn set_restrict_query_result<T>(mut self, v: T) -> Self
2225 where
2226 T: std::convert::Into<wkt::BoolValue>,
2227 {
2228 self.restrict_query_result = std::option::Option::Some(v.into());
2229 self
2230 }
2231
2232 pub fn set_or_clear_restrict_query_result<T>(
2234 mut self,
2235 v: std::option::Option<T>,
2236 ) -> Self
2237 where
2238 T: std::convert::Into<wkt::BoolValue>,
2239 {
2240 self.restrict_query_result = v.map(|x| x.into());
2241 self
2242 }
2243 }
2244
2245 impl wkt::message::Message for RestrictedExportPolicy {
2246 fn typename() -> &'static str {
2247 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.RestrictedExportPolicy"
2248 }
2249 }
2250
2251 #[derive(Clone, Default, PartialEq)]
2256 #[non_exhaustive]
2257 pub struct Replica {
2258 pub location: std::string::String,
2262
2263 pub replica_state:
2266 crate::model::listing::big_query_dataset_source::replica::ReplicaState,
2267
2268 pub primary_state: std::option::Option<
2270 crate::model::listing::big_query_dataset_source::replica::PrimaryState,
2271 >,
2272
2273 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2274 }
2275
2276 impl Replica {
2277 pub fn new() -> Self {
2278 std::default::Default::default()
2279 }
2280
2281 pub fn set_location<T: std::convert::Into<std::string::String>>(
2283 mut self,
2284 v: T,
2285 ) -> Self {
2286 self.location = v.into();
2287 self
2288 }
2289
2290 pub fn set_replica_state<
2292 T: std::convert::Into<
2293 crate::model::listing::big_query_dataset_source::replica::ReplicaState,
2294 >,
2295 >(
2296 mut self,
2297 v: T,
2298 ) -> Self {
2299 self.replica_state = v.into();
2300 self
2301 }
2302
2303 pub fn set_primary_state<T>(mut self, v: T) -> Self
2305 where
2306 T: std::convert::Into<
2307 crate::model::listing::big_query_dataset_source::replica::PrimaryState,
2308 >,
2309 {
2310 self.primary_state = std::option::Option::Some(v.into());
2311 self
2312 }
2313
2314 pub fn set_or_clear_primary_state<T>(mut self, v: std::option::Option<T>) -> Self
2316 where
2317 T: std::convert::Into<
2318 crate::model::listing::big_query_dataset_source::replica::PrimaryState,
2319 >,
2320 {
2321 self.primary_state = v.map(|x| x.into());
2322 self
2323 }
2324 }
2325
2326 impl wkt::message::Message for Replica {
2327 fn typename() -> &'static str {
2328 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica"
2329 }
2330 }
2331
2332 pub mod replica {
2334 #[allow(unused_imports)]
2335 use super::*;
2336
2337 #[derive(Clone, Debug, PartialEq)]
2353 #[non_exhaustive]
2354 pub enum ReplicaState {
2355 Unspecified,
2357 ReadyToUse,
2359 Unavailable,
2362 UnknownValue(replica_state::UnknownValue),
2367 }
2368
2369 #[doc(hidden)]
2370 pub mod replica_state {
2371 #[allow(unused_imports)]
2372 use super::*;
2373 #[derive(Clone, Debug, PartialEq)]
2374 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2375 }
2376
2377 impl ReplicaState {
2378 pub fn value(&self) -> std::option::Option<i32> {
2383 match self {
2384 Self::Unspecified => std::option::Option::Some(0),
2385 Self::ReadyToUse => std::option::Option::Some(1),
2386 Self::Unavailable => std::option::Option::Some(2),
2387 Self::UnknownValue(u) => u.0.value(),
2388 }
2389 }
2390
2391 pub fn name(&self) -> std::option::Option<&str> {
2396 match self {
2397 Self::Unspecified => std::option::Option::Some("REPLICA_STATE_UNSPECIFIED"),
2398 Self::ReadyToUse => std::option::Option::Some("READY_TO_USE"),
2399 Self::Unavailable => std::option::Option::Some("UNAVAILABLE"),
2400 Self::UnknownValue(u) => u.0.name(),
2401 }
2402 }
2403 }
2404
2405 impl std::default::Default for ReplicaState {
2406 fn default() -> Self {
2407 use std::convert::From;
2408 Self::from(0)
2409 }
2410 }
2411
2412 impl std::fmt::Display for ReplicaState {
2413 fn fmt(
2414 &self,
2415 f: &mut std::fmt::Formatter<'_>,
2416 ) -> std::result::Result<(), std::fmt::Error> {
2417 wkt::internal::display_enum(f, self.name(), self.value())
2418 }
2419 }
2420
2421 impl std::convert::From<i32> for ReplicaState {
2422 fn from(value: i32) -> Self {
2423 match value {
2424 0 => Self::Unspecified,
2425 1 => Self::ReadyToUse,
2426 2 => Self::Unavailable,
2427 _ => Self::UnknownValue(replica_state::UnknownValue(
2428 wkt::internal::UnknownEnumValue::Integer(value),
2429 )),
2430 }
2431 }
2432 }
2433
2434 impl std::convert::From<&str> for ReplicaState {
2435 fn from(value: &str) -> Self {
2436 use std::string::ToString;
2437 match value {
2438 "REPLICA_STATE_UNSPECIFIED" => Self::Unspecified,
2439 "READY_TO_USE" => Self::ReadyToUse,
2440 "UNAVAILABLE" => Self::Unavailable,
2441 _ => Self::UnknownValue(replica_state::UnknownValue(
2442 wkt::internal::UnknownEnumValue::String(value.to_string()),
2443 )),
2444 }
2445 }
2446 }
2447
2448 impl serde::ser::Serialize for ReplicaState {
2449 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2450 where
2451 S: serde::Serializer,
2452 {
2453 match self {
2454 Self::Unspecified => serializer.serialize_i32(0),
2455 Self::ReadyToUse => serializer.serialize_i32(1),
2456 Self::Unavailable => serializer.serialize_i32(2),
2457 Self::UnknownValue(u) => u.0.serialize(serializer),
2458 }
2459 }
2460 }
2461
2462 impl<'de> serde::de::Deserialize<'de> for ReplicaState {
2463 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2464 where
2465 D: serde::Deserializer<'de>,
2466 {
2467 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicaState>::new(
2468 ".google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.ReplicaState"))
2469 }
2470 }
2471
2472 #[derive(Clone, Debug, PartialEq)]
2488 #[non_exhaustive]
2489 pub enum PrimaryState {
2490 Unspecified,
2492 PrimaryReplica,
2494 UnknownValue(primary_state::UnknownValue),
2499 }
2500
2501 #[doc(hidden)]
2502 pub mod primary_state {
2503 #[allow(unused_imports)]
2504 use super::*;
2505 #[derive(Clone, Debug, PartialEq)]
2506 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2507 }
2508
2509 impl PrimaryState {
2510 pub fn value(&self) -> std::option::Option<i32> {
2515 match self {
2516 Self::Unspecified => std::option::Option::Some(0),
2517 Self::PrimaryReplica => std::option::Option::Some(1),
2518 Self::UnknownValue(u) => u.0.value(),
2519 }
2520 }
2521
2522 pub fn name(&self) -> std::option::Option<&str> {
2527 match self {
2528 Self::Unspecified => std::option::Option::Some("PRIMARY_STATE_UNSPECIFIED"),
2529 Self::PrimaryReplica => std::option::Option::Some("PRIMARY_REPLICA"),
2530 Self::UnknownValue(u) => u.0.name(),
2531 }
2532 }
2533 }
2534
2535 impl std::default::Default for PrimaryState {
2536 fn default() -> Self {
2537 use std::convert::From;
2538 Self::from(0)
2539 }
2540 }
2541
2542 impl std::fmt::Display for PrimaryState {
2543 fn fmt(
2544 &self,
2545 f: &mut std::fmt::Formatter<'_>,
2546 ) -> std::result::Result<(), std::fmt::Error> {
2547 wkt::internal::display_enum(f, self.name(), self.value())
2548 }
2549 }
2550
2551 impl std::convert::From<i32> for PrimaryState {
2552 fn from(value: i32) -> Self {
2553 match value {
2554 0 => Self::Unspecified,
2555 1 => Self::PrimaryReplica,
2556 _ => Self::UnknownValue(primary_state::UnknownValue(
2557 wkt::internal::UnknownEnumValue::Integer(value),
2558 )),
2559 }
2560 }
2561 }
2562
2563 impl std::convert::From<&str> for PrimaryState {
2564 fn from(value: &str) -> Self {
2565 use std::string::ToString;
2566 match value {
2567 "PRIMARY_STATE_UNSPECIFIED" => Self::Unspecified,
2568 "PRIMARY_REPLICA" => Self::PrimaryReplica,
2569 _ => Self::UnknownValue(primary_state::UnknownValue(
2570 wkt::internal::UnknownEnumValue::String(value.to_string()),
2571 )),
2572 }
2573 }
2574 }
2575
2576 impl serde::ser::Serialize for PrimaryState {
2577 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2578 where
2579 S: serde::Serializer,
2580 {
2581 match self {
2582 Self::Unspecified => serializer.serialize_i32(0),
2583 Self::PrimaryReplica => serializer.serialize_i32(1),
2584 Self::UnknownValue(u) => u.0.serialize(serializer),
2585 }
2586 }
2587 }
2588
2589 impl<'de> serde::de::Deserialize<'de> for PrimaryState {
2590 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2591 where
2592 D: serde::Deserializer<'de>,
2593 {
2594 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrimaryState>::new(
2595 ".google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.PrimaryState"))
2596 }
2597 }
2598 }
2599 }
2600
2601 #[derive(Clone, Default, PartialEq)]
2603 #[non_exhaustive]
2604 pub struct PubSubTopicSource {
2605 pub topic: std::string::String,
2608
2609 pub data_affinity_regions: std::vec::Vec<std::string::String>,
2613
2614 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2615 }
2616
2617 impl PubSubTopicSource {
2618 pub fn new() -> Self {
2619 std::default::Default::default()
2620 }
2621
2622 pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2624 self.topic = v.into();
2625 self
2626 }
2627
2628 pub fn set_data_affinity_regions<T, V>(mut self, v: T) -> Self
2630 where
2631 T: std::iter::IntoIterator<Item = V>,
2632 V: std::convert::Into<std::string::String>,
2633 {
2634 use std::iter::Iterator;
2635 self.data_affinity_regions = v.into_iter().map(|i| i.into()).collect();
2636 self
2637 }
2638 }
2639
2640 impl wkt::message::Message for PubSubTopicSource {
2641 fn typename() -> &'static str {
2642 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.PubSubTopicSource"
2643 }
2644 }
2645
2646 #[derive(Clone, Default, PartialEq)]
2649 #[non_exhaustive]
2650 pub struct RestrictedExportConfig {
2651 pub enabled: bool,
2653
2654 pub restrict_direct_table_access: bool,
2657
2658 pub restrict_query_result: bool,
2661
2662 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2663 }
2664
2665 impl RestrictedExportConfig {
2666 pub fn new() -> Self {
2667 std::default::Default::default()
2668 }
2669
2670 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2672 self.enabled = v.into();
2673 self
2674 }
2675
2676 pub fn set_restrict_direct_table_access<T: std::convert::Into<bool>>(
2678 mut self,
2679 v: T,
2680 ) -> Self {
2681 self.restrict_direct_table_access = v.into();
2682 self
2683 }
2684
2685 pub fn set_restrict_query_result<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2687 self.restrict_query_result = v.into();
2688 self
2689 }
2690 }
2691
2692 impl wkt::message::Message for RestrictedExportConfig {
2693 fn typename() -> &'static str {
2694 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.RestrictedExportConfig"
2695 }
2696 }
2697
2698 #[derive(Clone, Default, PartialEq)]
2701 #[non_exhaustive]
2702 pub struct CommercialInfo {
2703 pub cloud_marketplace:
2706 std::option::Option<crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo>,
2707
2708 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2709 }
2710
2711 impl CommercialInfo {
2712 pub fn new() -> Self {
2713 std::default::Default::default()
2714 }
2715
2716 pub fn set_cloud_marketplace<T>(mut self, v: T) -> Self
2718 where
2719 T: std::convert::Into<
2720 crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo,
2721 >,
2722 {
2723 self.cloud_marketplace = std::option::Option::Some(v.into());
2724 self
2725 }
2726
2727 pub fn set_or_clear_cloud_marketplace<T>(mut self, v: std::option::Option<T>) -> Self
2729 where
2730 T: std::convert::Into<
2731 crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo,
2732 >,
2733 {
2734 self.cloud_marketplace = v.map(|x| x.into());
2735 self
2736 }
2737 }
2738
2739 impl wkt::message::Message for CommercialInfo {
2740 fn typename() -> &'static str {
2741 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo"
2742 }
2743 }
2744
2745 pub mod commercial_info {
2747 #[allow(unused_imports)]
2748 use super::*;
2749
2750 #[derive(Clone, Default, PartialEq)]
2753 #[non_exhaustive]
2754 pub struct GoogleCloudMarketplaceInfo {
2755
2756 pub service: std::option::Option<std::string::String>,
2759
2760 pub commercial_state: std::option::Option<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>,
2762
2763 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2764 }
2765
2766 impl GoogleCloudMarketplaceInfo {
2767 pub fn new() -> Self {
2768 std::default::Default::default()
2769 }
2770
2771 pub fn set_service<T>(mut self, v: T) -> Self
2773 where
2774 T: std::convert::Into<std::string::String>,
2775 {
2776 self.service = std::option::Option::Some(v.into());
2777 self
2778 }
2779
2780 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
2782 where
2783 T: std::convert::Into<std::string::String>,
2784 {
2785 self.service = v.map(|x| x.into());
2786 self
2787 }
2788
2789 pub fn set_commercial_state<T>(mut self, v: T) -> Self
2791 where T: std::convert::Into<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>
2792 {
2793 self.commercial_state = std::option::Option::Some(v.into());
2794 self
2795 }
2796
2797 pub fn set_or_clear_commercial_state<T>(mut self, v: std::option::Option<T>) -> Self
2799 where T: std::convert::Into<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>
2800 {
2801 self.commercial_state = v.map(|x| x.into());
2802 self
2803 }
2804 }
2805
2806 impl wkt::message::Message for GoogleCloudMarketplaceInfo {
2807 fn typename() -> &'static str {
2808 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo.GoogleCloudMarketplaceInfo"
2809 }
2810 }
2811
2812 pub mod google_cloud_marketplace_info {
2814 #[allow(unused_imports)]
2815 use super::*;
2816
2817 #[derive(Clone, Debug, PartialEq)]
2833 #[non_exhaustive]
2834 pub enum CommercialState {
2835 Unspecified,
2837 Onboarding,
2839 Active,
2841 UnknownValue(commercial_state::UnknownValue),
2846 }
2847
2848 #[doc(hidden)]
2849 pub mod commercial_state {
2850 #[allow(unused_imports)]
2851 use super::*;
2852 #[derive(Clone, Debug, PartialEq)]
2853 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2854 }
2855
2856 impl CommercialState {
2857 pub fn value(&self) -> std::option::Option<i32> {
2862 match self {
2863 Self::Unspecified => std::option::Option::Some(0),
2864 Self::Onboarding => std::option::Option::Some(1),
2865 Self::Active => std::option::Option::Some(2),
2866 Self::UnknownValue(u) => u.0.value(),
2867 }
2868 }
2869
2870 pub fn name(&self) -> std::option::Option<&str> {
2875 match self {
2876 Self::Unspecified => {
2877 std::option::Option::Some("COMMERCIAL_STATE_UNSPECIFIED")
2878 }
2879 Self::Onboarding => std::option::Option::Some("ONBOARDING"),
2880 Self::Active => std::option::Option::Some("ACTIVE"),
2881 Self::UnknownValue(u) => u.0.name(),
2882 }
2883 }
2884 }
2885
2886 impl std::default::Default for CommercialState {
2887 fn default() -> Self {
2888 use std::convert::From;
2889 Self::from(0)
2890 }
2891 }
2892
2893 impl std::fmt::Display for CommercialState {
2894 fn fmt(
2895 &self,
2896 f: &mut std::fmt::Formatter<'_>,
2897 ) -> std::result::Result<(), std::fmt::Error> {
2898 wkt::internal::display_enum(f, self.name(), self.value())
2899 }
2900 }
2901
2902 impl std::convert::From<i32> for CommercialState {
2903 fn from(value: i32) -> Self {
2904 match value {
2905 0 => Self::Unspecified,
2906 1 => Self::Onboarding,
2907 2 => Self::Active,
2908 _ => Self::UnknownValue(commercial_state::UnknownValue(
2909 wkt::internal::UnknownEnumValue::Integer(value),
2910 )),
2911 }
2912 }
2913 }
2914
2915 impl std::convert::From<&str> for CommercialState {
2916 fn from(value: &str) -> Self {
2917 use std::string::ToString;
2918 match value {
2919 "COMMERCIAL_STATE_UNSPECIFIED" => Self::Unspecified,
2920 "ONBOARDING" => Self::Onboarding,
2921 "ACTIVE" => Self::Active,
2922 _ => Self::UnknownValue(commercial_state::UnknownValue(
2923 wkt::internal::UnknownEnumValue::String(value.to_string()),
2924 )),
2925 }
2926 }
2927 }
2928
2929 impl serde::ser::Serialize for CommercialState {
2930 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2931 where
2932 S: serde::Serializer,
2933 {
2934 match self {
2935 Self::Unspecified => serializer.serialize_i32(0),
2936 Self::Onboarding => serializer.serialize_i32(1),
2937 Self::Active => serializer.serialize_i32(2),
2938 Self::UnknownValue(u) => u.0.serialize(serializer),
2939 }
2940 }
2941 }
2942
2943 impl<'de> serde::de::Deserialize<'de> for CommercialState {
2944 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2945 where
2946 D: serde::Deserializer<'de>,
2947 {
2948 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CommercialState>::new(
2949 ".google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo.GoogleCloudMarketplaceInfo.CommercialState"))
2950 }
2951 }
2952 }
2953 }
2954
2955 #[derive(Clone, Debug, PartialEq)]
2971 #[non_exhaustive]
2972 pub enum State {
2973 Unspecified,
2975 Active,
2978 UnknownValue(state::UnknownValue),
2983 }
2984
2985 #[doc(hidden)]
2986 pub mod state {
2987 #[allow(unused_imports)]
2988 use super::*;
2989 #[derive(Clone, Debug, PartialEq)]
2990 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2991 }
2992
2993 impl State {
2994 pub fn value(&self) -> std::option::Option<i32> {
2999 match self {
3000 Self::Unspecified => std::option::Option::Some(0),
3001 Self::Active => std::option::Option::Some(1),
3002 Self::UnknownValue(u) => u.0.value(),
3003 }
3004 }
3005
3006 pub fn name(&self) -> std::option::Option<&str> {
3011 match self {
3012 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3013 Self::Active => std::option::Option::Some("ACTIVE"),
3014 Self::UnknownValue(u) => u.0.name(),
3015 }
3016 }
3017 }
3018
3019 impl std::default::Default for State {
3020 fn default() -> Self {
3021 use std::convert::From;
3022 Self::from(0)
3023 }
3024 }
3025
3026 impl std::fmt::Display for State {
3027 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3028 wkt::internal::display_enum(f, self.name(), self.value())
3029 }
3030 }
3031
3032 impl std::convert::From<i32> for State {
3033 fn from(value: i32) -> Self {
3034 match value {
3035 0 => Self::Unspecified,
3036 1 => Self::Active,
3037 _ => Self::UnknownValue(state::UnknownValue(
3038 wkt::internal::UnknownEnumValue::Integer(value),
3039 )),
3040 }
3041 }
3042 }
3043
3044 impl std::convert::From<&str> for State {
3045 fn from(value: &str) -> Self {
3046 use std::string::ToString;
3047 match value {
3048 "STATE_UNSPECIFIED" => Self::Unspecified,
3049 "ACTIVE" => Self::Active,
3050 _ => Self::UnknownValue(state::UnknownValue(
3051 wkt::internal::UnknownEnumValue::String(value.to_string()),
3052 )),
3053 }
3054 }
3055 }
3056
3057 impl serde::ser::Serialize for State {
3058 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3059 where
3060 S: serde::Serializer,
3061 {
3062 match self {
3063 Self::Unspecified => serializer.serialize_i32(0),
3064 Self::Active => serializer.serialize_i32(1),
3065 Self::UnknownValue(u) => u.0.serialize(serializer),
3066 }
3067 }
3068 }
3069
3070 impl<'de> serde::de::Deserialize<'de> for State {
3071 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3072 where
3073 D: serde::Deserializer<'de>,
3074 {
3075 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3076 ".google.cloud.bigquery.analyticshub.v1.Listing.State",
3077 ))
3078 }
3079 }
3080
3081 #[derive(Clone, Debug, PartialEq)]
3097 #[non_exhaustive]
3098 pub enum Category {
3099 Unspecified,
3100 Others,
3101 AdvertisingAndMarketing,
3102 Commerce,
3103 ClimateAndEnvironment,
3104 Demographics,
3105 Economics,
3106 Education,
3107 Energy,
3108 Financial,
3109 Gaming,
3110 Geospatial,
3111 HealthcareAndLifeScience,
3112 Media,
3113 PublicSector,
3114 Retail,
3115 Sports,
3116 ScienceAndResearch,
3117 TransportationAndLogistics,
3118 TravelAndTourism,
3119 GoogleEarthEngine,
3120 UnknownValue(category::UnknownValue),
3125 }
3126
3127 #[doc(hidden)]
3128 pub mod category {
3129 #[allow(unused_imports)]
3130 use super::*;
3131 #[derive(Clone, Debug, PartialEq)]
3132 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3133 }
3134
3135 impl Category {
3136 pub fn value(&self) -> std::option::Option<i32> {
3141 match self {
3142 Self::Unspecified => std::option::Option::Some(0),
3143 Self::Others => std::option::Option::Some(1),
3144 Self::AdvertisingAndMarketing => std::option::Option::Some(2),
3145 Self::Commerce => std::option::Option::Some(3),
3146 Self::ClimateAndEnvironment => std::option::Option::Some(4),
3147 Self::Demographics => std::option::Option::Some(5),
3148 Self::Economics => std::option::Option::Some(6),
3149 Self::Education => std::option::Option::Some(7),
3150 Self::Energy => std::option::Option::Some(8),
3151 Self::Financial => std::option::Option::Some(9),
3152 Self::Gaming => std::option::Option::Some(10),
3153 Self::Geospatial => std::option::Option::Some(11),
3154 Self::HealthcareAndLifeScience => std::option::Option::Some(12),
3155 Self::Media => std::option::Option::Some(13),
3156 Self::PublicSector => std::option::Option::Some(14),
3157 Self::Retail => std::option::Option::Some(15),
3158 Self::Sports => std::option::Option::Some(16),
3159 Self::ScienceAndResearch => std::option::Option::Some(17),
3160 Self::TransportationAndLogistics => std::option::Option::Some(18),
3161 Self::TravelAndTourism => std::option::Option::Some(19),
3162 Self::GoogleEarthEngine => std::option::Option::Some(20),
3163 Self::UnknownValue(u) => u.0.value(),
3164 }
3165 }
3166
3167 pub fn name(&self) -> std::option::Option<&str> {
3172 match self {
3173 Self::Unspecified => std::option::Option::Some("CATEGORY_UNSPECIFIED"),
3174 Self::Others => std::option::Option::Some("CATEGORY_OTHERS"),
3175 Self::AdvertisingAndMarketing => {
3176 std::option::Option::Some("CATEGORY_ADVERTISING_AND_MARKETING")
3177 }
3178 Self::Commerce => std::option::Option::Some("CATEGORY_COMMERCE"),
3179 Self::ClimateAndEnvironment => {
3180 std::option::Option::Some("CATEGORY_CLIMATE_AND_ENVIRONMENT")
3181 }
3182 Self::Demographics => std::option::Option::Some("CATEGORY_DEMOGRAPHICS"),
3183 Self::Economics => std::option::Option::Some("CATEGORY_ECONOMICS"),
3184 Self::Education => std::option::Option::Some("CATEGORY_EDUCATION"),
3185 Self::Energy => std::option::Option::Some("CATEGORY_ENERGY"),
3186 Self::Financial => std::option::Option::Some("CATEGORY_FINANCIAL"),
3187 Self::Gaming => std::option::Option::Some("CATEGORY_GAMING"),
3188 Self::Geospatial => std::option::Option::Some("CATEGORY_GEOSPATIAL"),
3189 Self::HealthcareAndLifeScience => {
3190 std::option::Option::Some("CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE")
3191 }
3192 Self::Media => std::option::Option::Some("CATEGORY_MEDIA"),
3193 Self::PublicSector => std::option::Option::Some("CATEGORY_PUBLIC_SECTOR"),
3194 Self::Retail => std::option::Option::Some("CATEGORY_RETAIL"),
3195 Self::Sports => std::option::Option::Some("CATEGORY_SPORTS"),
3196 Self::ScienceAndResearch => {
3197 std::option::Option::Some("CATEGORY_SCIENCE_AND_RESEARCH")
3198 }
3199 Self::TransportationAndLogistics => {
3200 std::option::Option::Some("CATEGORY_TRANSPORTATION_AND_LOGISTICS")
3201 }
3202 Self::TravelAndTourism => std::option::Option::Some("CATEGORY_TRAVEL_AND_TOURISM"),
3203 Self::GoogleEarthEngine => {
3204 std::option::Option::Some("CATEGORY_GOOGLE_EARTH_ENGINE")
3205 }
3206 Self::UnknownValue(u) => u.0.name(),
3207 }
3208 }
3209 }
3210
3211 impl std::default::Default for Category {
3212 fn default() -> Self {
3213 use std::convert::From;
3214 Self::from(0)
3215 }
3216 }
3217
3218 impl std::fmt::Display for Category {
3219 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3220 wkt::internal::display_enum(f, self.name(), self.value())
3221 }
3222 }
3223
3224 impl std::convert::From<i32> for Category {
3225 fn from(value: i32) -> Self {
3226 match value {
3227 0 => Self::Unspecified,
3228 1 => Self::Others,
3229 2 => Self::AdvertisingAndMarketing,
3230 3 => Self::Commerce,
3231 4 => Self::ClimateAndEnvironment,
3232 5 => Self::Demographics,
3233 6 => Self::Economics,
3234 7 => Self::Education,
3235 8 => Self::Energy,
3236 9 => Self::Financial,
3237 10 => Self::Gaming,
3238 11 => Self::Geospatial,
3239 12 => Self::HealthcareAndLifeScience,
3240 13 => Self::Media,
3241 14 => Self::PublicSector,
3242 15 => Self::Retail,
3243 16 => Self::Sports,
3244 17 => Self::ScienceAndResearch,
3245 18 => Self::TransportationAndLogistics,
3246 19 => Self::TravelAndTourism,
3247 20 => Self::GoogleEarthEngine,
3248 _ => Self::UnknownValue(category::UnknownValue(
3249 wkt::internal::UnknownEnumValue::Integer(value),
3250 )),
3251 }
3252 }
3253 }
3254
3255 impl std::convert::From<&str> for Category {
3256 fn from(value: &str) -> Self {
3257 use std::string::ToString;
3258 match value {
3259 "CATEGORY_UNSPECIFIED" => Self::Unspecified,
3260 "CATEGORY_OTHERS" => Self::Others,
3261 "CATEGORY_ADVERTISING_AND_MARKETING" => Self::AdvertisingAndMarketing,
3262 "CATEGORY_COMMERCE" => Self::Commerce,
3263 "CATEGORY_CLIMATE_AND_ENVIRONMENT" => Self::ClimateAndEnvironment,
3264 "CATEGORY_DEMOGRAPHICS" => Self::Demographics,
3265 "CATEGORY_ECONOMICS" => Self::Economics,
3266 "CATEGORY_EDUCATION" => Self::Education,
3267 "CATEGORY_ENERGY" => Self::Energy,
3268 "CATEGORY_FINANCIAL" => Self::Financial,
3269 "CATEGORY_GAMING" => Self::Gaming,
3270 "CATEGORY_GEOSPATIAL" => Self::Geospatial,
3271 "CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE" => Self::HealthcareAndLifeScience,
3272 "CATEGORY_MEDIA" => Self::Media,
3273 "CATEGORY_PUBLIC_SECTOR" => Self::PublicSector,
3274 "CATEGORY_RETAIL" => Self::Retail,
3275 "CATEGORY_SPORTS" => Self::Sports,
3276 "CATEGORY_SCIENCE_AND_RESEARCH" => Self::ScienceAndResearch,
3277 "CATEGORY_TRANSPORTATION_AND_LOGISTICS" => Self::TransportationAndLogistics,
3278 "CATEGORY_TRAVEL_AND_TOURISM" => Self::TravelAndTourism,
3279 "CATEGORY_GOOGLE_EARTH_ENGINE" => Self::GoogleEarthEngine,
3280 _ => Self::UnknownValue(category::UnknownValue(
3281 wkt::internal::UnknownEnumValue::String(value.to_string()),
3282 )),
3283 }
3284 }
3285 }
3286
3287 impl serde::ser::Serialize for Category {
3288 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3289 where
3290 S: serde::Serializer,
3291 {
3292 match self {
3293 Self::Unspecified => serializer.serialize_i32(0),
3294 Self::Others => serializer.serialize_i32(1),
3295 Self::AdvertisingAndMarketing => serializer.serialize_i32(2),
3296 Self::Commerce => serializer.serialize_i32(3),
3297 Self::ClimateAndEnvironment => serializer.serialize_i32(4),
3298 Self::Demographics => serializer.serialize_i32(5),
3299 Self::Economics => serializer.serialize_i32(6),
3300 Self::Education => serializer.serialize_i32(7),
3301 Self::Energy => serializer.serialize_i32(8),
3302 Self::Financial => serializer.serialize_i32(9),
3303 Self::Gaming => serializer.serialize_i32(10),
3304 Self::Geospatial => serializer.serialize_i32(11),
3305 Self::HealthcareAndLifeScience => serializer.serialize_i32(12),
3306 Self::Media => serializer.serialize_i32(13),
3307 Self::PublicSector => serializer.serialize_i32(14),
3308 Self::Retail => serializer.serialize_i32(15),
3309 Self::Sports => serializer.serialize_i32(16),
3310 Self::ScienceAndResearch => serializer.serialize_i32(17),
3311 Self::TransportationAndLogistics => serializer.serialize_i32(18),
3312 Self::TravelAndTourism => serializer.serialize_i32(19),
3313 Self::GoogleEarthEngine => serializer.serialize_i32(20),
3314 Self::UnknownValue(u) => u.0.serialize(serializer),
3315 }
3316 }
3317 }
3318
3319 impl<'de> serde::de::Deserialize<'de> for Category {
3320 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3321 where
3322 D: serde::Deserializer<'de>,
3323 {
3324 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Category>::new(
3325 ".google.cloud.bigquery.analyticshub.v1.Listing.Category",
3326 ))
3327 }
3328 }
3329
3330 #[derive(Clone, Debug, PartialEq)]
3332 #[non_exhaustive]
3333 pub enum Source {
3334 BigqueryDataset(std::boxed::Box<crate::model::listing::BigQueryDatasetSource>),
3336 PubsubTopic(std::boxed::Box<crate::model::listing::PubSubTopicSource>),
3338 }
3339}
3340
3341#[derive(Clone, Default, PartialEq)]
3344#[non_exhaustive]
3345pub struct StoredProcedureConfig {
3346 pub enabled: bool,
3348
3349 pub allowed_stored_procedure_types:
3351 std::vec::Vec<crate::model::stored_procedure_config::StoredProcedureType>,
3352
3353 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3354}
3355
3356impl StoredProcedureConfig {
3357 pub fn new() -> Self {
3358 std::default::Default::default()
3359 }
3360
3361 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3363 self.enabled = v.into();
3364 self
3365 }
3366
3367 pub fn set_allowed_stored_procedure_types<T, V>(mut self, v: T) -> Self
3369 where
3370 T: std::iter::IntoIterator<Item = V>,
3371 V: std::convert::Into<crate::model::stored_procedure_config::StoredProcedureType>,
3372 {
3373 use std::iter::Iterator;
3374 self.allowed_stored_procedure_types = v.into_iter().map(|i| i.into()).collect();
3375 self
3376 }
3377}
3378
3379impl wkt::message::Message for StoredProcedureConfig {
3380 fn typename() -> &'static str {
3381 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.StoredProcedureConfig"
3382 }
3383}
3384
3385pub mod stored_procedure_config {
3387 #[allow(unused_imports)]
3388 use super::*;
3389
3390 #[derive(Clone, Debug, PartialEq)]
3406 #[non_exhaustive]
3407 pub enum StoredProcedureType {
3408 Unspecified,
3410 SqlProcedure,
3412 UnknownValue(stored_procedure_type::UnknownValue),
3417 }
3418
3419 #[doc(hidden)]
3420 pub mod stored_procedure_type {
3421 #[allow(unused_imports)]
3422 use super::*;
3423 #[derive(Clone, Debug, PartialEq)]
3424 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3425 }
3426
3427 impl StoredProcedureType {
3428 pub fn value(&self) -> std::option::Option<i32> {
3433 match self {
3434 Self::Unspecified => std::option::Option::Some(0),
3435 Self::SqlProcedure => std::option::Option::Some(1),
3436 Self::UnknownValue(u) => u.0.value(),
3437 }
3438 }
3439
3440 pub fn name(&self) -> std::option::Option<&str> {
3445 match self {
3446 Self::Unspecified => std::option::Option::Some("STORED_PROCEDURE_TYPE_UNSPECIFIED"),
3447 Self::SqlProcedure => std::option::Option::Some("SQL_PROCEDURE"),
3448 Self::UnknownValue(u) => u.0.name(),
3449 }
3450 }
3451 }
3452
3453 impl std::default::Default for StoredProcedureType {
3454 fn default() -> Self {
3455 use std::convert::From;
3456 Self::from(0)
3457 }
3458 }
3459
3460 impl std::fmt::Display for StoredProcedureType {
3461 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3462 wkt::internal::display_enum(f, self.name(), self.value())
3463 }
3464 }
3465
3466 impl std::convert::From<i32> for StoredProcedureType {
3467 fn from(value: i32) -> Self {
3468 match value {
3469 0 => Self::Unspecified,
3470 1 => Self::SqlProcedure,
3471 _ => Self::UnknownValue(stored_procedure_type::UnknownValue(
3472 wkt::internal::UnknownEnumValue::Integer(value),
3473 )),
3474 }
3475 }
3476 }
3477
3478 impl std::convert::From<&str> for StoredProcedureType {
3479 fn from(value: &str) -> Self {
3480 use std::string::ToString;
3481 match value {
3482 "STORED_PROCEDURE_TYPE_UNSPECIFIED" => Self::Unspecified,
3483 "SQL_PROCEDURE" => Self::SqlProcedure,
3484 _ => Self::UnknownValue(stored_procedure_type::UnknownValue(
3485 wkt::internal::UnknownEnumValue::String(value.to_string()),
3486 )),
3487 }
3488 }
3489 }
3490
3491 impl serde::ser::Serialize for StoredProcedureType {
3492 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3493 where
3494 S: serde::Serializer,
3495 {
3496 match self {
3497 Self::Unspecified => serializer.serialize_i32(0),
3498 Self::SqlProcedure => serializer.serialize_i32(1),
3499 Self::UnknownValue(u) => u.0.serialize(serializer),
3500 }
3501 }
3502 }
3503
3504 impl<'de> serde::de::Deserialize<'de> for StoredProcedureType {
3505 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3506 where
3507 D: serde::Deserializer<'de>,
3508 {
3509 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StoredProcedureType>::new(
3510 ".google.cloud.bigquery.analyticshub.v1.StoredProcedureConfig.StoredProcedureType",
3511 ))
3512 }
3513 }
3514}
3515
3516#[derive(Clone, Default, PartialEq)]
3520#[non_exhaustive]
3521pub struct Subscription {
3522 pub name: std::string::String,
3525
3526 pub creation_time: std::option::Option<wkt::Timestamp>,
3528
3529 pub last_modify_time: std::option::Option<wkt::Timestamp>,
3531
3532 pub organization_id: std::string::String,
3534
3535 pub organization_display_name: std::string::String,
3537
3538 pub state: crate::model::subscription::State,
3540
3541 pub linked_dataset_map:
3549 std::collections::HashMap<std::string::String, crate::model::subscription::LinkedResource>,
3550
3551 pub subscriber_contact: std::string::String,
3553
3554 pub linked_resources: std::vec::Vec<crate::model::subscription::LinkedResource>,
3557
3558 pub resource_type: crate::model::SharedResourceType,
3560
3561 pub commercial_info: std::option::Option<crate::model::subscription::CommercialInfo>,
3564
3565 pub log_linked_dataset_query_user_email: std::option::Option<bool>,
3569
3570 pub destination_dataset: std::option::Option<crate::model::DestinationDataset>,
3572
3573 pub resource_name: std::option::Option<crate::model::subscription::ResourceName>,
3574
3575 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3576}
3577
3578impl Subscription {
3579 pub fn new() -> Self {
3580 std::default::Default::default()
3581 }
3582
3583 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3585 self.name = v.into();
3586 self
3587 }
3588
3589 pub fn set_creation_time<T>(mut self, v: T) -> Self
3591 where
3592 T: std::convert::Into<wkt::Timestamp>,
3593 {
3594 self.creation_time = std::option::Option::Some(v.into());
3595 self
3596 }
3597
3598 pub fn set_or_clear_creation_time<T>(mut self, v: std::option::Option<T>) -> Self
3600 where
3601 T: std::convert::Into<wkt::Timestamp>,
3602 {
3603 self.creation_time = v.map(|x| x.into());
3604 self
3605 }
3606
3607 pub fn set_last_modify_time<T>(mut self, v: T) -> Self
3609 where
3610 T: std::convert::Into<wkt::Timestamp>,
3611 {
3612 self.last_modify_time = std::option::Option::Some(v.into());
3613 self
3614 }
3615
3616 pub fn set_or_clear_last_modify_time<T>(mut self, v: std::option::Option<T>) -> Self
3618 where
3619 T: std::convert::Into<wkt::Timestamp>,
3620 {
3621 self.last_modify_time = v.map(|x| x.into());
3622 self
3623 }
3624
3625 pub fn set_organization_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3627 self.organization_id = v.into();
3628 self
3629 }
3630
3631 pub fn set_organization_display_name<T: std::convert::Into<std::string::String>>(
3633 mut self,
3634 v: T,
3635 ) -> Self {
3636 self.organization_display_name = v.into();
3637 self
3638 }
3639
3640 pub fn set_state<T: std::convert::Into<crate::model::subscription::State>>(
3642 mut self,
3643 v: T,
3644 ) -> Self {
3645 self.state = v.into();
3646 self
3647 }
3648
3649 pub fn set_linked_dataset_map<T, K, V>(mut self, v: T) -> Self
3651 where
3652 T: std::iter::IntoIterator<Item = (K, V)>,
3653 K: std::convert::Into<std::string::String>,
3654 V: std::convert::Into<crate::model::subscription::LinkedResource>,
3655 {
3656 use std::iter::Iterator;
3657 self.linked_dataset_map = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3658 self
3659 }
3660
3661 pub fn set_subscriber_contact<T: std::convert::Into<std::string::String>>(
3663 mut self,
3664 v: T,
3665 ) -> Self {
3666 self.subscriber_contact = v.into();
3667 self
3668 }
3669
3670 pub fn set_linked_resources<T, V>(mut self, v: T) -> Self
3672 where
3673 T: std::iter::IntoIterator<Item = V>,
3674 V: std::convert::Into<crate::model::subscription::LinkedResource>,
3675 {
3676 use std::iter::Iterator;
3677 self.linked_resources = v.into_iter().map(|i| i.into()).collect();
3678 self
3679 }
3680
3681 pub fn set_resource_type<T: std::convert::Into<crate::model::SharedResourceType>>(
3683 mut self,
3684 v: T,
3685 ) -> Self {
3686 self.resource_type = v.into();
3687 self
3688 }
3689
3690 pub fn set_commercial_info<T>(mut self, v: T) -> Self
3692 where
3693 T: std::convert::Into<crate::model::subscription::CommercialInfo>,
3694 {
3695 self.commercial_info = std::option::Option::Some(v.into());
3696 self
3697 }
3698
3699 pub fn set_or_clear_commercial_info<T>(mut self, v: std::option::Option<T>) -> Self
3701 where
3702 T: std::convert::Into<crate::model::subscription::CommercialInfo>,
3703 {
3704 self.commercial_info = v.map(|x| x.into());
3705 self
3706 }
3707
3708 pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
3710 where
3711 T: std::convert::Into<bool>,
3712 {
3713 self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
3714 self
3715 }
3716
3717 pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
3719 mut self,
3720 v: std::option::Option<T>,
3721 ) -> Self
3722 where
3723 T: std::convert::Into<bool>,
3724 {
3725 self.log_linked_dataset_query_user_email = v.map(|x| x.into());
3726 self
3727 }
3728
3729 pub fn set_destination_dataset<T>(mut self, v: T) -> Self
3731 where
3732 T: std::convert::Into<crate::model::DestinationDataset>,
3733 {
3734 self.destination_dataset = std::option::Option::Some(v.into());
3735 self
3736 }
3737
3738 pub fn set_or_clear_destination_dataset<T>(mut self, v: std::option::Option<T>) -> Self
3740 where
3741 T: std::convert::Into<crate::model::DestinationDataset>,
3742 {
3743 self.destination_dataset = v.map(|x| x.into());
3744 self
3745 }
3746
3747 pub fn set_resource_name<
3752 T: std::convert::Into<std::option::Option<crate::model::subscription::ResourceName>>,
3753 >(
3754 mut self,
3755 v: T,
3756 ) -> Self {
3757 self.resource_name = v.into();
3758 self
3759 }
3760
3761 pub fn listing(&self) -> std::option::Option<&std::string::String> {
3765 #[allow(unreachable_patterns)]
3766 self.resource_name.as_ref().and_then(|v| match v {
3767 crate::model::subscription::ResourceName::Listing(v) => std::option::Option::Some(v),
3768 _ => std::option::Option::None,
3769 })
3770 }
3771
3772 pub fn set_listing<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3778 self.resource_name =
3779 std::option::Option::Some(crate::model::subscription::ResourceName::Listing(v.into()));
3780 self
3781 }
3782
3783 pub fn data_exchange(&self) -> std::option::Option<&std::string::String> {
3787 #[allow(unreachable_patterns)]
3788 self.resource_name.as_ref().and_then(|v| match v {
3789 crate::model::subscription::ResourceName::DataExchange(v) => {
3790 std::option::Option::Some(v)
3791 }
3792 _ => std::option::Option::None,
3793 })
3794 }
3795
3796 pub fn set_data_exchange<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3802 self.resource_name = std::option::Option::Some(
3803 crate::model::subscription::ResourceName::DataExchange(v.into()),
3804 );
3805 self
3806 }
3807}
3808
3809impl wkt::message::Message for Subscription {
3810 fn typename() -> &'static str {
3811 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription"
3812 }
3813}
3814
3815pub mod subscription {
3817 #[allow(unused_imports)]
3818 use super::*;
3819
3820 #[derive(Clone, Default, PartialEq)]
3822 #[non_exhaustive]
3823 pub struct LinkedResource {
3824 pub listing: std::string::String,
3826
3827 pub reference: std::option::Option<crate::model::subscription::linked_resource::Reference>,
3828
3829 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3830 }
3831
3832 impl LinkedResource {
3833 pub fn new() -> Self {
3834 std::default::Default::default()
3835 }
3836
3837 pub fn set_listing<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3839 self.listing = v.into();
3840 self
3841 }
3842
3843 pub fn set_reference<
3848 T: std::convert::Into<
3849 std::option::Option<crate::model::subscription::linked_resource::Reference>,
3850 >,
3851 >(
3852 mut self,
3853 v: T,
3854 ) -> Self {
3855 self.reference = v.into();
3856 self
3857 }
3858
3859 pub fn linked_dataset(&self) -> std::option::Option<&std::string::String> {
3863 #[allow(unreachable_patterns)]
3864 self.reference.as_ref().and_then(|v| match v {
3865 crate::model::subscription::linked_resource::Reference::LinkedDataset(v) => {
3866 std::option::Option::Some(v)
3867 }
3868 _ => std::option::Option::None,
3869 })
3870 }
3871
3872 pub fn set_linked_dataset<T: std::convert::Into<std::string::String>>(
3878 mut self,
3879 v: T,
3880 ) -> Self {
3881 self.reference = std::option::Option::Some(
3882 crate::model::subscription::linked_resource::Reference::LinkedDataset(v.into()),
3883 );
3884 self
3885 }
3886
3887 pub fn linked_pubsub_subscription(&self) -> std::option::Option<&std::string::String> {
3891 #[allow(unreachable_patterns)]
3892 self.reference.as_ref().and_then(|v| match v {
3893 crate::model::subscription::linked_resource::Reference::LinkedPubsubSubscription(v) => std::option::Option::Some(v),
3894 _ => std::option::Option::None,
3895 })
3896 }
3897
3898 pub fn set_linked_pubsub_subscription<T: std::convert::Into<std::string::String>>(
3904 mut self,
3905 v: T,
3906 ) -> Self {
3907 self.reference = std::option::Option::Some(
3908 crate::model::subscription::linked_resource::Reference::LinkedPubsubSubscription(
3909 v.into(),
3910 ),
3911 );
3912 self
3913 }
3914 }
3915
3916 impl wkt::message::Message for LinkedResource {
3917 fn typename() -> &'static str {
3918 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.LinkedResource"
3919 }
3920 }
3921
3922 pub mod linked_resource {
3924 #[allow(unused_imports)]
3925 use super::*;
3926
3927 #[derive(Clone, Debug, PartialEq)]
3928 #[non_exhaustive]
3929 pub enum Reference {
3930 LinkedDataset(std::string::String),
3933 LinkedPubsubSubscription(std::string::String),
3936 }
3937 }
3938
3939 #[derive(Clone, Default, PartialEq)]
3941 #[non_exhaustive]
3942 pub struct CommercialInfo {
3943 pub cloud_marketplace: std::option::Option<
3946 crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
3947 >,
3948
3949 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3950 }
3951
3952 impl CommercialInfo {
3953 pub fn new() -> Self {
3954 std::default::Default::default()
3955 }
3956
3957 pub fn set_cloud_marketplace<T>(mut self, v: T) -> Self
3959 where
3960 T: std::convert::Into<
3961 crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
3962 >,
3963 {
3964 self.cloud_marketplace = std::option::Option::Some(v.into());
3965 self
3966 }
3967
3968 pub fn set_or_clear_cloud_marketplace<T>(mut self, v: std::option::Option<T>) -> Self
3970 where
3971 T: std::convert::Into<
3972 crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
3973 >,
3974 {
3975 self.cloud_marketplace = v.map(|x| x.into());
3976 self
3977 }
3978 }
3979
3980 impl wkt::message::Message for CommercialInfo {
3981 fn typename() -> &'static str {
3982 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.CommercialInfo"
3983 }
3984 }
3985
3986 pub mod commercial_info {
3988 #[allow(unused_imports)]
3989 use super::*;
3990
3991 #[derive(Clone, Default, PartialEq)]
3993 #[non_exhaustive]
3994 pub struct GoogleCloudMarketplaceInfo {
3995 pub order: std::string::String,
3997
3998 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3999 }
4000
4001 impl GoogleCloudMarketplaceInfo {
4002 pub fn new() -> Self {
4003 std::default::Default::default()
4004 }
4005
4006 pub fn set_order<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4008 self.order = v.into();
4009 self
4010 }
4011 }
4012
4013 impl wkt::message::Message for GoogleCloudMarketplaceInfo {
4014 fn typename() -> &'static str {
4015 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.CommercialInfo.GoogleCloudMarketplaceInfo"
4016 }
4017 }
4018 }
4019
4020 #[derive(Clone, Debug, PartialEq)]
4036 #[non_exhaustive]
4037 pub enum State {
4038 Unspecified,
4040 Active,
4042 Stale,
4045 Inactive,
4048 UnknownValue(state::UnknownValue),
4053 }
4054
4055 #[doc(hidden)]
4056 pub mod state {
4057 #[allow(unused_imports)]
4058 use super::*;
4059 #[derive(Clone, Debug, PartialEq)]
4060 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4061 }
4062
4063 impl State {
4064 pub fn value(&self) -> std::option::Option<i32> {
4069 match self {
4070 Self::Unspecified => std::option::Option::Some(0),
4071 Self::Active => std::option::Option::Some(1),
4072 Self::Stale => std::option::Option::Some(2),
4073 Self::Inactive => std::option::Option::Some(3),
4074 Self::UnknownValue(u) => u.0.value(),
4075 }
4076 }
4077
4078 pub fn name(&self) -> std::option::Option<&str> {
4083 match self {
4084 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4085 Self::Active => std::option::Option::Some("STATE_ACTIVE"),
4086 Self::Stale => std::option::Option::Some("STATE_STALE"),
4087 Self::Inactive => std::option::Option::Some("STATE_INACTIVE"),
4088 Self::UnknownValue(u) => u.0.name(),
4089 }
4090 }
4091 }
4092
4093 impl std::default::Default for State {
4094 fn default() -> Self {
4095 use std::convert::From;
4096 Self::from(0)
4097 }
4098 }
4099
4100 impl std::fmt::Display for State {
4101 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4102 wkt::internal::display_enum(f, self.name(), self.value())
4103 }
4104 }
4105
4106 impl std::convert::From<i32> for State {
4107 fn from(value: i32) -> Self {
4108 match value {
4109 0 => Self::Unspecified,
4110 1 => Self::Active,
4111 2 => Self::Stale,
4112 3 => Self::Inactive,
4113 _ => Self::UnknownValue(state::UnknownValue(
4114 wkt::internal::UnknownEnumValue::Integer(value),
4115 )),
4116 }
4117 }
4118 }
4119
4120 impl std::convert::From<&str> for State {
4121 fn from(value: &str) -> Self {
4122 use std::string::ToString;
4123 match value {
4124 "STATE_UNSPECIFIED" => Self::Unspecified,
4125 "STATE_ACTIVE" => Self::Active,
4126 "STATE_STALE" => Self::Stale,
4127 "STATE_INACTIVE" => Self::Inactive,
4128 _ => Self::UnknownValue(state::UnknownValue(
4129 wkt::internal::UnknownEnumValue::String(value.to_string()),
4130 )),
4131 }
4132 }
4133 }
4134
4135 impl serde::ser::Serialize for State {
4136 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4137 where
4138 S: serde::Serializer,
4139 {
4140 match self {
4141 Self::Unspecified => serializer.serialize_i32(0),
4142 Self::Active => serializer.serialize_i32(1),
4143 Self::Stale => serializer.serialize_i32(2),
4144 Self::Inactive => serializer.serialize_i32(3),
4145 Self::UnknownValue(u) => u.0.serialize(serializer),
4146 }
4147 }
4148 }
4149
4150 impl<'de> serde::de::Deserialize<'de> for State {
4151 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4152 where
4153 D: serde::Deserializer<'de>,
4154 {
4155 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4156 ".google.cloud.bigquery.analyticshub.v1.Subscription.State",
4157 ))
4158 }
4159 }
4160
4161 #[derive(Clone, Debug, PartialEq)]
4162 #[non_exhaustive]
4163 pub enum ResourceName {
4164 Listing(std::string::String),
4167 DataExchange(std::string::String),
4170 }
4171}
4172
4173#[derive(Clone, Default, PartialEq)]
4175#[non_exhaustive]
4176pub struct ListDataExchangesRequest {
4177 pub parent: std::string::String,
4180
4181 pub page_size: i32,
4184
4185 pub page_token: std::string::String,
4188
4189 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4190}
4191
4192impl ListDataExchangesRequest {
4193 pub fn new() -> Self {
4194 std::default::Default::default()
4195 }
4196
4197 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4199 self.parent = v.into();
4200 self
4201 }
4202
4203 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4205 self.page_size = v.into();
4206 self
4207 }
4208
4209 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4211 self.page_token = v.into();
4212 self
4213 }
4214}
4215
4216impl wkt::message::Message for ListDataExchangesRequest {
4217 fn typename() -> &'static str {
4218 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest"
4219 }
4220}
4221
4222#[derive(Clone, Default, PartialEq)]
4224#[non_exhaustive]
4225pub struct ListDataExchangesResponse {
4226 pub data_exchanges: std::vec::Vec<crate::model::DataExchange>,
4228
4229 pub next_page_token: std::string::String,
4231
4232 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4233}
4234
4235impl ListDataExchangesResponse {
4236 pub fn new() -> Self {
4237 std::default::Default::default()
4238 }
4239
4240 pub fn set_data_exchanges<T, V>(mut self, v: T) -> Self
4242 where
4243 T: std::iter::IntoIterator<Item = V>,
4244 V: std::convert::Into<crate::model::DataExchange>,
4245 {
4246 use std::iter::Iterator;
4247 self.data_exchanges = v.into_iter().map(|i| i.into()).collect();
4248 self
4249 }
4250
4251 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4253 self.next_page_token = v.into();
4254 self
4255 }
4256}
4257
4258impl wkt::message::Message for ListDataExchangesResponse {
4259 fn typename() -> &'static str {
4260 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse"
4261 }
4262}
4263
4264#[doc(hidden)]
4265impl gax::paginator::internal::PageableResponse for ListDataExchangesResponse {
4266 type PageItem = crate::model::DataExchange;
4267
4268 fn items(self) -> std::vec::Vec<Self::PageItem> {
4269 self.data_exchanges
4270 }
4271
4272 fn next_page_token(&self) -> std::string::String {
4273 use std::clone::Clone;
4274 self.next_page_token.clone()
4275 }
4276}
4277
4278#[derive(Clone, Default, PartialEq)]
4281#[non_exhaustive]
4282pub struct ListOrgDataExchangesRequest {
4283 pub organization: std::string::String,
4286
4287 pub page_size: i32,
4290
4291 pub page_token: std::string::String,
4294
4295 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4296}
4297
4298impl ListOrgDataExchangesRequest {
4299 pub fn new() -> Self {
4300 std::default::Default::default()
4301 }
4302
4303 pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4305 self.organization = v.into();
4306 self
4307 }
4308
4309 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4311 self.page_size = v.into();
4312 self
4313 }
4314
4315 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4317 self.page_token = v.into();
4318 self
4319 }
4320}
4321
4322impl wkt::message::Message for ListOrgDataExchangesRequest {
4323 fn typename() -> &'static str {
4324 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest"
4325 }
4326}
4327
4328#[derive(Clone, Default, PartialEq)]
4331#[non_exhaustive]
4332pub struct ListOrgDataExchangesResponse {
4333 pub data_exchanges: std::vec::Vec<crate::model::DataExchange>,
4335
4336 pub next_page_token: std::string::String,
4338
4339 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4340}
4341
4342impl ListOrgDataExchangesResponse {
4343 pub fn new() -> Self {
4344 std::default::Default::default()
4345 }
4346
4347 pub fn set_data_exchanges<T, V>(mut self, v: T) -> Self
4349 where
4350 T: std::iter::IntoIterator<Item = V>,
4351 V: std::convert::Into<crate::model::DataExchange>,
4352 {
4353 use std::iter::Iterator;
4354 self.data_exchanges = v.into_iter().map(|i| i.into()).collect();
4355 self
4356 }
4357
4358 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4360 self.next_page_token = v.into();
4361 self
4362 }
4363}
4364
4365impl wkt::message::Message for ListOrgDataExchangesResponse {
4366 fn typename() -> &'static str {
4367 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse"
4368 }
4369}
4370
4371#[doc(hidden)]
4372impl gax::paginator::internal::PageableResponse for ListOrgDataExchangesResponse {
4373 type PageItem = crate::model::DataExchange;
4374
4375 fn items(self) -> std::vec::Vec<Self::PageItem> {
4376 self.data_exchanges
4377 }
4378
4379 fn next_page_token(&self) -> std::string::String {
4380 use std::clone::Clone;
4381 self.next_page_token.clone()
4382 }
4383}
4384
4385#[derive(Clone, Default, PartialEq)]
4387#[non_exhaustive]
4388pub struct GetDataExchangeRequest {
4389 pub name: std::string::String,
4392
4393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4394}
4395
4396impl GetDataExchangeRequest {
4397 pub fn new() -> Self {
4398 std::default::Default::default()
4399 }
4400
4401 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4403 self.name = v.into();
4404 self
4405 }
4406}
4407
4408impl wkt::message::Message for GetDataExchangeRequest {
4409 fn typename() -> &'static str {
4410 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest"
4411 }
4412}
4413
4414#[derive(Clone, Default, PartialEq)]
4416#[non_exhaustive]
4417pub struct CreateDataExchangeRequest {
4418 pub parent: std::string::String,
4421
4422 pub data_exchange_id: std::string::String,
4426
4427 pub data_exchange: std::option::Option<crate::model::DataExchange>,
4429
4430 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4431}
4432
4433impl CreateDataExchangeRequest {
4434 pub fn new() -> Self {
4435 std::default::Default::default()
4436 }
4437
4438 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4440 self.parent = v.into();
4441 self
4442 }
4443
4444 pub fn set_data_exchange_id<T: std::convert::Into<std::string::String>>(
4446 mut self,
4447 v: T,
4448 ) -> Self {
4449 self.data_exchange_id = v.into();
4450 self
4451 }
4452
4453 pub fn set_data_exchange<T>(mut self, v: T) -> Self
4455 where
4456 T: std::convert::Into<crate::model::DataExchange>,
4457 {
4458 self.data_exchange = std::option::Option::Some(v.into());
4459 self
4460 }
4461
4462 pub fn set_or_clear_data_exchange<T>(mut self, v: std::option::Option<T>) -> Self
4464 where
4465 T: std::convert::Into<crate::model::DataExchange>,
4466 {
4467 self.data_exchange = v.map(|x| x.into());
4468 self
4469 }
4470}
4471
4472impl wkt::message::Message for CreateDataExchangeRequest {
4473 fn typename() -> &'static str {
4474 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest"
4475 }
4476}
4477
4478#[derive(Clone, Default, PartialEq)]
4480#[non_exhaustive]
4481pub struct UpdateDataExchangeRequest {
4482 pub update_mask: std::option::Option<wkt::FieldMask>,
4486
4487 pub data_exchange: std::option::Option<crate::model::DataExchange>,
4489
4490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4491}
4492
4493impl UpdateDataExchangeRequest {
4494 pub fn new() -> Self {
4495 std::default::Default::default()
4496 }
4497
4498 pub fn set_update_mask<T>(mut self, v: T) -> Self
4500 where
4501 T: std::convert::Into<wkt::FieldMask>,
4502 {
4503 self.update_mask = std::option::Option::Some(v.into());
4504 self
4505 }
4506
4507 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4509 where
4510 T: std::convert::Into<wkt::FieldMask>,
4511 {
4512 self.update_mask = v.map(|x| x.into());
4513 self
4514 }
4515
4516 pub fn set_data_exchange<T>(mut self, v: T) -> Self
4518 where
4519 T: std::convert::Into<crate::model::DataExchange>,
4520 {
4521 self.data_exchange = std::option::Option::Some(v.into());
4522 self
4523 }
4524
4525 pub fn set_or_clear_data_exchange<T>(mut self, v: std::option::Option<T>) -> Self
4527 where
4528 T: std::convert::Into<crate::model::DataExchange>,
4529 {
4530 self.data_exchange = v.map(|x| x.into());
4531 self
4532 }
4533}
4534
4535impl wkt::message::Message for UpdateDataExchangeRequest {
4536 fn typename() -> &'static str {
4537 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest"
4538 }
4539}
4540
4541#[derive(Clone, Default, PartialEq)]
4543#[non_exhaustive]
4544pub struct DeleteDataExchangeRequest {
4545 pub name: std::string::String,
4548
4549 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4550}
4551
4552impl DeleteDataExchangeRequest {
4553 pub fn new() -> Self {
4554 std::default::Default::default()
4555 }
4556
4557 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4559 self.name = v.into();
4560 self
4561 }
4562}
4563
4564impl wkt::message::Message for DeleteDataExchangeRequest {
4565 fn typename() -> &'static str {
4566 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest"
4567 }
4568}
4569
4570#[derive(Clone, Default, PartialEq)]
4572#[non_exhaustive]
4573pub struct ListListingsRequest {
4574 pub parent: std::string::String,
4577
4578 pub page_size: i32,
4581
4582 pub page_token: std::string::String,
4585
4586 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4587}
4588
4589impl ListListingsRequest {
4590 pub fn new() -> Self {
4591 std::default::Default::default()
4592 }
4593
4594 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4596 self.parent = v.into();
4597 self
4598 }
4599
4600 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4602 self.page_size = v.into();
4603 self
4604 }
4605
4606 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4608 self.page_token = v.into();
4609 self
4610 }
4611}
4612
4613impl wkt::message::Message for ListListingsRequest {
4614 fn typename() -> &'static str {
4615 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListListingsRequest"
4616 }
4617}
4618
4619#[derive(Clone, Default, PartialEq)]
4621#[non_exhaustive]
4622pub struct ListListingsResponse {
4623 pub listings: std::vec::Vec<crate::model::Listing>,
4625
4626 pub next_page_token: std::string::String,
4628
4629 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4630}
4631
4632impl ListListingsResponse {
4633 pub fn new() -> Self {
4634 std::default::Default::default()
4635 }
4636
4637 pub fn set_listings<T, V>(mut self, v: T) -> Self
4639 where
4640 T: std::iter::IntoIterator<Item = V>,
4641 V: std::convert::Into<crate::model::Listing>,
4642 {
4643 use std::iter::Iterator;
4644 self.listings = v.into_iter().map(|i| i.into()).collect();
4645 self
4646 }
4647
4648 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4650 self.next_page_token = v.into();
4651 self
4652 }
4653}
4654
4655impl wkt::message::Message for ListListingsResponse {
4656 fn typename() -> &'static str {
4657 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListListingsResponse"
4658 }
4659}
4660
4661#[doc(hidden)]
4662impl gax::paginator::internal::PageableResponse for ListListingsResponse {
4663 type PageItem = crate::model::Listing;
4664
4665 fn items(self) -> std::vec::Vec<Self::PageItem> {
4666 self.listings
4667 }
4668
4669 fn next_page_token(&self) -> std::string::String {
4670 use std::clone::Clone;
4671 self.next_page_token.clone()
4672 }
4673}
4674
4675#[derive(Clone, Default, PartialEq)]
4677#[non_exhaustive]
4678pub struct GetListingRequest {
4679 pub name: std::string::String,
4682
4683 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4684}
4685
4686impl GetListingRequest {
4687 pub fn new() -> Self {
4688 std::default::Default::default()
4689 }
4690
4691 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4693 self.name = v.into();
4694 self
4695 }
4696}
4697
4698impl wkt::message::Message for GetListingRequest {
4699 fn typename() -> &'static str {
4700 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetListingRequest"
4701 }
4702}
4703
4704#[derive(Clone, Default, PartialEq)]
4706#[non_exhaustive]
4707pub struct CreateListingRequest {
4708 pub parent: std::string::String,
4711
4712 pub listing_id: std::string::String,
4716
4717 pub listing: std::option::Option<crate::model::Listing>,
4719
4720 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4721}
4722
4723impl CreateListingRequest {
4724 pub fn new() -> Self {
4725 std::default::Default::default()
4726 }
4727
4728 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4730 self.parent = v.into();
4731 self
4732 }
4733
4734 pub fn set_listing_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4736 self.listing_id = v.into();
4737 self
4738 }
4739
4740 pub fn set_listing<T>(mut self, v: T) -> Self
4742 where
4743 T: std::convert::Into<crate::model::Listing>,
4744 {
4745 self.listing = std::option::Option::Some(v.into());
4746 self
4747 }
4748
4749 pub fn set_or_clear_listing<T>(mut self, v: std::option::Option<T>) -> Self
4751 where
4752 T: std::convert::Into<crate::model::Listing>,
4753 {
4754 self.listing = v.map(|x| x.into());
4755 self
4756 }
4757}
4758
4759impl wkt::message::Message for CreateListingRequest {
4760 fn typename() -> &'static str {
4761 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateListingRequest"
4762 }
4763}
4764
4765#[derive(Clone, Default, PartialEq)]
4767#[non_exhaustive]
4768pub struct UpdateListingRequest {
4769 pub update_mask: std::option::Option<wkt::FieldMask>,
4773
4774 pub listing: std::option::Option<crate::model::Listing>,
4776
4777 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4778}
4779
4780impl UpdateListingRequest {
4781 pub fn new() -> Self {
4782 std::default::Default::default()
4783 }
4784
4785 pub fn set_update_mask<T>(mut self, v: T) -> Self
4787 where
4788 T: std::convert::Into<wkt::FieldMask>,
4789 {
4790 self.update_mask = std::option::Option::Some(v.into());
4791 self
4792 }
4793
4794 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4796 where
4797 T: std::convert::Into<wkt::FieldMask>,
4798 {
4799 self.update_mask = v.map(|x| x.into());
4800 self
4801 }
4802
4803 pub fn set_listing<T>(mut self, v: T) -> Self
4805 where
4806 T: std::convert::Into<crate::model::Listing>,
4807 {
4808 self.listing = std::option::Option::Some(v.into());
4809 self
4810 }
4811
4812 pub fn set_or_clear_listing<T>(mut self, v: std::option::Option<T>) -> Self
4814 where
4815 T: std::convert::Into<crate::model::Listing>,
4816 {
4817 self.listing = v.map(|x| x.into());
4818 self
4819 }
4820}
4821
4822impl wkt::message::Message for UpdateListingRequest {
4823 fn typename() -> &'static str {
4824 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateListingRequest"
4825 }
4826}
4827
4828#[derive(Clone, Default, PartialEq)]
4830#[non_exhaustive]
4831pub struct DeleteListingRequest {
4832 pub name: std::string::String,
4835
4836 pub delete_commercial: bool,
4840
4841 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4842}
4843
4844impl DeleteListingRequest {
4845 pub fn new() -> Self {
4846 std::default::Default::default()
4847 }
4848
4849 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4851 self.name = v.into();
4852 self
4853 }
4854
4855 pub fn set_delete_commercial<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4857 self.delete_commercial = v.into();
4858 self
4859 }
4860}
4861
4862impl wkt::message::Message for DeleteListingRequest {
4863 fn typename() -> &'static str {
4864 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteListingRequest"
4865 }
4866}
4867
4868#[derive(Clone, Default, PartialEq)]
4870#[non_exhaustive]
4871pub struct SubscribeListingRequest {
4872 pub name: std::string::String,
4875
4876 pub destination: std::option::Option<crate::model::subscribe_listing_request::Destination>,
4878
4879 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4880}
4881
4882impl SubscribeListingRequest {
4883 pub fn new() -> Self {
4884 std::default::Default::default()
4885 }
4886
4887 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4889 self.name = v.into();
4890 self
4891 }
4892
4893 pub fn set_destination<
4898 T: std::convert::Into<
4899 std::option::Option<crate::model::subscribe_listing_request::Destination>,
4900 >,
4901 >(
4902 mut self,
4903 v: T,
4904 ) -> Self {
4905 self.destination = v.into();
4906 self
4907 }
4908
4909 pub fn destination_dataset(
4913 &self,
4914 ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationDataset>> {
4915 #[allow(unreachable_patterns)]
4916 self.destination.as_ref().and_then(|v| match v {
4917 crate::model::subscribe_listing_request::Destination::DestinationDataset(v) => {
4918 std::option::Option::Some(v)
4919 }
4920 _ => std::option::Option::None,
4921 })
4922 }
4923
4924 pub fn set_destination_dataset<
4930 T: std::convert::Into<std::boxed::Box<crate::model::DestinationDataset>>,
4931 >(
4932 mut self,
4933 v: T,
4934 ) -> Self {
4935 self.destination = std::option::Option::Some(
4936 crate::model::subscribe_listing_request::Destination::DestinationDataset(v.into()),
4937 );
4938 self
4939 }
4940
4941 pub fn destination_pubsub_subscription(
4945 &self,
4946 ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationPubSubSubscription>> {
4947 #[allow(unreachable_patterns)]
4948 self.destination.as_ref().and_then(|v| match v {
4949 crate::model::subscribe_listing_request::Destination::DestinationPubsubSubscription(
4950 v,
4951 ) => std::option::Option::Some(v),
4952 _ => std::option::Option::None,
4953 })
4954 }
4955
4956 pub fn set_destination_pubsub_subscription<
4962 T: std::convert::Into<std::boxed::Box<crate::model::DestinationPubSubSubscription>>,
4963 >(
4964 mut self,
4965 v: T,
4966 ) -> Self {
4967 self.destination = std::option::Option::Some(
4968 crate::model::subscribe_listing_request::Destination::DestinationPubsubSubscription(
4969 v.into(),
4970 ),
4971 );
4972 self
4973 }
4974}
4975
4976impl wkt::message::Message for SubscribeListingRequest {
4977 fn typename() -> &'static str {
4978 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest"
4979 }
4980}
4981
4982pub mod subscribe_listing_request {
4984 #[allow(unused_imports)]
4985 use super::*;
4986
4987 #[derive(Clone, Debug, PartialEq)]
4989 #[non_exhaustive]
4990 pub enum Destination {
4991 DestinationDataset(std::boxed::Box<crate::model::DestinationDataset>),
4993 DestinationPubsubSubscription(std::boxed::Box<crate::model::DestinationPubSubSubscription>),
4996 }
4997}
4998
4999#[derive(Clone, Default, PartialEq)]
5001#[non_exhaustive]
5002pub struct SubscribeListingResponse {
5003 pub subscription: std::option::Option<crate::model::Subscription>,
5005
5006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5007}
5008
5009impl SubscribeListingResponse {
5010 pub fn new() -> Self {
5011 std::default::Default::default()
5012 }
5013
5014 pub fn set_subscription<T>(mut self, v: T) -> Self
5016 where
5017 T: std::convert::Into<crate::model::Subscription>,
5018 {
5019 self.subscription = std::option::Option::Some(v.into());
5020 self
5021 }
5022
5023 pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
5025 where
5026 T: std::convert::Into<crate::model::Subscription>,
5027 {
5028 self.subscription = v.map(|x| x.into());
5029 self
5030 }
5031}
5032
5033impl wkt::message::Message for SubscribeListingResponse {
5034 fn typename() -> &'static str {
5035 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse"
5036 }
5037}
5038
5039#[derive(Clone, Default, PartialEq)]
5041#[non_exhaustive]
5042pub struct SubscribeDataExchangeRequest {
5043 pub name: std::string::String,
5046
5047 pub destination: std::string::String,
5050
5051 pub destination_dataset: std::option::Option<crate::model::DestinationDataset>,
5053
5054 pub subscription: std::string::String,
5057
5058 pub subscriber_contact: std::string::String,
5060
5061 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5062}
5063
5064impl SubscribeDataExchangeRequest {
5065 pub fn new() -> Self {
5066 std::default::Default::default()
5067 }
5068
5069 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5071 self.name = v.into();
5072 self
5073 }
5074
5075 pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5077 self.destination = v.into();
5078 self
5079 }
5080
5081 pub fn set_destination_dataset<T>(mut self, v: T) -> Self
5083 where
5084 T: std::convert::Into<crate::model::DestinationDataset>,
5085 {
5086 self.destination_dataset = std::option::Option::Some(v.into());
5087 self
5088 }
5089
5090 pub fn set_or_clear_destination_dataset<T>(mut self, v: std::option::Option<T>) -> Self
5092 where
5093 T: std::convert::Into<crate::model::DestinationDataset>,
5094 {
5095 self.destination_dataset = v.map(|x| x.into());
5096 self
5097 }
5098
5099 pub fn set_subscription<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5101 self.subscription = v.into();
5102 self
5103 }
5104
5105 pub fn set_subscriber_contact<T: std::convert::Into<std::string::String>>(
5107 mut self,
5108 v: T,
5109 ) -> Self {
5110 self.subscriber_contact = v.into();
5111 self
5112 }
5113}
5114
5115impl wkt::message::Message for SubscribeDataExchangeRequest {
5116 fn typename() -> &'static str {
5117 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeDataExchangeRequest"
5118 }
5119}
5120
5121#[derive(Clone, Default, PartialEq)]
5123#[non_exhaustive]
5124pub struct SubscribeDataExchangeResponse {
5125 pub subscription: std::option::Option<crate::model::Subscription>,
5127
5128 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5129}
5130
5131impl SubscribeDataExchangeResponse {
5132 pub fn new() -> Self {
5133 std::default::Default::default()
5134 }
5135
5136 pub fn set_subscription<T>(mut self, v: T) -> Self
5138 where
5139 T: std::convert::Into<crate::model::Subscription>,
5140 {
5141 self.subscription = std::option::Option::Some(v.into());
5142 self
5143 }
5144
5145 pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
5147 where
5148 T: std::convert::Into<crate::model::Subscription>,
5149 {
5150 self.subscription = v.map(|x| x.into());
5151 self
5152 }
5153}
5154
5155impl wkt::message::Message for SubscribeDataExchangeResponse {
5156 fn typename() -> &'static str {
5157 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeDataExchangeResponse"
5158 }
5159}
5160
5161#[derive(Clone, Default, PartialEq)]
5163#[non_exhaustive]
5164pub struct RefreshSubscriptionRequest {
5165 pub name: std::string::String,
5168
5169 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5170}
5171
5172impl RefreshSubscriptionRequest {
5173 pub fn new() -> Self {
5174 std::default::Default::default()
5175 }
5176
5177 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5179 self.name = v.into();
5180 self
5181 }
5182}
5183
5184impl wkt::message::Message for RefreshSubscriptionRequest {
5185 fn typename() -> &'static str {
5186 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RefreshSubscriptionRequest"
5187 }
5188}
5189
5190#[derive(Clone, Default, PartialEq)]
5192#[non_exhaustive]
5193pub struct RefreshSubscriptionResponse {
5194 pub subscription: std::option::Option<crate::model::Subscription>,
5196
5197 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5198}
5199
5200impl RefreshSubscriptionResponse {
5201 pub fn new() -> Self {
5202 std::default::Default::default()
5203 }
5204
5205 pub fn set_subscription<T>(mut self, v: T) -> Self
5207 where
5208 T: std::convert::Into<crate::model::Subscription>,
5209 {
5210 self.subscription = std::option::Option::Some(v.into());
5211 self
5212 }
5213
5214 pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
5216 where
5217 T: std::convert::Into<crate::model::Subscription>,
5218 {
5219 self.subscription = v.map(|x| x.into());
5220 self
5221 }
5222}
5223
5224impl wkt::message::Message for RefreshSubscriptionResponse {
5225 fn typename() -> &'static str {
5226 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RefreshSubscriptionResponse"
5227 }
5228}
5229
5230#[derive(Clone, Default, PartialEq)]
5232#[non_exhaustive]
5233pub struct GetSubscriptionRequest {
5234 pub name: std::string::String,
5237
5238 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5239}
5240
5241impl GetSubscriptionRequest {
5242 pub fn new() -> Self {
5243 std::default::Default::default()
5244 }
5245
5246 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5248 self.name = v.into();
5249 self
5250 }
5251}
5252
5253impl wkt::message::Message for GetSubscriptionRequest {
5254 fn typename() -> &'static str {
5255 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetSubscriptionRequest"
5256 }
5257}
5258
5259#[derive(Clone, Default, PartialEq)]
5261#[non_exhaustive]
5262pub struct ListSubscriptionsRequest {
5263 pub parent: std::string::String,
5266
5267 pub filter: std::string::String,
5283
5284 pub page_size: i32,
5286
5287 pub page_token: std::string::String,
5289
5290 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5291}
5292
5293impl ListSubscriptionsRequest {
5294 pub fn new() -> Self {
5295 std::default::Default::default()
5296 }
5297
5298 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5300 self.parent = v.into();
5301 self
5302 }
5303
5304 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5306 self.filter = v.into();
5307 self
5308 }
5309
5310 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5312 self.page_size = v.into();
5313 self
5314 }
5315
5316 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5318 self.page_token = v.into();
5319 self
5320 }
5321}
5322
5323impl wkt::message::Message for ListSubscriptionsRequest {
5324 fn typename() -> &'static str {
5325 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSubscriptionsRequest"
5326 }
5327}
5328
5329#[derive(Clone, Default, PartialEq)]
5331#[non_exhaustive]
5332pub struct ListSubscriptionsResponse {
5333 pub subscriptions: std::vec::Vec<crate::model::Subscription>,
5335
5336 pub next_page_token: std::string::String,
5338
5339 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5340}
5341
5342impl ListSubscriptionsResponse {
5343 pub fn new() -> Self {
5344 std::default::Default::default()
5345 }
5346
5347 pub fn set_subscriptions<T, V>(mut self, v: T) -> Self
5349 where
5350 T: std::iter::IntoIterator<Item = V>,
5351 V: std::convert::Into<crate::model::Subscription>,
5352 {
5353 use std::iter::Iterator;
5354 self.subscriptions = v.into_iter().map(|i| i.into()).collect();
5355 self
5356 }
5357
5358 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5360 self.next_page_token = v.into();
5361 self
5362 }
5363}
5364
5365impl wkt::message::Message for ListSubscriptionsResponse {
5366 fn typename() -> &'static str {
5367 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSubscriptionsResponse"
5368 }
5369}
5370
5371#[doc(hidden)]
5372impl gax::paginator::internal::PageableResponse for ListSubscriptionsResponse {
5373 type PageItem = crate::model::Subscription;
5374
5375 fn items(self) -> std::vec::Vec<Self::PageItem> {
5376 self.subscriptions
5377 }
5378
5379 fn next_page_token(&self) -> std::string::String {
5380 use std::clone::Clone;
5381 self.next_page_token.clone()
5382 }
5383}
5384
5385#[derive(Clone, Default, PartialEq)]
5387#[non_exhaustive]
5388pub struct ListSharedResourceSubscriptionsRequest {
5389 pub resource: std::string::String,
5394
5395 pub include_deleted_subscriptions: bool,
5398
5399 pub page_size: i32,
5401
5402 pub page_token: std::string::String,
5404
5405 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5406}
5407
5408impl ListSharedResourceSubscriptionsRequest {
5409 pub fn new() -> Self {
5410 std::default::Default::default()
5411 }
5412
5413 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5415 self.resource = v.into();
5416 self
5417 }
5418
5419 pub fn set_include_deleted_subscriptions<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5421 self.include_deleted_subscriptions = v.into();
5422 self
5423 }
5424
5425 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5427 self.page_size = v.into();
5428 self
5429 }
5430
5431 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5433 self.page_token = v.into();
5434 self
5435 }
5436}
5437
5438impl wkt::message::Message for ListSharedResourceSubscriptionsRequest {
5439 fn typename() -> &'static str {
5440 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSharedResourceSubscriptionsRequest"
5441 }
5442}
5443
5444#[derive(Clone, Default, PartialEq)]
5446#[non_exhaustive]
5447pub struct ListSharedResourceSubscriptionsResponse {
5448 pub shared_resource_subscriptions: std::vec::Vec<crate::model::Subscription>,
5450
5451 pub next_page_token: std::string::String,
5453
5454 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5455}
5456
5457impl ListSharedResourceSubscriptionsResponse {
5458 pub fn new() -> Self {
5459 std::default::Default::default()
5460 }
5461
5462 pub fn set_shared_resource_subscriptions<T, V>(mut self, v: T) -> Self
5464 where
5465 T: std::iter::IntoIterator<Item = V>,
5466 V: std::convert::Into<crate::model::Subscription>,
5467 {
5468 use std::iter::Iterator;
5469 self.shared_resource_subscriptions = v.into_iter().map(|i| i.into()).collect();
5470 self
5471 }
5472
5473 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5475 self.next_page_token = v.into();
5476 self
5477 }
5478}
5479
5480impl wkt::message::Message for ListSharedResourceSubscriptionsResponse {
5481 fn typename() -> &'static str {
5482 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSharedResourceSubscriptionsResponse"
5483 }
5484}
5485
5486#[doc(hidden)]
5487impl gax::paginator::internal::PageableResponse for ListSharedResourceSubscriptionsResponse {
5488 type PageItem = crate::model::Subscription;
5489
5490 fn items(self) -> std::vec::Vec<Self::PageItem> {
5491 self.shared_resource_subscriptions
5492 }
5493
5494 fn next_page_token(&self) -> std::string::String {
5495 use std::clone::Clone;
5496 self.next_page_token.clone()
5497 }
5498}
5499
5500#[derive(Clone, Default, PartialEq)]
5502#[non_exhaustive]
5503pub struct RevokeSubscriptionRequest {
5504 pub name: std::string::String,
5507
5508 pub revoke_commercial: bool,
5512
5513 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5514}
5515
5516impl RevokeSubscriptionRequest {
5517 pub fn new() -> Self {
5518 std::default::Default::default()
5519 }
5520
5521 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5523 self.name = v.into();
5524 self
5525 }
5526
5527 pub fn set_revoke_commercial<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5529 self.revoke_commercial = v.into();
5530 self
5531 }
5532}
5533
5534impl wkt::message::Message for RevokeSubscriptionRequest {
5535 fn typename() -> &'static str {
5536 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RevokeSubscriptionRequest"
5537 }
5538}
5539
5540#[derive(Clone, Default, PartialEq)]
5543#[non_exhaustive]
5544pub struct RevokeSubscriptionResponse {
5545 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5546}
5547
5548impl RevokeSubscriptionResponse {
5549 pub fn new() -> Self {
5550 std::default::Default::default()
5551 }
5552}
5553
5554impl wkt::message::Message for RevokeSubscriptionResponse {
5555 fn typename() -> &'static str {
5556 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RevokeSubscriptionResponse"
5557 }
5558}
5559
5560#[derive(Clone, Default, PartialEq)]
5562#[non_exhaustive]
5563pub struct DeleteSubscriptionRequest {
5564 pub name: std::string::String,
5567
5568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5569}
5570
5571impl DeleteSubscriptionRequest {
5572 pub fn new() -> Self {
5573 std::default::Default::default()
5574 }
5575
5576 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5578 self.name = v.into();
5579 self
5580 }
5581}
5582
5583impl wkt::message::Message for DeleteSubscriptionRequest {
5584 fn typename() -> &'static str {
5585 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteSubscriptionRequest"
5586 }
5587}
5588
5589#[derive(Clone, Default, PartialEq)]
5591#[non_exhaustive]
5592pub struct OperationMetadata {
5593 pub create_time: std::option::Option<wkt::Timestamp>,
5595
5596 pub end_time: std::option::Option<wkt::Timestamp>,
5598
5599 pub target: std::string::String,
5601
5602 pub verb: std::string::String,
5604
5605 pub status_message: std::string::String,
5607
5608 pub requested_cancellation: bool,
5616
5617 pub api_version: std::string::String,
5619
5620 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5621}
5622
5623impl OperationMetadata {
5624 pub fn new() -> Self {
5625 std::default::Default::default()
5626 }
5627
5628 pub fn set_create_time<T>(mut self, v: T) -> Self
5630 where
5631 T: std::convert::Into<wkt::Timestamp>,
5632 {
5633 self.create_time = std::option::Option::Some(v.into());
5634 self
5635 }
5636
5637 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5639 where
5640 T: std::convert::Into<wkt::Timestamp>,
5641 {
5642 self.create_time = v.map(|x| x.into());
5643 self
5644 }
5645
5646 pub fn set_end_time<T>(mut self, v: T) -> Self
5648 where
5649 T: std::convert::Into<wkt::Timestamp>,
5650 {
5651 self.end_time = std::option::Option::Some(v.into());
5652 self
5653 }
5654
5655 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5657 where
5658 T: std::convert::Into<wkt::Timestamp>,
5659 {
5660 self.end_time = v.map(|x| x.into());
5661 self
5662 }
5663
5664 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5666 self.target = v.into();
5667 self
5668 }
5669
5670 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5672 self.verb = v.into();
5673 self
5674 }
5675
5676 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5678 self.status_message = v.into();
5679 self
5680 }
5681
5682 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5684 self.requested_cancellation = v.into();
5685 self
5686 }
5687
5688 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5690 self.api_version = v.into();
5691 self
5692 }
5693}
5694
5695impl wkt::message::Message for OperationMetadata {
5696 fn typename() -> &'static str {
5697 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.OperationMetadata"
5698 }
5699}
5700
5701#[derive(Clone, Default, PartialEq)]
5707#[non_exhaustive]
5708pub struct PubSubSubscription {
5709 pub name: std::string::String,
5712
5713 pub push_config: std::option::Option<crate::model::PushConfig>,
5716
5717 pub bigquery_config: std::option::Option<crate::model::BigQueryConfig>,
5720
5721 pub cloud_storage_config: std::option::Option<crate::model::CloudStorageConfig>,
5724
5725 pub ack_deadline_seconds: i32,
5746
5747 pub retain_acked_messages: bool,
5754
5755 pub message_retention_duration: std::option::Option<wkt::Duration>,
5761
5762 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5765
5766 pub enable_message_ordering: bool,
5771
5772 pub expiration_policy: std::option::Option<crate::model::ExpirationPolicy>,
5780
5781 pub filter: std::string::String,
5787
5788 pub dead_letter_policy: std::option::Option<crate::model::DeadLetterPolicy>,
5797
5798 pub retry_policy: std::option::Option<crate::model::RetryPolicy>,
5806
5807 pub detached: bool,
5813
5814 pub enable_exactly_once_delivery: bool,
5827
5828 pub message_transforms: std::vec::Vec<crate::model::MessageTransform>,
5831
5832 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
5837
5838 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5839}
5840
5841impl PubSubSubscription {
5842 pub fn new() -> Self {
5843 std::default::Default::default()
5844 }
5845
5846 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5848 self.name = v.into();
5849 self
5850 }
5851
5852 pub fn set_push_config<T>(mut self, v: T) -> Self
5854 where
5855 T: std::convert::Into<crate::model::PushConfig>,
5856 {
5857 self.push_config = std::option::Option::Some(v.into());
5858 self
5859 }
5860
5861 pub fn set_or_clear_push_config<T>(mut self, v: std::option::Option<T>) -> Self
5863 where
5864 T: std::convert::Into<crate::model::PushConfig>,
5865 {
5866 self.push_config = v.map(|x| x.into());
5867 self
5868 }
5869
5870 pub fn set_bigquery_config<T>(mut self, v: T) -> Self
5872 where
5873 T: std::convert::Into<crate::model::BigQueryConfig>,
5874 {
5875 self.bigquery_config = std::option::Option::Some(v.into());
5876 self
5877 }
5878
5879 pub fn set_or_clear_bigquery_config<T>(mut self, v: std::option::Option<T>) -> Self
5881 where
5882 T: std::convert::Into<crate::model::BigQueryConfig>,
5883 {
5884 self.bigquery_config = v.map(|x| x.into());
5885 self
5886 }
5887
5888 pub fn set_cloud_storage_config<T>(mut self, v: T) -> Self
5890 where
5891 T: std::convert::Into<crate::model::CloudStorageConfig>,
5892 {
5893 self.cloud_storage_config = std::option::Option::Some(v.into());
5894 self
5895 }
5896
5897 pub fn set_or_clear_cloud_storage_config<T>(mut self, v: std::option::Option<T>) -> Self
5899 where
5900 T: std::convert::Into<crate::model::CloudStorageConfig>,
5901 {
5902 self.cloud_storage_config = v.map(|x| x.into());
5903 self
5904 }
5905
5906 pub fn set_ack_deadline_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5908 self.ack_deadline_seconds = v.into();
5909 self
5910 }
5911
5912 pub fn set_retain_acked_messages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5914 self.retain_acked_messages = v.into();
5915 self
5916 }
5917
5918 pub fn set_message_retention_duration<T>(mut self, v: T) -> Self
5920 where
5921 T: std::convert::Into<wkt::Duration>,
5922 {
5923 self.message_retention_duration = std::option::Option::Some(v.into());
5924 self
5925 }
5926
5927 pub fn set_or_clear_message_retention_duration<T>(mut self, v: std::option::Option<T>) -> Self
5929 where
5930 T: std::convert::Into<wkt::Duration>,
5931 {
5932 self.message_retention_duration = v.map(|x| x.into());
5933 self
5934 }
5935
5936 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5938 where
5939 T: std::iter::IntoIterator<Item = (K, V)>,
5940 K: std::convert::Into<std::string::String>,
5941 V: std::convert::Into<std::string::String>,
5942 {
5943 use std::iter::Iterator;
5944 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5945 self
5946 }
5947
5948 pub fn set_enable_message_ordering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5950 self.enable_message_ordering = v.into();
5951 self
5952 }
5953
5954 pub fn set_expiration_policy<T>(mut self, v: T) -> Self
5956 where
5957 T: std::convert::Into<crate::model::ExpirationPolicy>,
5958 {
5959 self.expiration_policy = std::option::Option::Some(v.into());
5960 self
5961 }
5962
5963 pub fn set_or_clear_expiration_policy<T>(mut self, v: std::option::Option<T>) -> Self
5965 where
5966 T: std::convert::Into<crate::model::ExpirationPolicy>,
5967 {
5968 self.expiration_policy = v.map(|x| x.into());
5969 self
5970 }
5971
5972 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5974 self.filter = v.into();
5975 self
5976 }
5977
5978 pub fn set_dead_letter_policy<T>(mut self, v: T) -> Self
5980 where
5981 T: std::convert::Into<crate::model::DeadLetterPolicy>,
5982 {
5983 self.dead_letter_policy = std::option::Option::Some(v.into());
5984 self
5985 }
5986
5987 pub fn set_or_clear_dead_letter_policy<T>(mut self, v: std::option::Option<T>) -> Self
5989 where
5990 T: std::convert::Into<crate::model::DeadLetterPolicy>,
5991 {
5992 self.dead_letter_policy = v.map(|x| x.into());
5993 self
5994 }
5995
5996 pub fn set_retry_policy<T>(mut self, v: T) -> Self
5998 where
5999 T: std::convert::Into<crate::model::RetryPolicy>,
6000 {
6001 self.retry_policy = std::option::Option::Some(v.into());
6002 self
6003 }
6004
6005 pub fn set_or_clear_retry_policy<T>(mut self, v: std::option::Option<T>) -> Self
6007 where
6008 T: std::convert::Into<crate::model::RetryPolicy>,
6009 {
6010 self.retry_policy = v.map(|x| x.into());
6011 self
6012 }
6013
6014 pub fn set_detached<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6016 self.detached = v.into();
6017 self
6018 }
6019
6020 pub fn set_enable_exactly_once_delivery<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6022 self.enable_exactly_once_delivery = v.into();
6023 self
6024 }
6025
6026 pub fn set_message_transforms<T, V>(mut self, v: T) -> Self
6028 where
6029 T: std::iter::IntoIterator<Item = V>,
6030 V: std::convert::Into<crate::model::MessageTransform>,
6031 {
6032 use std::iter::Iterator;
6033 self.message_transforms = v.into_iter().map(|i| i.into()).collect();
6034 self
6035 }
6036
6037 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
6039 where
6040 T: std::iter::IntoIterator<Item = (K, V)>,
6041 K: std::convert::Into<std::string::String>,
6042 V: std::convert::Into<std::string::String>,
6043 {
6044 use std::iter::Iterator;
6045 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6046 self
6047 }
6048}
6049
6050impl wkt::message::Message for PubSubSubscription {
6051 fn typename() -> &'static str {
6052 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PubSubSubscription"
6053 }
6054}
6055
6056#[derive(Clone, Default, PartialEq)]
6068#[non_exhaustive]
6069pub struct RetryPolicy {
6070 pub minimum_backoff: std::option::Option<wkt::Duration>,
6073
6074 pub maximum_backoff: std::option::Option<wkt::Duration>,
6078
6079 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6080}
6081
6082impl RetryPolicy {
6083 pub fn new() -> Self {
6084 std::default::Default::default()
6085 }
6086
6087 pub fn set_minimum_backoff<T>(mut self, v: T) -> Self
6089 where
6090 T: std::convert::Into<wkt::Duration>,
6091 {
6092 self.minimum_backoff = std::option::Option::Some(v.into());
6093 self
6094 }
6095
6096 pub fn set_or_clear_minimum_backoff<T>(mut self, v: std::option::Option<T>) -> Self
6098 where
6099 T: std::convert::Into<wkt::Duration>,
6100 {
6101 self.minimum_backoff = v.map(|x| x.into());
6102 self
6103 }
6104
6105 pub fn set_maximum_backoff<T>(mut self, v: T) -> Self
6107 where
6108 T: std::convert::Into<wkt::Duration>,
6109 {
6110 self.maximum_backoff = std::option::Option::Some(v.into());
6111 self
6112 }
6113
6114 pub fn set_or_clear_maximum_backoff<T>(mut self, v: std::option::Option<T>) -> Self
6116 where
6117 T: std::convert::Into<wkt::Duration>,
6118 {
6119 self.maximum_backoff = v.map(|x| x.into());
6120 self
6121 }
6122}
6123
6124impl wkt::message::Message for RetryPolicy {
6125 fn typename() -> &'static str {
6126 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RetryPolicy"
6127 }
6128}
6129
6130#[derive(Clone, Default, PartialEq)]
6136#[non_exhaustive]
6137pub struct DeadLetterPolicy {
6138 pub dead_letter_topic: std::string::String,
6148
6149 pub max_delivery_attempts: i32,
6163
6164 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6165}
6166
6167impl DeadLetterPolicy {
6168 pub fn new() -> Self {
6169 std::default::Default::default()
6170 }
6171
6172 pub fn set_dead_letter_topic<T: std::convert::Into<std::string::String>>(
6174 mut self,
6175 v: T,
6176 ) -> Self {
6177 self.dead_letter_topic = v.into();
6178 self
6179 }
6180
6181 pub fn set_max_delivery_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6183 self.max_delivery_attempts = v.into();
6184 self
6185 }
6186}
6187
6188impl wkt::message::Message for DeadLetterPolicy {
6189 fn typename() -> &'static str {
6190 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeadLetterPolicy"
6191 }
6192}
6193
6194#[derive(Clone, Default, PartialEq)]
6197#[non_exhaustive]
6198pub struct ExpirationPolicy {
6199 pub ttl: std::option::Option<wkt::Duration>,
6206
6207 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6208}
6209
6210impl ExpirationPolicy {
6211 pub fn new() -> Self {
6212 std::default::Default::default()
6213 }
6214
6215 pub fn set_ttl<T>(mut self, v: T) -> Self
6217 where
6218 T: std::convert::Into<wkt::Duration>,
6219 {
6220 self.ttl = std::option::Option::Some(v.into());
6221 self
6222 }
6223
6224 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
6226 where
6227 T: std::convert::Into<wkt::Duration>,
6228 {
6229 self.ttl = v.map(|x| x.into());
6230 self
6231 }
6232}
6233
6234impl wkt::message::Message for ExpirationPolicy {
6235 fn typename() -> &'static str {
6236 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ExpirationPolicy"
6237 }
6238}
6239
6240#[derive(Clone, Default, PartialEq)]
6242#[non_exhaustive]
6243pub struct PushConfig {
6244 pub push_endpoint: std::string::String,
6247
6248 pub attributes: std::collections::HashMap<std::string::String, std::string::String>,
6270
6271 pub authentication_method: std::option::Option<crate::model::push_config::AuthenticationMethod>,
6277
6278 pub wrapper: std::option::Option<crate::model::push_config::Wrapper>,
6281
6282 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6283}
6284
6285impl PushConfig {
6286 pub fn new() -> Self {
6287 std::default::Default::default()
6288 }
6289
6290 pub fn set_push_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6292 self.push_endpoint = v.into();
6293 self
6294 }
6295
6296 pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
6298 where
6299 T: std::iter::IntoIterator<Item = (K, V)>,
6300 K: std::convert::Into<std::string::String>,
6301 V: std::convert::Into<std::string::String>,
6302 {
6303 use std::iter::Iterator;
6304 self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6305 self
6306 }
6307
6308 pub fn set_authentication_method<
6313 T: std::convert::Into<std::option::Option<crate::model::push_config::AuthenticationMethod>>,
6314 >(
6315 mut self,
6316 v: T,
6317 ) -> Self {
6318 self.authentication_method = v.into();
6319 self
6320 }
6321
6322 pub fn oidc_token(
6326 &self,
6327 ) -> std::option::Option<&std::boxed::Box<crate::model::push_config::OidcToken>> {
6328 #[allow(unreachable_patterns)]
6329 self.authentication_method.as_ref().and_then(|v| match v {
6330 crate::model::push_config::AuthenticationMethod::OidcToken(v) => {
6331 std::option::Option::Some(v)
6332 }
6333 _ => std::option::Option::None,
6334 })
6335 }
6336
6337 pub fn set_oidc_token<
6343 T: std::convert::Into<std::boxed::Box<crate::model::push_config::OidcToken>>,
6344 >(
6345 mut self,
6346 v: T,
6347 ) -> Self {
6348 self.authentication_method = std::option::Option::Some(
6349 crate::model::push_config::AuthenticationMethod::OidcToken(v.into()),
6350 );
6351 self
6352 }
6353
6354 pub fn set_wrapper<
6359 T: std::convert::Into<std::option::Option<crate::model::push_config::Wrapper>>,
6360 >(
6361 mut self,
6362 v: T,
6363 ) -> Self {
6364 self.wrapper = v.into();
6365 self
6366 }
6367
6368 pub fn pubsub_wrapper(
6372 &self,
6373 ) -> std::option::Option<&std::boxed::Box<crate::model::push_config::PubsubWrapper>> {
6374 #[allow(unreachable_patterns)]
6375 self.wrapper.as_ref().and_then(|v| match v {
6376 crate::model::push_config::Wrapper::PubsubWrapper(v) => std::option::Option::Some(v),
6377 _ => std::option::Option::None,
6378 })
6379 }
6380
6381 pub fn set_pubsub_wrapper<
6387 T: std::convert::Into<std::boxed::Box<crate::model::push_config::PubsubWrapper>>,
6388 >(
6389 mut self,
6390 v: T,
6391 ) -> Self {
6392 self.wrapper =
6393 std::option::Option::Some(crate::model::push_config::Wrapper::PubsubWrapper(v.into()));
6394 self
6395 }
6396
6397 pub fn no_wrapper(
6401 &self,
6402 ) -> std::option::Option<&std::boxed::Box<crate::model::push_config::NoWrapper>> {
6403 #[allow(unreachable_patterns)]
6404 self.wrapper.as_ref().and_then(|v| match v {
6405 crate::model::push_config::Wrapper::NoWrapper(v) => std::option::Option::Some(v),
6406 _ => std::option::Option::None,
6407 })
6408 }
6409
6410 pub fn set_no_wrapper<
6416 T: std::convert::Into<std::boxed::Box<crate::model::push_config::NoWrapper>>,
6417 >(
6418 mut self,
6419 v: T,
6420 ) -> Self {
6421 self.wrapper =
6422 std::option::Option::Some(crate::model::push_config::Wrapper::NoWrapper(v.into()));
6423 self
6424 }
6425}
6426
6427impl wkt::message::Message for PushConfig {
6428 fn typename() -> &'static str {
6429 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig"
6430 }
6431}
6432
6433pub mod push_config {
6435 #[allow(unused_imports)]
6436 use super::*;
6437
6438 #[derive(Clone, Default, PartialEq)]
6442 #[non_exhaustive]
6443 pub struct OidcToken {
6444 pub service_account_email: std::string::String,
6450
6451 pub audience: std::string::String,
6459
6460 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6461 }
6462
6463 impl OidcToken {
6464 pub fn new() -> Self {
6465 std::default::Default::default()
6466 }
6467
6468 pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
6470 mut self,
6471 v: T,
6472 ) -> Self {
6473 self.service_account_email = v.into();
6474 self
6475 }
6476
6477 pub fn set_audience<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6479 self.audience = v.into();
6480 self
6481 }
6482 }
6483
6484 impl wkt::message::Message for OidcToken {
6485 fn typename() -> &'static str {
6486 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig.OidcToken"
6487 }
6488 }
6489
6490 #[derive(Clone, Default, PartialEq)]
6494 #[non_exhaustive]
6495 pub struct PubsubWrapper {
6496 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6497 }
6498
6499 impl PubsubWrapper {
6500 pub fn new() -> Self {
6501 std::default::Default::default()
6502 }
6503 }
6504
6505 impl wkt::message::Message for PubsubWrapper {
6506 fn typename() -> &'static str {
6507 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig.PubsubWrapper"
6508 }
6509 }
6510
6511 #[derive(Clone, Default, PartialEq)]
6513 #[non_exhaustive]
6514 pub struct NoWrapper {
6515 pub write_metadata: bool,
6519
6520 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6521 }
6522
6523 impl NoWrapper {
6524 pub fn new() -> Self {
6525 std::default::Default::default()
6526 }
6527
6528 pub fn set_write_metadata<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6530 self.write_metadata = v.into();
6531 self
6532 }
6533 }
6534
6535 impl wkt::message::Message for NoWrapper {
6536 fn typename() -> &'static str {
6537 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig.NoWrapper"
6538 }
6539 }
6540
6541 #[derive(Clone, Debug, PartialEq)]
6547 #[non_exhaustive]
6548 pub enum AuthenticationMethod {
6549 OidcToken(std::boxed::Box<crate::model::push_config::OidcToken>),
6553 }
6554
6555 #[derive(Clone, Debug, PartialEq)]
6558 #[non_exhaustive]
6559 pub enum Wrapper {
6560 PubsubWrapper(std::boxed::Box<crate::model::push_config::PubsubWrapper>),
6564 NoWrapper(std::boxed::Box<crate::model::push_config::NoWrapper>),
6566 }
6567}
6568
6569#[derive(Clone, Default, PartialEq)]
6571#[non_exhaustive]
6572pub struct BigQueryConfig {
6573 pub table: std::string::String,
6576
6577 pub use_topic_schema: bool,
6581
6582 pub write_metadata: bool,
6588
6589 pub drop_unknown_fields: bool,
6595
6596 pub use_table_schema: bool,
6600
6601 pub service_account_email: std::string::String,
6608
6609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6610}
6611
6612impl BigQueryConfig {
6613 pub fn new() -> Self {
6614 std::default::Default::default()
6615 }
6616
6617 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6619 self.table = v.into();
6620 self
6621 }
6622
6623 pub fn set_use_topic_schema<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6625 self.use_topic_schema = v.into();
6626 self
6627 }
6628
6629 pub fn set_write_metadata<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6631 self.write_metadata = v.into();
6632 self
6633 }
6634
6635 pub fn set_drop_unknown_fields<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6637 self.drop_unknown_fields = v.into();
6638 self
6639 }
6640
6641 pub fn set_use_table_schema<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6643 self.use_table_schema = v.into();
6644 self
6645 }
6646
6647 pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
6649 mut self,
6650 v: T,
6651 ) -> Self {
6652 self.service_account_email = v.into();
6653 self
6654 }
6655}
6656
6657impl wkt::message::Message for BigQueryConfig {
6658 fn typename() -> &'static str {
6659 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.BigQueryConfig"
6660 }
6661}
6662
6663#[derive(Clone, Default, PartialEq)]
6665#[non_exhaustive]
6666pub struct CloudStorageConfig {
6667 pub bucket: std::string::String,
6672
6673 pub filename_prefix: std::string::String,
6676
6677 pub filename_suffix: std::string::String,
6681
6682 pub filename_datetime_format: std::string::String,
6686
6687 pub max_duration: std::option::Option<wkt::Duration>,
6696
6697 pub max_bytes: i64,
6701
6702 pub max_messages: i64,
6705
6706 pub service_account_email: std::string::String,
6713
6714 pub output_format: std::option::Option<crate::model::cloud_storage_config::OutputFormat>,
6716
6717 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6718}
6719
6720impl CloudStorageConfig {
6721 pub fn new() -> Self {
6722 std::default::Default::default()
6723 }
6724
6725 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6727 self.bucket = v.into();
6728 self
6729 }
6730
6731 pub fn set_filename_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6733 self.filename_prefix = v.into();
6734 self
6735 }
6736
6737 pub fn set_filename_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6739 self.filename_suffix = v.into();
6740 self
6741 }
6742
6743 pub fn set_filename_datetime_format<T: std::convert::Into<std::string::String>>(
6745 mut self,
6746 v: T,
6747 ) -> Self {
6748 self.filename_datetime_format = v.into();
6749 self
6750 }
6751
6752 pub fn set_max_duration<T>(mut self, v: T) -> Self
6754 where
6755 T: std::convert::Into<wkt::Duration>,
6756 {
6757 self.max_duration = std::option::Option::Some(v.into());
6758 self
6759 }
6760
6761 pub fn set_or_clear_max_duration<T>(mut self, v: std::option::Option<T>) -> Self
6763 where
6764 T: std::convert::Into<wkt::Duration>,
6765 {
6766 self.max_duration = v.map(|x| x.into());
6767 self
6768 }
6769
6770 pub fn set_max_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6772 self.max_bytes = v.into();
6773 self
6774 }
6775
6776 pub fn set_max_messages<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6778 self.max_messages = v.into();
6779 self
6780 }
6781
6782 pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
6784 mut self,
6785 v: T,
6786 ) -> Self {
6787 self.service_account_email = v.into();
6788 self
6789 }
6790
6791 pub fn set_output_format<
6796 T: std::convert::Into<std::option::Option<crate::model::cloud_storage_config::OutputFormat>>,
6797 >(
6798 mut self,
6799 v: T,
6800 ) -> Self {
6801 self.output_format = v.into();
6802 self
6803 }
6804
6805 pub fn text_config(
6809 &self,
6810 ) -> std::option::Option<&std::boxed::Box<crate::model::cloud_storage_config::TextConfig>> {
6811 #[allow(unreachable_patterns)]
6812 self.output_format.as_ref().and_then(|v| match v {
6813 crate::model::cloud_storage_config::OutputFormat::TextConfig(v) => {
6814 std::option::Option::Some(v)
6815 }
6816 _ => std::option::Option::None,
6817 })
6818 }
6819
6820 pub fn set_text_config<
6826 T: std::convert::Into<std::boxed::Box<crate::model::cloud_storage_config::TextConfig>>,
6827 >(
6828 mut self,
6829 v: T,
6830 ) -> Self {
6831 self.output_format = std::option::Option::Some(
6832 crate::model::cloud_storage_config::OutputFormat::TextConfig(v.into()),
6833 );
6834 self
6835 }
6836
6837 pub fn avro_config(
6841 &self,
6842 ) -> std::option::Option<&std::boxed::Box<crate::model::cloud_storage_config::AvroConfig>> {
6843 #[allow(unreachable_patterns)]
6844 self.output_format.as_ref().and_then(|v| match v {
6845 crate::model::cloud_storage_config::OutputFormat::AvroConfig(v) => {
6846 std::option::Option::Some(v)
6847 }
6848 _ => std::option::Option::None,
6849 })
6850 }
6851
6852 pub fn set_avro_config<
6858 T: std::convert::Into<std::boxed::Box<crate::model::cloud_storage_config::AvroConfig>>,
6859 >(
6860 mut self,
6861 v: T,
6862 ) -> Self {
6863 self.output_format = std::option::Option::Some(
6864 crate::model::cloud_storage_config::OutputFormat::AvroConfig(v.into()),
6865 );
6866 self
6867 }
6868}
6869
6870impl wkt::message::Message for CloudStorageConfig {
6871 fn typename() -> &'static str {
6872 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CloudStorageConfig"
6873 }
6874}
6875
6876pub mod cloud_storage_config {
6878 #[allow(unused_imports)]
6879 use super::*;
6880
6881 #[derive(Clone, Default, PartialEq)]
6885 #[non_exhaustive]
6886 pub struct TextConfig {
6887 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6888 }
6889
6890 impl TextConfig {
6891 pub fn new() -> Self {
6892 std::default::Default::default()
6893 }
6894 }
6895
6896 impl wkt::message::Message for TextConfig {
6897 fn typename() -> &'static str {
6898 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CloudStorageConfig.TextConfig"
6899 }
6900 }
6901
6902 #[derive(Clone, Default, PartialEq)]
6905 #[non_exhaustive]
6906 pub struct AvroConfig {
6907 pub write_metadata: bool,
6914
6915 pub use_topic_schema: bool,
6918
6919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6920 }
6921
6922 impl AvroConfig {
6923 pub fn new() -> Self {
6924 std::default::Default::default()
6925 }
6926
6927 pub fn set_write_metadata<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6929 self.write_metadata = v.into();
6930 self
6931 }
6932
6933 pub fn set_use_topic_schema<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6935 self.use_topic_schema = v.into();
6936 self
6937 }
6938 }
6939
6940 impl wkt::message::Message for AvroConfig {
6941 fn typename() -> &'static str {
6942 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CloudStorageConfig.AvroConfig"
6943 }
6944 }
6945
6946 #[derive(Clone, Debug, PartialEq)]
6948 #[non_exhaustive]
6949 pub enum OutputFormat {
6950 TextConfig(std::boxed::Box<crate::model::cloud_storage_config::TextConfig>),
6953 AvroConfig(std::boxed::Box<crate::model::cloud_storage_config::AvroConfig>),
6956 }
6957}
6958
6959#[derive(Clone, Default, PartialEq)]
6961#[non_exhaustive]
6962pub struct MessageTransform {
6963 #[deprecated]
6966 pub enabled: bool,
6967
6968 pub disabled: bool,
6971
6972 pub transform: std::option::Option<crate::model::message_transform::Transform>,
6974
6975 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6976}
6977
6978impl MessageTransform {
6979 pub fn new() -> Self {
6980 std::default::Default::default()
6981 }
6982
6983 #[deprecated]
6985 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6986 self.enabled = v.into();
6987 self
6988 }
6989
6990 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6992 self.disabled = v.into();
6993 self
6994 }
6995
6996 pub fn set_transform<
7001 T: std::convert::Into<std::option::Option<crate::model::message_transform::Transform>>,
7002 >(
7003 mut self,
7004 v: T,
7005 ) -> Self {
7006 self.transform = v.into();
7007 self
7008 }
7009
7010 pub fn javascript_udf(
7014 &self,
7015 ) -> std::option::Option<&std::boxed::Box<crate::model::JavaScriptUDF>> {
7016 #[allow(unreachable_patterns)]
7017 self.transform.as_ref().and_then(|v| match v {
7018 crate::model::message_transform::Transform::JavascriptUdf(v) => {
7019 std::option::Option::Some(v)
7020 }
7021 _ => std::option::Option::None,
7022 })
7023 }
7024
7025 pub fn set_javascript_udf<
7031 T: std::convert::Into<std::boxed::Box<crate::model::JavaScriptUDF>>,
7032 >(
7033 mut self,
7034 v: T,
7035 ) -> Self {
7036 self.transform = std::option::Option::Some(
7037 crate::model::message_transform::Transform::JavascriptUdf(v.into()),
7038 );
7039 self
7040 }
7041}
7042
7043impl wkt::message::Message for MessageTransform {
7044 fn typename() -> &'static str {
7045 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.MessageTransform"
7046 }
7047}
7048
7049pub mod message_transform {
7051 #[allow(unused_imports)]
7052 use super::*;
7053
7054 #[derive(Clone, Debug, PartialEq)]
7056 #[non_exhaustive]
7057 pub enum Transform {
7058 JavascriptUdf(std::boxed::Box<crate::model::JavaScriptUDF>),
7061 }
7062}
7063
7064#[derive(Clone, Default, PartialEq)]
7067#[non_exhaustive]
7068pub struct JavaScriptUDF {
7069 pub function_name: std::string::String,
7072
7073 pub code: std::string::String,
7104
7105 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7106}
7107
7108impl JavaScriptUDF {
7109 pub fn new() -> Self {
7110 std::default::Default::default()
7111 }
7112
7113 pub fn set_function_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7115 self.function_name = v.into();
7116 self
7117 }
7118
7119 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7121 self.code = v.into();
7122 self
7123 }
7124}
7125
7126impl wkt::message::Message for JavaScriptUDF {
7127 fn typename() -> &'static str {
7128 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.JavaScriptUDF"
7129 }
7130}
7131
7132#[derive(Clone, Debug, PartialEq)]
7150#[non_exhaustive]
7151pub enum DiscoveryType {
7152 Unspecified,
7154 Private,
7157 Public,
7160 UnknownValue(discovery_type::UnknownValue),
7165}
7166
7167#[doc(hidden)]
7168pub mod discovery_type {
7169 #[allow(unused_imports)]
7170 use super::*;
7171 #[derive(Clone, Debug, PartialEq)]
7172 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7173}
7174
7175impl DiscoveryType {
7176 pub fn value(&self) -> std::option::Option<i32> {
7181 match self {
7182 Self::Unspecified => std::option::Option::Some(0),
7183 Self::Private => std::option::Option::Some(1),
7184 Self::Public => std::option::Option::Some(2),
7185 Self::UnknownValue(u) => u.0.value(),
7186 }
7187 }
7188
7189 pub fn name(&self) -> std::option::Option<&str> {
7194 match self {
7195 Self::Unspecified => std::option::Option::Some("DISCOVERY_TYPE_UNSPECIFIED"),
7196 Self::Private => std::option::Option::Some("DISCOVERY_TYPE_PRIVATE"),
7197 Self::Public => std::option::Option::Some("DISCOVERY_TYPE_PUBLIC"),
7198 Self::UnknownValue(u) => u.0.name(),
7199 }
7200 }
7201}
7202
7203impl std::default::Default for DiscoveryType {
7204 fn default() -> Self {
7205 use std::convert::From;
7206 Self::from(0)
7207 }
7208}
7209
7210impl std::fmt::Display for DiscoveryType {
7211 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7212 wkt::internal::display_enum(f, self.name(), self.value())
7213 }
7214}
7215
7216impl std::convert::From<i32> for DiscoveryType {
7217 fn from(value: i32) -> Self {
7218 match value {
7219 0 => Self::Unspecified,
7220 1 => Self::Private,
7221 2 => Self::Public,
7222 _ => Self::UnknownValue(discovery_type::UnknownValue(
7223 wkt::internal::UnknownEnumValue::Integer(value),
7224 )),
7225 }
7226 }
7227}
7228
7229impl std::convert::From<&str> for DiscoveryType {
7230 fn from(value: &str) -> Self {
7231 use std::string::ToString;
7232 match value {
7233 "DISCOVERY_TYPE_UNSPECIFIED" => Self::Unspecified,
7234 "DISCOVERY_TYPE_PRIVATE" => Self::Private,
7235 "DISCOVERY_TYPE_PUBLIC" => Self::Public,
7236 _ => Self::UnknownValue(discovery_type::UnknownValue(
7237 wkt::internal::UnknownEnumValue::String(value.to_string()),
7238 )),
7239 }
7240 }
7241}
7242
7243impl serde::ser::Serialize for DiscoveryType {
7244 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7245 where
7246 S: serde::Serializer,
7247 {
7248 match self {
7249 Self::Unspecified => serializer.serialize_i32(0),
7250 Self::Private => serializer.serialize_i32(1),
7251 Self::Public => serializer.serialize_i32(2),
7252 Self::UnknownValue(u) => u.0.serialize(serializer),
7253 }
7254 }
7255}
7256
7257impl<'de> serde::de::Deserialize<'de> for DiscoveryType {
7258 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7259 where
7260 D: serde::Deserializer<'de>,
7261 {
7262 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DiscoveryType>::new(
7263 ".google.cloud.bigquery.analyticshub.v1.DiscoveryType",
7264 ))
7265 }
7266}
7267
7268#[derive(Clone, Debug, PartialEq)]
7284#[non_exhaustive]
7285pub enum SharedResourceType {
7286 Unspecified,
7288 BigqueryDataset,
7290 PubsubTopic,
7292 UnknownValue(shared_resource_type::UnknownValue),
7297}
7298
7299#[doc(hidden)]
7300pub mod shared_resource_type {
7301 #[allow(unused_imports)]
7302 use super::*;
7303 #[derive(Clone, Debug, PartialEq)]
7304 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7305}
7306
7307impl SharedResourceType {
7308 pub fn value(&self) -> std::option::Option<i32> {
7313 match self {
7314 Self::Unspecified => std::option::Option::Some(0),
7315 Self::BigqueryDataset => std::option::Option::Some(1),
7316 Self::PubsubTopic => std::option::Option::Some(2),
7317 Self::UnknownValue(u) => u.0.value(),
7318 }
7319 }
7320
7321 pub fn name(&self) -> std::option::Option<&str> {
7326 match self {
7327 Self::Unspecified => std::option::Option::Some("SHARED_RESOURCE_TYPE_UNSPECIFIED"),
7328 Self::BigqueryDataset => std::option::Option::Some("BIGQUERY_DATASET"),
7329 Self::PubsubTopic => std::option::Option::Some("PUBSUB_TOPIC"),
7330 Self::UnknownValue(u) => u.0.name(),
7331 }
7332 }
7333}
7334
7335impl std::default::Default for SharedResourceType {
7336 fn default() -> Self {
7337 use std::convert::From;
7338 Self::from(0)
7339 }
7340}
7341
7342impl std::fmt::Display for SharedResourceType {
7343 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7344 wkt::internal::display_enum(f, self.name(), self.value())
7345 }
7346}
7347
7348impl std::convert::From<i32> for SharedResourceType {
7349 fn from(value: i32) -> Self {
7350 match value {
7351 0 => Self::Unspecified,
7352 1 => Self::BigqueryDataset,
7353 2 => Self::PubsubTopic,
7354 _ => Self::UnknownValue(shared_resource_type::UnknownValue(
7355 wkt::internal::UnknownEnumValue::Integer(value),
7356 )),
7357 }
7358 }
7359}
7360
7361impl std::convert::From<&str> for SharedResourceType {
7362 fn from(value: &str) -> Self {
7363 use std::string::ToString;
7364 match value {
7365 "SHARED_RESOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
7366 "BIGQUERY_DATASET" => Self::BigqueryDataset,
7367 "PUBSUB_TOPIC" => Self::PubsubTopic,
7368 _ => Self::UnknownValue(shared_resource_type::UnknownValue(
7369 wkt::internal::UnknownEnumValue::String(value.to_string()),
7370 )),
7371 }
7372 }
7373}
7374
7375impl serde::ser::Serialize for SharedResourceType {
7376 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7377 where
7378 S: serde::Serializer,
7379 {
7380 match self {
7381 Self::Unspecified => serializer.serialize_i32(0),
7382 Self::BigqueryDataset => serializer.serialize_i32(1),
7383 Self::PubsubTopic => serializer.serialize_i32(2),
7384 Self::UnknownValue(u) => u.0.serialize(serializer),
7385 }
7386 }
7387}
7388
7389impl<'de> serde::de::Deserialize<'de> for SharedResourceType {
7390 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7391 where
7392 D: serde::Deserializer<'de>,
7393 {
7394 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SharedResourceType>::new(
7395 ".google.cloud.bigquery.analyticshub.v1.SharedResourceType",
7396 ))
7397 }
7398}