1#![allow(rustdoc::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21
22mod debug;
23mod deserialize;
24mod serialize;
25
26#[derive(Clone, Default, PartialEq)]
33#[non_exhaustive]
34pub struct ArrowSchema {
35 pub serialized_schema: ::bytes::Bytes,
37
38 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
39}
40
41impl ArrowSchema {
42 pub fn new() -> Self {
44 std::default::Default::default()
45 }
46
47 pub fn set_serialized_schema<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
49 self.serialized_schema = v.into();
50 self
51 }
52}
53
54impl wkt::message::Message for ArrowSchema {
55 fn typename() -> &'static str {
56 "type.googleapis.com/google.cloud.bigquery.storage.v1.ArrowSchema"
57 }
58}
59
60#[derive(Clone, Default, PartialEq)]
62#[non_exhaustive]
63pub struct ArrowRecordBatch {
64 pub serialized_record_batch: ::bytes::Bytes,
66
67 #[deprecated]
70 pub row_count: i64,
71
72 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
73}
74
75impl ArrowRecordBatch {
76 pub fn new() -> Self {
78 std::default::Default::default()
79 }
80
81 pub fn set_serialized_record_batch<T: std::convert::Into<::bytes::Bytes>>(
83 mut self,
84 v: T,
85 ) -> Self {
86 self.serialized_record_batch = v.into();
87 self
88 }
89
90 #[deprecated]
92 pub fn set_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
93 self.row_count = v.into();
94 self
95 }
96}
97
98impl wkt::message::Message for ArrowRecordBatch {
99 fn typename() -> &'static str {
100 "type.googleapis.com/google.cloud.bigquery.storage.v1.ArrowRecordBatch"
101 }
102}
103
104#[derive(Clone, Default, PartialEq)]
106#[non_exhaustive]
107pub struct ArrowSerializationOptions {
108
109 pub buffer_compression: crate::write::generated::gapic_storage::model::arrow_serialization_options::CompressionCodec,
112
113 pub picos_timestamp_precision: crate::write::generated::gapic_storage::model::arrow_serialization_options::PicosTimestampPrecision,
116
117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
118}
119
120impl ArrowSerializationOptions {
121 pub fn new() -> Self {
123 std::default::Default::default()
124 }
125
126 pub fn set_buffer_compression<T: std::convert::Into<crate::write::generated::gapic_storage::model::arrow_serialization_options::CompressionCodec>>(mut self, v: T) -> Self{
128 self.buffer_compression = v.into();
129 self
130 }
131
132 pub fn set_picos_timestamp_precision<T: std::convert::Into<crate::write::generated::gapic_storage::model::arrow_serialization_options::PicosTimestampPrecision>>(mut self, v: T) -> Self{
134 self.picos_timestamp_precision = v.into();
135 self
136 }
137}
138
139impl wkt::message::Message for ArrowSerializationOptions {
140 fn typename() -> &'static str {
141 "type.googleapis.com/google.cloud.bigquery.storage.v1.ArrowSerializationOptions"
142 }
143}
144
145pub mod arrow_serialization_options {
147 #[allow(unused_imports)]
148 use super::*;
149
150 #[derive(Clone, Debug, PartialEq)]
166 #[non_exhaustive]
167 pub enum CompressionCodec {
168 CompressionUnspecified,
170 Lz4Frame,
172 Zstd,
174 UnknownValue(compression_codec::UnknownValue),
179 }
180
181 #[doc(hidden)]
182 pub mod compression_codec {
183 #[allow(unused_imports)]
184 use super::*;
185 #[derive(Clone, Debug, PartialEq)]
186 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
187 }
188
189 impl CompressionCodec {
190 pub fn value(&self) -> std::option::Option<i32> {
195 match self {
196 Self::CompressionUnspecified => std::option::Option::Some(0),
197 Self::Lz4Frame => std::option::Option::Some(1),
198 Self::Zstd => std::option::Option::Some(2),
199 Self::UnknownValue(u) => u.0.value(),
200 }
201 }
202
203 pub fn name(&self) -> std::option::Option<&str> {
208 match self {
209 Self::CompressionUnspecified => {
210 std::option::Option::Some("COMPRESSION_UNSPECIFIED")
211 }
212 Self::Lz4Frame => std::option::Option::Some("LZ4_FRAME"),
213 Self::Zstd => std::option::Option::Some("ZSTD"),
214 Self::UnknownValue(u) => u.0.name(),
215 }
216 }
217 }
218
219 impl std::default::Default for CompressionCodec {
220 fn default() -> Self {
221 use std::convert::From;
222 Self::from(0)
223 }
224 }
225
226 impl std::fmt::Display for CompressionCodec {
227 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
228 wkt::internal::display_enum(f, self.name(), self.value())
229 }
230 }
231
232 impl std::convert::From<i32> for CompressionCodec {
233 fn from(value: i32) -> Self {
234 match value {
235 0 => Self::CompressionUnspecified,
236 1 => Self::Lz4Frame,
237 2 => Self::Zstd,
238 _ => Self::UnknownValue(compression_codec::UnknownValue(
239 wkt::internal::UnknownEnumValue::Integer(value),
240 )),
241 }
242 }
243 }
244
245 impl std::convert::From<&str> for CompressionCodec {
246 fn from(value: &str) -> Self {
247 use std::string::ToString;
248 match value {
249 "COMPRESSION_UNSPECIFIED" => Self::CompressionUnspecified,
250 "LZ4_FRAME" => Self::Lz4Frame,
251 "ZSTD" => Self::Zstd,
252 _ => Self::UnknownValue(compression_codec::UnknownValue(
253 wkt::internal::UnknownEnumValue::String(value.to_string()),
254 )),
255 }
256 }
257 }
258
259 impl serde::ser::Serialize for CompressionCodec {
260 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
261 where
262 S: serde::Serializer,
263 {
264 match self {
265 Self::CompressionUnspecified => serializer.serialize_i32(0),
266 Self::Lz4Frame => serializer.serialize_i32(1),
267 Self::Zstd => serializer.serialize_i32(2),
268 Self::UnknownValue(u) => u.0.serialize(serializer),
269 }
270 }
271 }
272
273 impl<'de> serde::de::Deserialize<'de> for CompressionCodec {
274 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
275 where
276 D: serde::Deserializer<'de>,
277 {
278 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CompressionCodec>::new(
279 ".google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec",
280 ))
281 }
282 }
283
284 #[derive(Clone, Debug, PartialEq)]
301 #[non_exhaustive]
302 pub enum PicosTimestampPrecision {
303 Unspecified,
305 TimestampPrecisionMicros,
309 TimestampPrecisionNanos,
313 TimestampPrecisionPicos,
316 UnknownValue(picos_timestamp_precision::UnknownValue),
321 }
322
323 #[doc(hidden)]
324 pub mod picos_timestamp_precision {
325 #[allow(unused_imports)]
326 use super::*;
327 #[derive(Clone, Debug, PartialEq)]
328 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
329 }
330
331 impl PicosTimestampPrecision {
332 pub fn value(&self) -> std::option::Option<i32> {
337 match self {
338 Self::Unspecified => std::option::Option::Some(0),
339 Self::TimestampPrecisionMicros => std::option::Option::Some(1),
340 Self::TimestampPrecisionNanos => std::option::Option::Some(2),
341 Self::TimestampPrecisionPicos => std::option::Option::Some(3),
342 Self::UnknownValue(u) => u.0.value(),
343 }
344 }
345
346 pub fn name(&self) -> std::option::Option<&str> {
351 match self {
352 Self::Unspecified => {
353 std::option::Option::Some("PICOS_TIMESTAMP_PRECISION_UNSPECIFIED")
354 }
355 Self::TimestampPrecisionMicros => {
356 std::option::Option::Some("TIMESTAMP_PRECISION_MICROS")
357 }
358 Self::TimestampPrecisionNanos => {
359 std::option::Option::Some("TIMESTAMP_PRECISION_NANOS")
360 }
361 Self::TimestampPrecisionPicos => {
362 std::option::Option::Some("TIMESTAMP_PRECISION_PICOS")
363 }
364 Self::UnknownValue(u) => u.0.name(),
365 }
366 }
367 }
368
369 impl std::default::Default for PicosTimestampPrecision {
370 fn default() -> Self {
371 use std::convert::From;
372 Self::from(0)
373 }
374 }
375
376 impl std::fmt::Display for PicosTimestampPrecision {
377 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
378 wkt::internal::display_enum(f, self.name(), self.value())
379 }
380 }
381
382 impl std::convert::From<i32> for PicosTimestampPrecision {
383 fn from(value: i32) -> Self {
384 match value {
385 0 => Self::Unspecified,
386 1 => Self::TimestampPrecisionMicros,
387 2 => Self::TimestampPrecisionNanos,
388 3 => Self::TimestampPrecisionPicos,
389 _ => Self::UnknownValue(picos_timestamp_precision::UnknownValue(
390 wkt::internal::UnknownEnumValue::Integer(value),
391 )),
392 }
393 }
394 }
395
396 impl std::convert::From<&str> for PicosTimestampPrecision {
397 fn from(value: &str) -> Self {
398 use std::string::ToString;
399 match value {
400 "PICOS_TIMESTAMP_PRECISION_UNSPECIFIED" => Self::Unspecified,
401 "TIMESTAMP_PRECISION_MICROS" => Self::TimestampPrecisionMicros,
402 "TIMESTAMP_PRECISION_NANOS" => Self::TimestampPrecisionNanos,
403 "TIMESTAMP_PRECISION_PICOS" => Self::TimestampPrecisionPicos,
404 _ => Self::UnknownValue(picos_timestamp_precision::UnknownValue(
405 wkt::internal::UnknownEnumValue::String(value.to_string()),
406 )),
407 }
408 }
409 }
410
411 impl serde::ser::Serialize for PicosTimestampPrecision {
412 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
413 where
414 S: serde::Serializer,
415 {
416 match self {
417 Self::Unspecified => serializer.serialize_i32(0),
418 Self::TimestampPrecisionMicros => serializer.serialize_i32(1),
419 Self::TimestampPrecisionNanos => serializer.serialize_i32(2),
420 Self::TimestampPrecisionPicos => serializer.serialize_i32(3),
421 Self::UnknownValue(u) => u.0.serialize(serializer),
422 }
423 }
424 }
425
426 impl<'de> serde::de::Deserialize<'de> for PicosTimestampPrecision {
427 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
428 where
429 D: serde::Deserializer<'de>,
430 {
431 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PicosTimestampPrecision>::new(
432 ".google.cloud.bigquery.storage.v1.ArrowSerializationOptions.PicosTimestampPrecision"))
433 }
434 }
435}
436
437#[derive(Clone, Default, PartialEq)]
439#[non_exhaustive]
440pub struct AvroSchema {
441 pub schema: std::string::String,
444
445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
446}
447
448impl AvroSchema {
449 pub fn new() -> Self {
451 std::default::Default::default()
452 }
453
454 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
456 self.schema = v.into();
457 self
458 }
459}
460
461impl wkt::message::Message for AvroSchema {
462 fn typename() -> &'static str {
463 "type.googleapis.com/google.cloud.bigquery.storage.v1.AvroSchema"
464 }
465}
466
467#[derive(Clone, Default, PartialEq)]
469#[non_exhaustive]
470pub struct AvroRows {
471 pub serialized_binary_rows: ::bytes::Bytes,
473
474 #[deprecated]
477 pub row_count: i64,
478
479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
480}
481
482impl AvroRows {
483 pub fn new() -> Self {
485 std::default::Default::default()
486 }
487
488 pub fn set_serialized_binary_rows<T: std::convert::Into<::bytes::Bytes>>(
490 mut self,
491 v: T,
492 ) -> Self {
493 self.serialized_binary_rows = v.into();
494 self
495 }
496
497 #[deprecated]
499 pub fn set_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
500 self.row_count = v.into();
501 self
502 }
503}
504
505impl wkt::message::Message for AvroRows {
506 fn typename() -> &'static str {
507 "type.googleapis.com/google.cloud.bigquery.storage.v1.AvroRows"
508 }
509}
510
511#[derive(Clone, Default, PartialEq)]
513#[non_exhaustive]
514pub struct AvroSerializationOptions {
515
516 pub enable_display_name_attribute: bool,
527
528 pub picos_timestamp_precision: crate::write::generated::gapic_storage::model::avro_serialization_options::PicosTimestampPrecision,
531
532 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
533}
534
535impl AvroSerializationOptions {
536 pub fn new() -> Self {
538 std::default::Default::default()
539 }
540
541 pub fn set_enable_display_name_attribute<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
543 self.enable_display_name_attribute = v.into();
544 self
545 }
546
547 pub fn set_picos_timestamp_precision<T: std::convert::Into<crate::write::generated::gapic_storage::model::avro_serialization_options::PicosTimestampPrecision>>(mut self, v: T) -> Self{
549 self.picos_timestamp_precision = v.into();
550 self
551 }
552}
553
554impl wkt::message::Message for AvroSerializationOptions {
555 fn typename() -> &'static str {
556 "type.googleapis.com/google.cloud.bigquery.storage.v1.AvroSerializationOptions"
557 }
558}
559
560pub mod avro_serialization_options {
562 #[allow(unused_imports)]
563 use super::*;
564
565 #[derive(Clone, Debug, PartialEq)]
582 #[non_exhaustive]
583 pub enum PicosTimestampPrecision {
584 Unspecified,
586 TimestampPrecisionMicros,
590 TimestampPrecisionNanos,
594 TimestampPrecisionPicos,
597 UnknownValue(picos_timestamp_precision::UnknownValue),
602 }
603
604 #[doc(hidden)]
605 pub mod picos_timestamp_precision {
606 #[allow(unused_imports)]
607 use super::*;
608 #[derive(Clone, Debug, PartialEq)]
609 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
610 }
611
612 impl PicosTimestampPrecision {
613 pub fn value(&self) -> std::option::Option<i32> {
618 match self {
619 Self::Unspecified => std::option::Option::Some(0),
620 Self::TimestampPrecisionMicros => std::option::Option::Some(1),
621 Self::TimestampPrecisionNanos => std::option::Option::Some(2),
622 Self::TimestampPrecisionPicos => std::option::Option::Some(3),
623 Self::UnknownValue(u) => u.0.value(),
624 }
625 }
626
627 pub fn name(&self) -> std::option::Option<&str> {
632 match self {
633 Self::Unspecified => {
634 std::option::Option::Some("PICOS_TIMESTAMP_PRECISION_UNSPECIFIED")
635 }
636 Self::TimestampPrecisionMicros => {
637 std::option::Option::Some("TIMESTAMP_PRECISION_MICROS")
638 }
639 Self::TimestampPrecisionNanos => {
640 std::option::Option::Some("TIMESTAMP_PRECISION_NANOS")
641 }
642 Self::TimestampPrecisionPicos => {
643 std::option::Option::Some("TIMESTAMP_PRECISION_PICOS")
644 }
645 Self::UnknownValue(u) => u.0.name(),
646 }
647 }
648 }
649
650 impl std::default::Default for PicosTimestampPrecision {
651 fn default() -> Self {
652 use std::convert::From;
653 Self::from(0)
654 }
655 }
656
657 impl std::fmt::Display for PicosTimestampPrecision {
658 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
659 wkt::internal::display_enum(f, self.name(), self.value())
660 }
661 }
662
663 impl std::convert::From<i32> for PicosTimestampPrecision {
664 fn from(value: i32) -> Self {
665 match value {
666 0 => Self::Unspecified,
667 1 => Self::TimestampPrecisionMicros,
668 2 => Self::TimestampPrecisionNanos,
669 3 => Self::TimestampPrecisionPicos,
670 _ => Self::UnknownValue(picos_timestamp_precision::UnknownValue(
671 wkt::internal::UnknownEnumValue::Integer(value),
672 )),
673 }
674 }
675 }
676
677 impl std::convert::From<&str> for PicosTimestampPrecision {
678 fn from(value: &str) -> Self {
679 use std::string::ToString;
680 match value {
681 "PICOS_TIMESTAMP_PRECISION_UNSPECIFIED" => Self::Unspecified,
682 "TIMESTAMP_PRECISION_MICROS" => Self::TimestampPrecisionMicros,
683 "TIMESTAMP_PRECISION_NANOS" => Self::TimestampPrecisionNanos,
684 "TIMESTAMP_PRECISION_PICOS" => Self::TimestampPrecisionPicos,
685 _ => Self::UnknownValue(picos_timestamp_precision::UnknownValue(
686 wkt::internal::UnknownEnumValue::String(value.to_string()),
687 )),
688 }
689 }
690 }
691
692 impl serde::ser::Serialize for PicosTimestampPrecision {
693 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
694 where
695 S: serde::Serializer,
696 {
697 match self {
698 Self::Unspecified => serializer.serialize_i32(0),
699 Self::TimestampPrecisionMicros => serializer.serialize_i32(1),
700 Self::TimestampPrecisionNanos => serializer.serialize_i32(2),
701 Self::TimestampPrecisionPicos => serializer.serialize_i32(3),
702 Self::UnknownValue(u) => u.0.serialize(serializer),
703 }
704 }
705 }
706
707 impl<'de> serde::de::Deserialize<'de> for PicosTimestampPrecision {
708 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
709 where
710 D: serde::Deserializer<'de>,
711 {
712 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PicosTimestampPrecision>::new(
713 ".google.cloud.bigquery.storage.v1.AvroSerializationOptions.PicosTimestampPrecision"))
714 }
715 }
716}
717
718#[derive(Clone, Default, PartialEq)]
720#[non_exhaustive]
721pub struct ProtoSchema {
722 pub proto_descriptor: std::option::Option<wkt::DescriptorProto>,
732
733 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
734}
735
736impl ProtoSchema {
737 pub fn new() -> Self {
739 std::default::Default::default()
740 }
741
742 pub fn set_proto_descriptor<T>(mut self, v: T) -> Self
744 where
745 T: std::convert::Into<wkt::DescriptorProto>,
746 {
747 self.proto_descriptor = std::option::Option::Some(v.into());
748 self
749 }
750
751 pub fn set_or_clear_proto_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
753 where
754 T: std::convert::Into<wkt::DescriptorProto>,
755 {
756 self.proto_descriptor = v.map(|x| x.into());
757 self
758 }
759}
760
761impl wkt::message::Message for ProtoSchema {
762 fn typename() -> &'static str {
763 "type.googleapis.com/google.cloud.bigquery.storage.v1.ProtoSchema"
764 }
765}
766
767#[allow(missing_docs)]
768#[derive(Clone, Default, PartialEq)]
769#[non_exhaustive]
770pub struct ProtoRows {
771 pub serialized_rows: std::vec::Vec<::bytes::Bytes>,
776
777 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
778}
779
780impl ProtoRows {
781 pub fn new() -> Self {
783 std::default::Default::default()
784 }
785
786 pub fn set_serialized_rows<T, V>(mut self, v: T) -> Self
788 where
789 T: std::iter::IntoIterator<Item = V>,
790 V: std::convert::Into<::bytes::Bytes>,
791 {
792 use std::iter::Iterator;
793 self.serialized_rows = v.into_iter().map(|i| i.into()).collect();
794 self
795 }
796}
797
798impl wkt::message::Message for ProtoRows {
799 fn typename() -> &'static str {
800 "type.googleapis.com/google.cloud.bigquery.storage.v1.ProtoRows"
801 }
802}
803
804#[derive(Clone, Default, PartialEq)]
806#[non_exhaustive]
807pub struct CreateReadSessionRequest {
808 pub parent: std::string::String,
811
812 pub read_session:
814 std::option::Option<crate::write::generated::gapic_storage::model::ReadSession>,
815
816 pub max_stream_count: i32,
827
828 pub preferred_min_stream_count: i32,
837
838 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
839}
840
841impl CreateReadSessionRequest {
842 pub fn new() -> Self {
844 std::default::Default::default()
845 }
846
847 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
849 self.parent = v.into();
850 self
851 }
852
853 pub fn set_read_session<T>(mut self, v: T) -> Self
855 where
856 T: std::convert::Into<crate::write::generated::gapic_storage::model::ReadSession>,
857 {
858 self.read_session = std::option::Option::Some(v.into());
859 self
860 }
861
862 pub fn set_or_clear_read_session<T>(mut self, v: std::option::Option<T>) -> Self
864 where
865 T: std::convert::Into<crate::write::generated::gapic_storage::model::ReadSession>,
866 {
867 self.read_session = v.map(|x| x.into());
868 self
869 }
870
871 pub fn set_max_stream_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
873 self.max_stream_count = v.into();
874 self
875 }
876
877 pub fn set_preferred_min_stream_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
879 self.preferred_min_stream_count = v.into();
880 self
881 }
882}
883
884impl wkt::message::Message for CreateReadSessionRequest {
885 fn typename() -> &'static str {
886 "type.googleapis.com/google.cloud.bigquery.storage.v1.CreateReadSessionRequest"
887 }
888}
889
890#[derive(Clone, Default, PartialEq)]
892#[non_exhaustive]
893pub struct ReadRowsRequest {
894
895 pub read_stream: std::string::String,
897
898 pub offset: i64,
902
903 pub output_format_serialization_options: std::option::Option<crate::write::generated::gapic_storage::model::read_rows_request::OutputFormatSerializationOptions>,
908
909 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
910}
911
912impl ReadRowsRequest {
913 pub fn new() -> Self {
915 std::default::Default::default()
916 }
917
918 pub fn set_read_stream<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
920 self.read_stream = v.into();
921 self
922 }
923
924 pub fn set_offset<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
926 self.offset = v.into();
927 self
928 }
929
930 pub fn set_output_format_serialization_options<T: std::convert::Into<std::option::Option<crate::write::generated::gapic_storage::model::read_rows_request::OutputFormatSerializationOptions>>>(mut self, v: T) -> Self
935 {
936 self.output_format_serialization_options = v.into();
937 self
938 }
939
940 pub fn arrow_serialization_options(
944 &self,
945 ) -> std::option::Option<
946 &std::boxed::Box<crate::write::generated::gapic_storage::model::ArrowSerializationOptions>,
947 > {
948 #[allow(unreachable_patterns)]
949 self.output_format_serialization_options.as_ref().and_then(|v| match v {
950 crate::write::generated::gapic_storage::model::read_rows_request::OutputFormatSerializationOptions::ArrowSerializationOptions(v) => std::option::Option::Some(v),
951 _ => std::option::Option::None,
952 })
953 }
954
955 pub fn set_arrow_serialization_options<
961 T: std::convert::Into<
962 std::boxed::Box<
963 crate::write::generated::gapic_storage::model::ArrowSerializationOptions,
964 >,
965 >,
966 >(
967 mut self,
968 v: T,
969 ) -> Self {
970 self.output_format_serialization_options = std::option::Option::Some(
971 crate::write::generated::gapic_storage::model::read_rows_request::OutputFormatSerializationOptions::ArrowSerializationOptions(
972 v.into()
973 )
974 );
975 self
976 }
977}
978
979impl wkt::message::Message for ReadRowsRequest {
980 fn typename() -> &'static str {
981 "type.googleapis.com/google.cloud.bigquery.storage.v1.ReadRowsRequest"
982 }
983}
984
985pub mod read_rows_request {
987 #[allow(unused_imports)]
988 use super::*;
989
990 #[derive(Clone, Debug, PartialEq)]
995 #[non_exhaustive]
996 pub enum OutputFormatSerializationOptions {
997 ArrowSerializationOptions(
1001 std::boxed::Box<
1002 crate::write::generated::gapic_storage::model::ArrowSerializationOptions,
1003 >,
1004 ),
1005 }
1006
1007 impl OutputFormatSerializationOptions {
1008 pub fn from_arrow_serialization_options(
1010 value: impl std::convert::Into<
1011 std::boxed::Box<
1012 crate::write::generated::gapic_storage::model::ArrowSerializationOptions,
1013 >,
1014 >,
1015 ) -> Self {
1016 Self::ArrowSerializationOptions(value.into())
1017 }
1018 }
1019}
1020
1021#[derive(Clone, Default, PartialEq)]
1023#[non_exhaustive]
1024pub struct ThrottleState {
1025 pub throttle_percent: i32,
1028
1029 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1030}
1031
1032impl ThrottleState {
1033 pub fn new() -> Self {
1035 std::default::Default::default()
1036 }
1037
1038 pub fn set_throttle_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1040 self.throttle_percent = v.into();
1041 self
1042 }
1043}
1044
1045impl wkt::message::Message for ThrottleState {
1046 fn typename() -> &'static str {
1047 "type.googleapis.com/google.cloud.bigquery.storage.v1.ThrottleState"
1048 }
1049}
1050
1051#[derive(Clone, Default, PartialEq)]
1053#[non_exhaustive]
1054pub struct StreamStats {
1055 pub progress:
1057 std::option::Option<crate::write::generated::gapic_storage::model::stream_stats::Progress>,
1058
1059 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1060}
1061
1062impl StreamStats {
1063 pub fn new() -> Self {
1065 std::default::Default::default()
1066 }
1067
1068 pub fn set_progress<T>(mut self, v: T) -> Self
1070 where
1071 T: std::convert::Into<
1072 crate::write::generated::gapic_storage::model::stream_stats::Progress,
1073 >,
1074 {
1075 self.progress = std::option::Option::Some(v.into());
1076 self
1077 }
1078
1079 pub fn set_or_clear_progress<T>(mut self, v: std::option::Option<T>) -> Self
1081 where
1082 T: std::convert::Into<
1083 crate::write::generated::gapic_storage::model::stream_stats::Progress,
1084 >,
1085 {
1086 self.progress = v.map(|x| x.into());
1087 self
1088 }
1089}
1090
1091impl wkt::message::Message for StreamStats {
1092 fn typename() -> &'static str {
1093 "type.googleapis.com/google.cloud.bigquery.storage.v1.StreamStats"
1094 }
1095}
1096
1097pub mod stream_stats {
1099 #[allow(unused_imports)]
1100 use super::*;
1101
1102 #[allow(missing_docs)]
1103 #[derive(Clone, Default, PartialEq)]
1104 #[non_exhaustive]
1105 pub struct Progress {
1106 pub at_response_start: f64,
1119
1120 pub at_response_end: f64,
1123
1124 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1125 }
1126
1127 impl Progress {
1128 pub fn new() -> Self {
1130 std::default::Default::default()
1131 }
1132
1133 pub fn set_at_response_start<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
1135 self.at_response_start = v.into();
1136 self
1137 }
1138
1139 pub fn set_at_response_end<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
1141 self.at_response_end = v.into();
1142 self
1143 }
1144 }
1145
1146 impl wkt::message::Message for Progress {
1147 fn typename() -> &'static str {
1148 "type.googleapis.com/google.cloud.bigquery.storage.v1.StreamStats.Progress"
1149 }
1150 }
1151}
1152
1153#[derive(Clone, Default, PartialEq)]
1156#[non_exhaustive]
1157pub struct ReadRowsResponse {
1158 pub row_count: i64,
1160
1161 pub stats: std::option::Option<crate::write::generated::gapic_storage::model::StreamStats>,
1163
1164 pub throttle_state:
1167 std::option::Option<crate::write::generated::gapic_storage::model::ThrottleState>,
1168
1169 pub uncompressed_byte_size: std::option::Option<i64>,
1184
1185 pub total_estimated_row_count: std::option::Option<i64>,
1190
1191 pub rows: std::option::Option<
1193 crate::write::generated::gapic_storage::model::read_rows_response::Rows,
1194 >,
1195
1196 pub schema: std::option::Option<
1202 crate::write::generated::gapic_storage::model::read_rows_response::Schema,
1203 >,
1204
1205 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1206}
1207
1208impl ReadRowsResponse {
1209 pub fn new() -> Self {
1211 std::default::Default::default()
1212 }
1213
1214 pub fn set_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1216 self.row_count = v.into();
1217 self
1218 }
1219
1220 pub fn set_stats<T>(mut self, v: T) -> Self
1222 where
1223 T: std::convert::Into<crate::write::generated::gapic_storage::model::StreamStats>,
1224 {
1225 self.stats = std::option::Option::Some(v.into());
1226 self
1227 }
1228
1229 pub fn set_or_clear_stats<T>(mut self, v: std::option::Option<T>) -> Self
1231 where
1232 T: std::convert::Into<crate::write::generated::gapic_storage::model::StreamStats>,
1233 {
1234 self.stats = v.map(|x| x.into());
1235 self
1236 }
1237
1238 pub fn set_throttle_state<T>(mut self, v: T) -> Self
1240 where
1241 T: std::convert::Into<crate::write::generated::gapic_storage::model::ThrottleState>,
1242 {
1243 self.throttle_state = std::option::Option::Some(v.into());
1244 self
1245 }
1246
1247 pub fn set_or_clear_throttle_state<T>(mut self, v: std::option::Option<T>) -> Self
1249 where
1250 T: std::convert::Into<crate::write::generated::gapic_storage::model::ThrottleState>,
1251 {
1252 self.throttle_state = v.map(|x| x.into());
1253 self
1254 }
1255
1256 pub fn set_uncompressed_byte_size<T>(mut self, v: T) -> Self
1258 where
1259 T: std::convert::Into<i64>,
1260 {
1261 self.uncompressed_byte_size = std::option::Option::Some(v.into());
1262 self
1263 }
1264
1265 pub fn set_or_clear_uncompressed_byte_size<T>(mut self, v: std::option::Option<T>) -> Self
1267 where
1268 T: std::convert::Into<i64>,
1269 {
1270 self.uncompressed_byte_size = v.map(|x| x.into());
1271 self
1272 }
1273
1274 pub fn set_total_estimated_row_count<T>(mut self, v: T) -> Self
1276 where
1277 T: std::convert::Into<i64>,
1278 {
1279 self.total_estimated_row_count = std::option::Option::Some(v.into());
1280 self
1281 }
1282
1283 pub fn set_or_clear_total_estimated_row_count<T>(mut self, v: std::option::Option<T>) -> Self
1285 where
1286 T: std::convert::Into<i64>,
1287 {
1288 self.total_estimated_row_count = v.map(|x| x.into());
1289 self
1290 }
1291
1292 pub fn set_rows<
1297 T: std::convert::Into<
1298 std::option::Option<
1299 crate::write::generated::gapic_storage::model::read_rows_response::Rows,
1300 >,
1301 >,
1302 >(
1303 mut self,
1304 v: T,
1305 ) -> Self {
1306 self.rows = v.into();
1307 self
1308 }
1309
1310 pub fn avro_rows(
1314 &self,
1315 ) -> std::option::Option<
1316 &std::boxed::Box<crate::write::generated::gapic_storage::model::AvroRows>,
1317 > {
1318 #[allow(unreachable_patterns)]
1319 self.rows.as_ref().and_then(|v| match v {
1320 crate::write::generated::gapic_storage::model::read_rows_response::Rows::AvroRows(
1321 v,
1322 ) => std::option::Option::Some(v),
1323 _ => std::option::Option::None,
1324 })
1325 }
1326
1327 pub fn set_avro_rows<
1333 T: std::convert::Into<
1334 std::boxed::Box<crate::write::generated::gapic_storage::model::AvroRows>,
1335 >,
1336 >(
1337 mut self,
1338 v: T,
1339 ) -> Self {
1340 self.rows = std::option::Option::Some(
1341 crate::write::generated::gapic_storage::model::read_rows_response::Rows::AvroRows(
1342 v.into(),
1343 ),
1344 );
1345 self
1346 }
1347
1348 pub fn arrow_record_batch(
1352 &self,
1353 ) -> std::option::Option<
1354 &std::boxed::Box<crate::write::generated::gapic_storage::model::ArrowRecordBatch>,
1355 > {
1356 #[allow(unreachable_patterns)]
1357 self.rows.as_ref().and_then(|v| match v {
1358 crate::write::generated::gapic_storage::model::read_rows_response::Rows::ArrowRecordBatch(v) => std::option::Option::Some(v),
1359 _ => std::option::Option::None,
1360 })
1361 }
1362
1363 pub fn set_arrow_record_batch<
1369 T: std::convert::Into<
1370 std::boxed::Box<crate::write::generated::gapic_storage::model::ArrowRecordBatch>,
1371 >,
1372 >(
1373 mut self,
1374 v: T,
1375 ) -> Self {
1376 self.rows = std::option::Option::Some(
1377 crate::write::generated::gapic_storage::model::read_rows_response::Rows::ArrowRecordBatch(
1378 v.into()
1379 )
1380 );
1381 self
1382 }
1383
1384 pub fn set_schema<
1389 T: std::convert::Into<
1390 std::option::Option<
1391 crate::write::generated::gapic_storage::model::read_rows_response::Schema,
1392 >,
1393 >,
1394 >(
1395 mut self,
1396 v: T,
1397 ) -> Self {
1398 self.schema = v.into();
1399 self
1400 }
1401
1402 pub fn avro_schema(
1406 &self,
1407 ) -> std::option::Option<
1408 &std::boxed::Box<crate::write::generated::gapic_storage::model::AvroSchema>,
1409 > {
1410 #[allow(unreachable_patterns)]
1411 self.schema.as_ref().and_then(|v| match v {
1412 crate::write::generated::gapic_storage::model::read_rows_response::Schema::AvroSchema(v) => std::option::Option::Some(v),
1413 _ => std::option::Option::None,
1414 })
1415 }
1416
1417 pub fn set_avro_schema<
1423 T: std::convert::Into<
1424 std::boxed::Box<crate::write::generated::gapic_storage::model::AvroSchema>,
1425 >,
1426 >(
1427 mut self,
1428 v: T,
1429 ) -> Self {
1430 self.schema = std::option::Option::Some(
1431 crate::write::generated::gapic_storage::model::read_rows_response::Schema::AvroSchema(
1432 v.into(),
1433 ),
1434 );
1435 self
1436 }
1437
1438 pub fn arrow_schema(
1442 &self,
1443 ) -> std::option::Option<
1444 &std::boxed::Box<crate::write::generated::gapic_storage::model::ArrowSchema>,
1445 > {
1446 #[allow(unreachable_patterns)]
1447 self.schema.as_ref().and_then(|v| match v {
1448 crate::write::generated::gapic_storage::model::read_rows_response::Schema::ArrowSchema(v) => std::option::Option::Some(v),
1449 _ => std::option::Option::None,
1450 })
1451 }
1452
1453 pub fn set_arrow_schema<
1459 T: std::convert::Into<
1460 std::boxed::Box<crate::write::generated::gapic_storage::model::ArrowSchema>,
1461 >,
1462 >(
1463 mut self,
1464 v: T,
1465 ) -> Self {
1466 self.schema = std::option::Option::Some(
1467 crate::write::generated::gapic_storage::model::read_rows_response::Schema::ArrowSchema(
1468 v.into(),
1469 ),
1470 );
1471 self
1472 }
1473}
1474
1475impl wkt::message::Message for ReadRowsResponse {
1476 fn typename() -> &'static str {
1477 "type.googleapis.com/google.cloud.bigquery.storage.v1.ReadRowsResponse"
1478 }
1479}
1480
1481pub mod read_rows_response {
1483 #[allow(unused_imports)]
1484 use super::*;
1485
1486 #[derive(Clone, Debug, PartialEq)]
1488 #[non_exhaustive]
1489 pub enum Rows {
1490 AvroRows(std::boxed::Box<crate::write::generated::gapic_storage::model::AvroRows>),
1492 ArrowRecordBatch(
1494 std::boxed::Box<crate::write::generated::gapic_storage::model::ArrowRecordBatch>,
1495 ),
1496 }
1497
1498 impl Rows {
1499 pub fn from_avro_rows(
1501 value: impl std::convert::Into<
1502 std::boxed::Box<crate::write::generated::gapic_storage::model::AvroRows>,
1503 >,
1504 ) -> Self {
1505 Self::AvroRows(value.into())
1506 }
1507 pub fn from_arrow_record_batch(
1509 value: impl std::convert::Into<
1510 std::boxed::Box<crate::write::generated::gapic_storage::model::ArrowRecordBatch>,
1511 >,
1512 ) -> Self {
1513 Self::ArrowRecordBatch(value.into())
1514 }
1515 }
1516
1517 #[derive(Clone, Debug, PartialEq)]
1523 #[non_exhaustive]
1524 pub enum Schema {
1525 AvroSchema(std::boxed::Box<crate::write::generated::gapic_storage::model::AvroSchema>),
1527 ArrowSchema(std::boxed::Box<crate::write::generated::gapic_storage::model::ArrowSchema>),
1529 }
1530
1531 impl Schema {
1532 pub fn from_avro_schema(
1534 value: impl std::convert::Into<
1535 std::boxed::Box<crate::write::generated::gapic_storage::model::AvroSchema>,
1536 >,
1537 ) -> Self {
1538 Self::AvroSchema(value.into())
1539 }
1540 pub fn from_arrow_schema(
1542 value: impl std::convert::Into<
1543 std::boxed::Box<crate::write::generated::gapic_storage::model::ArrowSchema>,
1544 >,
1545 ) -> Self {
1546 Self::ArrowSchema(value.into())
1547 }
1548 }
1549}
1550
1551#[derive(Clone, Default, PartialEq)]
1553#[non_exhaustive]
1554pub struct SplitReadStreamRequest {
1555 pub name: std::string::String,
1557
1558 pub fraction: f64,
1566
1567 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1568}
1569
1570impl SplitReadStreamRequest {
1571 pub fn new() -> Self {
1573 std::default::Default::default()
1574 }
1575
1576 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1578 self.name = v.into();
1579 self
1580 }
1581
1582 pub fn set_fraction<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
1584 self.fraction = v.into();
1585 self
1586 }
1587}
1588
1589impl wkt::message::Message for SplitReadStreamRequest {
1590 fn typename() -> &'static str {
1591 "type.googleapis.com/google.cloud.bigquery.storage.v1.SplitReadStreamRequest"
1592 }
1593}
1594
1595#[derive(Clone, Default, PartialEq)]
1597#[non_exhaustive]
1598pub struct SplitReadStreamResponse {
1599 pub primary_stream:
1603 std::option::Option<crate::write::generated::gapic_storage::model::ReadStream>,
1604
1605 pub remainder_stream:
1608 std::option::Option<crate::write::generated::gapic_storage::model::ReadStream>,
1609
1610 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1611}
1612
1613impl SplitReadStreamResponse {
1614 pub fn new() -> Self {
1616 std::default::Default::default()
1617 }
1618
1619 pub fn set_primary_stream<T>(mut self, v: T) -> Self
1621 where
1622 T: std::convert::Into<crate::write::generated::gapic_storage::model::ReadStream>,
1623 {
1624 self.primary_stream = std::option::Option::Some(v.into());
1625 self
1626 }
1627
1628 pub fn set_or_clear_primary_stream<T>(mut self, v: std::option::Option<T>) -> Self
1630 where
1631 T: std::convert::Into<crate::write::generated::gapic_storage::model::ReadStream>,
1632 {
1633 self.primary_stream = v.map(|x| x.into());
1634 self
1635 }
1636
1637 pub fn set_remainder_stream<T>(mut self, v: T) -> Self
1639 where
1640 T: std::convert::Into<crate::write::generated::gapic_storage::model::ReadStream>,
1641 {
1642 self.remainder_stream = std::option::Option::Some(v.into());
1643 self
1644 }
1645
1646 pub fn set_or_clear_remainder_stream<T>(mut self, v: std::option::Option<T>) -> Self
1648 where
1649 T: std::convert::Into<crate::write::generated::gapic_storage::model::ReadStream>,
1650 {
1651 self.remainder_stream = v.map(|x| x.into());
1652 self
1653 }
1654}
1655
1656impl wkt::message::Message for SplitReadStreamResponse {
1657 fn typename() -> &'static str {
1658 "type.googleapis.com/google.cloud.bigquery.storage.v1.SplitReadStreamResponse"
1659 }
1660}
1661
1662#[derive(Clone, Default, PartialEq)]
1664#[non_exhaustive]
1665pub struct CreateWriteStreamRequest {
1666 pub parent: std::string::String,
1669
1670 pub write_stream:
1672 std::option::Option<crate::write::generated::gapic_storage::model::WriteStream>,
1673
1674 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1675}
1676
1677impl CreateWriteStreamRequest {
1678 pub fn new() -> Self {
1680 std::default::Default::default()
1681 }
1682
1683 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1685 self.parent = v.into();
1686 self
1687 }
1688
1689 pub fn set_write_stream<T>(mut self, v: T) -> Self
1691 where
1692 T: std::convert::Into<crate::write::generated::gapic_storage::model::WriteStream>,
1693 {
1694 self.write_stream = std::option::Option::Some(v.into());
1695 self
1696 }
1697
1698 pub fn set_or_clear_write_stream<T>(mut self, v: std::option::Option<T>) -> Self
1700 where
1701 T: std::convert::Into<crate::write::generated::gapic_storage::model::WriteStream>,
1702 {
1703 self.write_stream = v.map(|x| x.into());
1704 self
1705 }
1706}
1707
1708impl wkt::message::Message for CreateWriteStreamRequest {
1709 fn typename() -> &'static str {
1710 "type.googleapis.com/google.cloud.bigquery.storage.v1.CreateWriteStreamRequest"
1711 }
1712}
1713
1714#[derive(Clone, Default, PartialEq)]
1724#[non_exhaustive]
1725pub struct AppendRowsRequest {
1726
1727 pub write_stream: std::string::String,
1762
1763 pub offset: std::option::Option<wkt::Int64Value>,
1768
1769 pub trace_id: std::string::String,
1772
1773 pub missing_value_interpretations: std::collections::HashMap<std::string::String,crate::write::generated::gapic_storage::model::append_rows_request::MissingValueInterpretation>,
1792
1793 pub default_missing_value_interpretation: crate::write::generated::gapic_storage::model::append_rows_request::MissingValueInterpretation,
1803
1804 pub client_stats: std::option::Option<crate::write::generated::gapic_storage::model::ClientStats>,
1806
1807 pub rows: std::option::Option<crate::write::generated::gapic_storage::model::append_rows_request::Rows>,
1812
1813 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1814}
1815
1816impl AppendRowsRequest {
1817 pub fn new() -> Self {
1819 std::default::Default::default()
1820 }
1821
1822 pub fn set_write_stream<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1824 self.write_stream = v.into();
1825 self
1826 }
1827
1828 pub fn set_offset<T>(mut self, v: T) -> Self
1830 where
1831 T: std::convert::Into<wkt::Int64Value>,
1832 {
1833 self.offset = std::option::Option::Some(v.into());
1834 self
1835 }
1836
1837 pub fn set_or_clear_offset<T>(mut self, v: std::option::Option<T>) -> Self
1839 where
1840 T: std::convert::Into<wkt::Int64Value>,
1841 {
1842 self.offset = v.map(|x| x.into());
1843 self
1844 }
1845
1846 pub fn set_trace_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1848 self.trace_id = v.into();
1849 self
1850 }
1851
1852 pub fn set_missing_value_interpretations<T, K, V>(mut self, v: T) -> Self
1854 where
1855 T: std::iter::IntoIterator<Item = (K, V)>,
1856 K: std::convert::Into<std::string::String>,
1857 V: std::convert::Into<crate::write::generated::gapic_storage::model::append_rows_request::MissingValueInterpretation>,
1858 {
1859 use std::iter::Iterator;
1860 self.missing_value_interpretations =
1861 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1862 self
1863 }
1864
1865 pub fn set_default_missing_value_interpretation<T: std::convert::Into<crate::write::generated::gapic_storage::model::append_rows_request::MissingValueInterpretation>>(mut self, v: T) -> Self{
1867 self.default_missing_value_interpretation = v.into();
1868 self
1869 }
1870
1871 pub fn set_client_stats<T>(mut self, v: T) -> Self
1873 where
1874 T: std::convert::Into<crate::write::generated::gapic_storage::model::ClientStats>,
1875 {
1876 self.client_stats = std::option::Option::Some(v.into());
1877 self
1878 }
1879
1880 pub fn set_or_clear_client_stats<T>(mut self, v: std::option::Option<T>) -> Self
1882 where
1883 T: std::convert::Into<crate::write::generated::gapic_storage::model::ClientStats>,
1884 {
1885 self.client_stats = v.map(|x| x.into());
1886 self
1887 }
1888
1889 pub fn set_rows<
1894 T: std::convert::Into<
1895 std::option::Option<
1896 crate::write::generated::gapic_storage::model::append_rows_request::Rows,
1897 >,
1898 >,
1899 >(
1900 mut self,
1901 v: T,
1902 ) -> Self {
1903 self.rows = v.into();
1904 self
1905 }
1906
1907 pub fn proto_rows(
1911 &self,
1912 ) -> std::option::Option<
1913 &std::boxed::Box<
1914 crate::write::generated::gapic_storage::model::append_rows_request::ProtoData,
1915 >,
1916 > {
1917 #[allow(unreachable_patterns)]
1918 self.rows.as_ref().and_then(|v| match v {
1919 crate::write::generated::gapic_storage::model::append_rows_request::Rows::ProtoRows(
1920 v,
1921 ) => std::option::Option::Some(v),
1922 _ => std::option::Option::None,
1923 })
1924 }
1925
1926 pub fn set_proto_rows<
1932 T: std::convert::Into<
1933 std::boxed::Box<
1934 crate::write::generated::gapic_storage::model::append_rows_request::ProtoData,
1935 >,
1936 >,
1937 >(
1938 mut self,
1939 v: T,
1940 ) -> Self {
1941 self.rows = std::option::Option::Some(
1942 crate::write::generated::gapic_storage::model::append_rows_request::Rows::ProtoRows(
1943 v.into(),
1944 ),
1945 );
1946 self
1947 }
1948
1949 pub fn arrow_rows(
1953 &self,
1954 ) -> std::option::Option<
1955 &std::boxed::Box<
1956 crate::write::generated::gapic_storage::model::append_rows_request::ArrowData,
1957 >,
1958 > {
1959 #[allow(unreachable_patterns)]
1960 self.rows.as_ref().and_then(|v| match v {
1961 crate::write::generated::gapic_storage::model::append_rows_request::Rows::ArrowRows(
1962 v,
1963 ) => std::option::Option::Some(v),
1964 _ => std::option::Option::None,
1965 })
1966 }
1967
1968 pub fn set_arrow_rows<
1974 T: std::convert::Into<
1975 std::boxed::Box<
1976 crate::write::generated::gapic_storage::model::append_rows_request::ArrowData,
1977 >,
1978 >,
1979 >(
1980 mut self,
1981 v: T,
1982 ) -> Self {
1983 self.rows = std::option::Option::Some(
1984 crate::write::generated::gapic_storage::model::append_rows_request::Rows::ArrowRows(
1985 v.into(),
1986 ),
1987 );
1988 self
1989 }
1990}
1991
1992impl wkt::message::Message for AppendRowsRequest {
1993 fn typename() -> &'static str {
1994 "type.googleapis.com/google.cloud.bigquery.storage.v1.AppendRowsRequest"
1995 }
1996}
1997
1998pub mod append_rows_request {
2000 #[allow(unused_imports)]
2001 use super::*;
2002
2003 #[derive(Clone, Default, PartialEq)]
2005 #[non_exhaustive]
2006 pub struct ArrowData {
2007 pub writer_schema:
2009 std::option::Option<crate::write::generated::gapic_storage::model::ArrowSchema>,
2010
2011 pub rows:
2013 std::option::Option<crate::write::generated::gapic_storage::model::ArrowRecordBatch>,
2014
2015 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2016 }
2017
2018 impl ArrowData {
2019 pub fn new() -> Self {
2021 std::default::Default::default()
2022 }
2023
2024 pub fn set_writer_schema<T>(mut self, v: T) -> Self
2026 where
2027 T: std::convert::Into<crate::write::generated::gapic_storage::model::ArrowSchema>,
2028 {
2029 self.writer_schema = std::option::Option::Some(v.into());
2030 self
2031 }
2032
2033 pub fn set_or_clear_writer_schema<T>(mut self, v: std::option::Option<T>) -> Self
2035 where
2036 T: std::convert::Into<crate::write::generated::gapic_storage::model::ArrowSchema>,
2037 {
2038 self.writer_schema = v.map(|x| x.into());
2039 self
2040 }
2041
2042 pub fn set_rows<T>(mut self, v: T) -> Self
2044 where
2045 T: std::convert::Into<crate::write::generated::gapic_storage::model::ArrowRecordBatch>,
2046 {
2047 self.rows = std::option::Option::Some(v.into());
2048 self
2049 }
2050
2051 pub fn set_or_clear_rows<T>(mut self, v: std::option::Option<T>) -> Self
2053 where
2054 T: std::convert::Into<crate::write::generated::gapic_storage::model::ArrowRecordBatch>,
2055 {
2056 self.rows = v.map(|x| x.into());
2057 self
2058 }
2059 }
2060
2061 impl wkt::message::Message for ArrowData {
2062 fn typename() -> &'static str {
2063 "type.googleapis.com/google.cloud.bigquery.storage.v1.AppendRowsRequest.ArrowData"
2064 }
2065 }
2066
2067 #[derive(Clone, Default, PartialEq)]
2070 #[non_exhaustive]
2071 pub struct ProtoData {
2072 pub writer_schema:
2082 std::option::Option<crate::write::generated::gapic_storage::model::ProtoSchema>,
2083
2084 pub rows: std::option::Option<crate::write::generated::gapic_storage::model::ProtoRows>,
2089
2090 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2091 }
2092
2093 impl ProtoData {
2094 pub fn new() -> Self {
2096 std::default::Default::default()
2097 }
2098
2099 pub fn set_writer_schema<T>(mut self, v: T) -> Self
2101 where
2102 T: std::convert::Into<crate::write::generated::gapic_storage::model::ProtoSchema>,
2103 {
2104 self.writer_schema = std::option::Option::Some(v.into());
2105 self
2106 }
2107
2108 pub fn set_or_clear_writer_schema<T>(mut self, v: std::option::Option<T>) -> Self
2110 where
2111 T: std::convert::Into<crate::write::generated::gapic_storage::model::ProtoSchema>,
2112 {
2113 self.writer_schema = v.map(|x| x.into());
2114 self
2115 }
2116
2117 pub fn set_rows<T>(mut self, v: T) -> Self
2119 where
2120 T: std::convert::Into<crate::write::generated::gapic_storage::model::ProtoRows>,
2121 {
2122 self.rows = std::option::Option::Some(v.into());
2123 self
2124 }
2125
2126 pub fn set_or_clear_rows<T>(mut self, v: std::option::Option<T>) -> Self
2128 where
2129 T: std::convert::Into<crate::write::generated::gapic_storage::model::ProtoRows>,
2130 {
2131 self.rows = v.map(|x| x.into());
2132 self
2133 }
2134 }
2135
2136 impl wkt::message::Message for ProtoData {
2137 fn typename() -> &'static str {
2138 "type.googleapis.com/google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData"
2139 }
2140 }
2141
2142 #[derive(Clone, Debug, PartialEq)]
2160 #[non_exhaustive]
2161 pub enum MissingValueInterpretation {
2162 Unspecified,
2165 NullValue,
2167 DefaultValue,
2170 UnknownValue(missing_value_interpretation::UnknownValue),
2175 }
2176
2177 #[doc(hidden)]
2178 pub mod missing_value_interpretation {
2179 #[allow(unused_imports)]
2180 use super::*;
2181 #[derive(Clone, Debug, PartialEq)]
2182 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2183 }
2184
2185 impl MissingValueInterpretation {
2186 pub fn value(&self) -> std::option::Option<i32> {
2191 match self {
2192 Self::Unspecified => std::option::Option::Some(0),
2193 Self::NullValue => std::option::Option::Some(1),
2194 Self::DefaultValue => std::option::Option::Some(2),
2195 Self::UnknownValue(u) => u.0.value(),
2196 }
2197 }
2198
2199 pub fn name(&self) -> std::option::Option<&str> {
2204 match self {
2205 Self::Unspecified => {
2206 std::option::Option::Some("MISSING_VALUE_INTERPRETATION_UNSPECIFIED")
2207 }
2208 Self::NullValue => std::option::Option::Some("NULL_VALUE"),
2209 Self::DefaultValue => std::option::Option::Some("DEFAULT_VALUE"),
2210 Self::UnknownValue(u) => u.0.name(),
2211 }
2212 }
2213 }
2214
2215 impl std::default::Default for MissingValueInterpretation {
2216 fn default() -> Self {
2217 use std::convert::From;
2218 Self::from(0)
2219 }
2220 }
2221
2222 impl std::fmt::Display for MissingValueInterpretation {
2223 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2224 wkt::internal::display_enum(f, self.name(), self.value())
2225 }
2226 }
2227
2228 impl std::convert::From<i32> for MissingValueInterpretation {
2229 fn from(value: i32) -> Self {
2230 match value {
2231 0 => Self::Unspecified,
2232 1 => Self::NullValue,
2233 2 => Self::DefaultValue,
2234 _ => Self::UnknownValue(missing_value_interpretation::UnknownValue(
2235 wkt::internal::UnknownEnumValue::Integer(value),
2236 )),
2237 }
2238 }
2239 }
2240
2241 impl std::convert::From<&str> for MissingValueInterpretation {
2242 fn from(value: &str) -> Self {
2243 use std::string::ToString;
2244 match value {
2245 "MISSING_VALUE_INTERPRETATION_UNSPECIFIED" => Self::Unspecified,
2246 "NULL_VALUE" => Self::NullValue,
2247 "DEFAULT_VALUE" => Self::DefaultValue,
2248 _ => Self::UnknownValue(missing_value_interpretation::UnknownValue(
2249 wkt::internal::UnknownEnumValue::String(value.to_string()),
2250 )),
2251 }
2252 }
2253 }
2254
2255 impl serde::ser::Serialize for MissingValueInterpretation {
2256 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2257 where
2258 S: serde::Serializer,
2259 {
2260 match self {
2261 Self::Unspecified => serializer.serialize_i32(0),
2262 Self::NullValue => serializer.serialize_i32(1),
2263 Self::DefaultValue => serializer.serialize_i32(2),
2264 Self::UnknownValue(u) => u.0.serialize(serializer),
2265 }
2266 }
2267 }
2268
2269 impl<'de> serde::de::Deserialize<'de> for MissingValueInterpretation {
2270 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2271 where
2272 D: serde::Deserializer<'de>,
2273 {
2274 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MissingValueInterpretation>::new(
2275 ".google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation"))
2276 }
2277 }
2278
2279 #[derive(Clone, Debug, PartialEq)]
2284 #[non_exhaustive]
2285 pub enum Rows {
2286 ProtoRows(
2288 std::boxed::Box<
2289 crate::write::generated::gapic_storage::model::append_rows_request::ProtoData,
2290 >,
2291 ),
2292 ArrowRows(
2294 std::boxed::Box<
2295 crate::write::generated::gapic_storage::model::append_rows_request::ArrowData,
2296 >,
2297 ),
2298 }
2299
2300 impl Rows {
2301 pub fn from_proto_rows(
2303 value: impl std::convert::Into<
2304 std::boxed::Box<
2305 crate::write::generated::gapic_storage::model::append_rows_request::ProtoData,
2306 >,
2307 >,
2308 ) -> Self {
2309 Self::ProtoRows(value.into())
2310 }
2311 pub fn from_arrow_rows(
2313 value: impl std::convert::Into<
2314 std::boxed::Box<
2315 crate::write::generated::gapic_storage::model::append_rows_request::ArrowData,
2316 >,
2317 >,
2318 ) -> Self {
2319 Self::ArrowRows(value.into())
2320 }
2321 }
2322}
2323
2324#[derive(Clone, Default, PartialEq)]
2326#[non_exhaustive]
2327pub struct AppendRowsResponse {
2328 pub updated_schema:
2332 std::option::Option<crate::write::generated::gapic_storage::model::TableSchema>,
2333
2334 pub row_errors: std::vec::Vec<crate::write::generated::gapic_storage::model::RowError>,
2338
2339 pub write_stream: std::string::String,
2342
2343 #[allow(missing_docs)]
2344 pub response: std::option::Option<
2345 crate::write::generated::gapic_storage::model::append_rows_response::Response,
2346 >,
2347
2348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2349}
2350
2351impl AppendRowsResponse {
2352 pub fn new() -> Self {
2354 std::default::Default::default()
2355 }
2356
2357 pub fn set_updated_schema<T>(mut self, v: T) -> Self
2359 where
2360 T: std::convert::Into<crate::write::generated::gapic_storage::model::TableSchema>,
2361 {
2362 self.updated_schema = std::option::Option::Some(v.into());
2363 self
2364 }
2365
2366 pub fn set_or_clear_updated_schema<T>(mut self, v: std::option::Option<T>) -> Self
2368 where
2369 T: std::convert::Into<crate::write::generated::gapic_storage::model::TableSchema>,
2370 {
2371 self.updated_schema = v.map(|x| x.into());
2372 self
2373 }
2374
2375 pub fn set_row_errors<T, V>(mut self, v: T) -> Self
2377 where
2378 T: std::iter::IntoIterator<Item = V>,
2379 V: std::convert::Into<crate::write::generated::gapic_storage::model::RowError>,
2380 {
2381 use std::iter::Iterator;
2382 self.row_errors = v.into_iter().map(|i| i.into()).collect();
2383 self
2384 }
2385
2386 pub fn set_write_stream<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2388 self.write_stream = v.into();
2389 self
2390 }
2391
2392 pub fn set_response<
2397 T: std::convert::Into<
2398 std::option::Option<
2399 crate::write::generated::gapic_storage::model::append_rows_response::Response,
2400 >,
2401 >,
2402 >(
2403 mut self,
2404 v: T,
2405 ) -> Self {
2406 self.response = v.into();
2407 self
2408 }
2409
2410 pub fn append_result(
2414 &self,
2415 ) -> std::option::Option<
2416 &std::boxed::Box<
2417 crate::write::generated::gapic_storage::model::append_rows_response::AppendResult,
2418 >,
2419 > {
2420 #[allow(unreachable_patterns)]
2421 self.response.as_ref().and_then(|v| match v {
2422 crate::write::generated::gapic_storage::model::append_rows_response::Response::AppendResult(v) => std::option::Option::Some(v),
2423 _ => std::option::Option::None,
2424 })
2425 }
2426
2427 pub fn set_append_result<T: std::convert::Into<std::boxed::Box<crate::write::generated::gapic_storage::model::append_rows_response::AppendResult>>>(mut self, v: T) -> Self{
2433 self.response = std::option::Option::Some(
2434 crate::write::generated::gapic_storage::model::append_rows_response::Response::AppendResult(
2435 v.into()
2436 )
2437 );
2438 self
2439 }
2440
2441 pub fn error(&self) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>> {
2445 #[allow(unreachable_patterns)]
2446 self.response.as_ref().and_then(|v| match v {
2447 crate::write::generated::gapic_storage::model::append_rows_response::Response::Error(v) => std::option::Option::Some(v),
2448 _ => std::option::Option::None,
2449 })
2450 }
2451
2452 pub fn set_error<T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>>(
2458 mut self,
2459 v: T,
2460 ) -> Self {
2461 self.response = std::option::Option::Some(
2462 crate::write::generated::gapic_storage::model::append_rows_response::Response::Error(
2463 v.into(),
2464 ),
2465 );
2466 self
2467 }
2468}
2469
2470impl wkt::message::Message for AppendRowsResponse {
2471 fn typename() -> &'static str {
2472 "type.googleapis.com/google.cloud.bigquery.storage.v1.AppendRowsResponse"
2473 }
2474}
2475
2476pub mod append_rows_response {
2478 #[allow(unused_imports)]
2479 use super::*;
2480
2481 #[derive(Clone, Default, PartialEq)]
2483 #[non_exhaustive]
2484 pub struct AppendResult {
2485 pub offset: std::option::Option<wkt::Int64Value>,
2488
2489 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2490 }
2491
2492 impl AppendResult {
2493 pub fn new() -> Self {
2495 std::default::Default::default()
2496 }
2497
2498 pub fn set_offset<T>(mut self, v: T) -> Self
2500 where
2501 T: std::convert::Into<wkt::Int64Value>,
2502 {
2503 self.offset = std::option::Option::Some(v.into());
2504 self
2505 }
2506
2507 pub fn set_or_clear_offset<T>(mut self, v: std::option::Option<T>) -> Self
2509 where
2510 T: std::convert::Into<wkt::Int64Value>,
2511 {
2512 self.offset = v.map(|x| x.into());
2513 self
2514 }
2515 }
2516
2517 impl wkt::message::Message for AppendResult {
2518 fn typename() -> &'static str {
2519 "type.googleapis.com/google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult"
2520 }
2521 }
2522
2523 #[allow(missing_docs)]
2524 #[derive(Clone, Debug, PartialEq)]
2525 #[non_exhaustive]
2526 pub enum Response {
2527 AppendResult(
2529 std::boxed::Box<
2530 crate::write::generated::gapic_storage::model::append_rows_response::AppendResult,
2531 >,
2532 ),
2533 Error(std::boxed::Box<google_cloud_rpc::model::Status>),
2554 }
2555
2556 impl Response {
2557 pub fn from_append_result(
2559 value: impl std::convert::Into<std::boxed::Box<crate::write::generated::gapic_storage::model::append_rows_response::AppendResult>>,
2560 ) -> Self {
2561 Self::AppendResult(value.into())
2562 }
2563 pub fn from_error(
2565 value: impl std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
2566 ) -> Self {
2567 Self::Error(value.into())
2568 }
2569 }
2570}
2571
2572#[derive(Clone, Default, PartialEq)]
2574#[non_exhaustive]
2575pub struct GetWriteStreamRequest {
2576 pub name: std::string::String,
2579
2580 pub view: crate::write::generated::gapic_storage::model::WriteStreamView,
2583
2584 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2585}
2586
2587impl GetWriteStreamRequest {
2588 pub fn new() -> Self {
2590 std::default::Default::default()
2591 }
2592
2593 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2595 self.name = v.into();
2596 self
2597 }
2598
2599 pub fn set_view<
2601 T: std::convert::Into<crate::write::generated::gapic_storage::model::WriteStreamView>,
2602 >(
2603 mut self,
2604 v: T,
2605 ) -> Self {
2606 self.view = v.into();
2607 self
2608 }
2609}
2610
2611impl wkt::message::Message for GetWriteStreamRequest {
2612 fn typename() -> &'static str {
2613 "type.googleapis.com/google.cloud.bigquery.storage.v1.GetWriteStreamRequest"
2614 }
2615}
2616
2617#[derive(Clone, Default, PartialEq)]
2619#[non_exhaustive]
2620pub struct BatchCommitWriteStreamsRequest {
2621 pub parent: std::string::String,
2624
2625 pub write_streams: std::vec::Vec<std::string::String>,
2627
2628 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2629}
2630
2631impl BatchCommitWriteStreamsRequest {
2632 pub fn new() -> Self {
2634 std::default::Default::default()
2635 }
2636
2637 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2639 self.parent = v.into();
2640 self
2641 }
2642
2643 pub fn set_write_streams<T, V>(mut self, v: T) -> Self
2645 where
2646 T: std::iter::IntoIterator<Item = V>,
2647 V: std::convert::Into<std::string::String>,
2648 {
2649 use std::iter::Iterator;
2650 self.write_streams = v.into_iter().map(|i| i.into()).collect();
2651 self
2652 }
2653}
2654
2655impl wkt::message::Message for BatchCommitWriteStreamsRequest {
2656 fn typename() -> &'static str {
2657 "type.googleapis.com/google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest"
2658 }
2659}
2660
2661#[derive(Clone, Default, PartialEq)]
2663#[non_exhaustive]
2664pub struct BatchCommitWriteStreamsResponse {
2665 pub commit_time: std::option::Option<wkt::Timestamp>,
2669
2670 pub stream_errors: std::vec::Vec<crate::write::generated::gapic_storage::model::StorageError>,
2676
2677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2678}
2679
2680impl BatchCommitWriteStreamsResponse {
2681 pub fn new() -> Self {
2683 std::default::Default::default()
2684 }
2685
2686 pub fn set_commit_time<T>(mut self, v: T) -> Self
2688 where
2689 T: std::convert::Into<wkt::Timestamp>,
2690 {
2691 self.commit_time = std::option::Option::Some(v.into());
2692 self
2693 }
2694
2695 pub fn set_or_clear_commit_time<T>(mut self, v: std::option::Option<T>) -> Self
2697 where
2698 T: std::convert::Into<wkt::Timestamp>,
2699 {
2700 self.commit_time = v.map(|x| x.into());
2701 self
2702 }
2703
2704 pub fn set_stream_errors<T, V>(mut self, v: T) -> Self
2706 where
2707 T: std::iter::IntoIterator<Item = V>,
2708 V: std::convert::Into<crate::write::generated::gapic_storage::model::StorageError>,
2709 {
2710 use std::iter::Iterator;
2711 self.stream_errors = v.into_iter().map(|i| i.into()).collect();
2712 self
2713 }
2714}
2715
2716impl wkt::message::Message for BatchCommitWriteStreamsResponse {
2717 fn typename() -> &'static str {
2718 "type.googleapis.com/google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse"
2719 }
2720}
2721
2722#[derive(Clone, Default, PartialEq)]
2724#[non_exhaustive]
2725pub struct FinalizeWriteStreamRequest {
2726 pub name: std::string::String,
2729
2730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2731}
2732
2733impl FinalizeWriteStreamRequest {
2734 pub fn new() -> Self {
2736 std::default::Default::default()
2737 }
2738
2739 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2741 self.name = v.into();
2742 self
2743 }
2744}
2745
2746impl wkt::message::Message for FinalizeWriteStreamRequest {
2747 fn typename() -> &'static str {
2748 "type.googleapis.com/google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest"
2749 }
2750}
2751
2752#[derive(Clone, Default, PartialEq)]
2754#[non_exhaustive]
2755pub struct FinalizeWriteStreamResponse {
2756 pub row_count: i64,
2758
2759 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2760}
2761
2762impl FinalizeWriteStreamResponse {
2763 pub fn new() -> Self {
2765 std::default::Default::default()
2766 }
2767
2768 pub fn set_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2770 self.row_count = v.into();
2771 self
2772 }
2773}
2774
2775impl wkt::message::Message for FinalizeWriteStreamResponse {
2776 fn typename() -> &'static str {
2777 "type.googleapis.com/google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse"
2778 }
2779}
2780
2781#[derive(Clone, Default, PartialEq)]
2783#[non_exhaustive]
2784pub struct FlushRowsRequest {
2785 pub write_stream: std::string::String,
2787
2788 pub offset: std::option::Option<wkt::Int64Value>,
2791
2792 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2793}
2794
2795impl FlushRowsRequest {
2796 pub fn new() -> Self {
2798 std::default::Default::default()
2799 }
2800
2801 pub fn set_write_stream<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2803 self.write_stream = v.into();
2804 self
2805 }
2806
2807 pub fn set_offset<T>(mut self, v: T) -> Self
2809 where
2810 T: std::convert::Into<wkt::Int64Value>,
2811 {
2812 self.offset = std::option::Option::Some(v.into());
2813 self
2814 }
2815
2816 pub fn set_or_clear_offset<T>(mut self, v: std::option::Option<T>) -> Self
2818 where
2819 T: std::convert::Into<wkt::Int64Value>,
2820 {
2821 self.offset = v.map(|x| x.into());
2822 self
2823 }
2824}
2825
2826impl wkt::message::Message for FlushRowsRequest {
2827 fn typename() -> &'static str {
2828 "type.googleapis.com/google.cloud.bigquery.storage.v1.FlushRowsRequest"
2829 }
2830}
2831
2832#[derive(Clone, Default, PartialEq)]
2834#[non_exhaustive]
2835pub struct FlushRowsResponse {
2836 pub offset: i64,
2838
2839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2840}
2841
2842impl FlushRowsResponse {
2843 pub fn new() -> Self {
2845 std::default::Default::default()
2846 }
2847
2848 pub fn set_offset<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2850 self.offset = v.into();
2851 self
2852 }
2853}
2854
2855impl wkt::message::Message for FlushRowsResponse {
2856 fn typename() -> &'static str {
2857 "type.googleapis.com/google.cloud.bigquery.storage.v1.FlushRowsResponse"
2858 }
2859}
2860
2861#[derive(Clone, Default, PartialEq)]
2866#[non_exhaustive]
2867pub struct StorageError {
2868 pub code: crate::write::generated::gapic_storage::model::storage_error::StorageErrorCode,
2870
2871 pub entity: std::string::String,
2873
2874 pub error_message: std::string::String,
2876
2877 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2878}
2879
2880impl StorageError {
2881 pub fn new() -> Self {
2883 std::default::Default::default()
2884 }
2885
2886 pub fn set_code<
2888 T: std::convert::Into<
2889 crate::write::generated::gapic_storage::model::storage_error::StorageErrorCode,
2890 >,
2891 >(
2892 mut self,
2893 v: T,
2894 ) -> Self {
2895 self.code = v.into();
2896 self
2897 }
2898
2899 pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2901 self.entity = v.into();
2902 self
2903 }
2904
2905 pub fn set_error_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2907 self.error_message = v.into();
2908 self
2909 }
2910}
2911
2912impl wkt::message::Message for StorageError {
2913 fn typename() -> &'static str {
2914 "type.googleapis.com/google.cloud.bigquery.storage.v1.StorageError"
2915 }
2916}
2917
2918pub mod storage_error {
2920 #[allow(unused_imports)]
2921 use super::*;
2922
2923 #[derive(Clone, Debug, PartialEq)]
2939 #[non_exhaustive]
2940 pub enum StorageErrorCode {
2941 Unspecified,
2943 TableNotFound,
2945 StreamAlreadyCommitted,
2947 StreamNotFound,
2949 InvalidStreamType,
2952 InvalidStreamState,
2956 StreamFinalized,
2958 SchemaMismatchExtraFields,
2961 OffsetAlreadyExists,
2963 OffsetOutOfRange,
2965 CmekNotProvided,
2968 InvalidCmekProvided,
2970 CmekEncryptionError,
2972 KmsServiceError,
2975 KmsPermissionDenied,
2977 UnknownValue(storage_error_code::UnknownValue),
2982 }
2983
2984 #[doc(hidden)]
2985 pub mod storage_error_code {
2986 #[allow(unused_imports)]
2987 use super::*;
2988 #[derive(Clone, Debug, PartialEq)]
2989 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2990 }
2991
2992 impl StorageErrorCode {
2993 pub fn value(&self) -> std::option::Option<i32> {
2998 match self {
2999 Self::Unspecified => std::option::Option::Some(0),
3000 Self::TableNotFound => std::option::Option::Some(1),
3001 Self::StreamAlreadyCommitted => std::option::Option::Some(2),
3002 Self::StreamNotFound => std::option::Option::Some(3),
3003 Self::InvalidStreamType => std::option::Option::Some(4),
3004 Self::InvalidStreamState => std::option::Option::Some(5),
3005 Self::StreamFinalized => std::option::Option::Some(6),
3006 Self::SchemaMismatchExtraFields => std::option::Option::Some(7),
3007 Self::OffsetAlreadyExists => std::option::Option::Some(8),
3008 Self::OffsetOutOfRange => std::option::Option::Some(9),
3009 Self::CmekNotProvided => std::option::Option::Some(10),
3010 Self::InvalidCmekProvided => std::option::Option::Some(11),
3011 Self::CmekEncryptionError => std::option::Option::Some(12),
3012 Self::KmsServiceError => std::option::Option::Some(13),
3013 Self::KmsPermissionDenied => std::option::Option::Some(14),
3014 Self::UnknownValue(u) => u.0.value(),
3015 }
3016 }
3017
3018 pub fn name(&self) -> std::option::Option<&str> {
3023 match self {
3024 Self::Unspecified => std::option::Option::Some("STORAGE_ERROR_CODE_UNSPECIFIED"),
3025 Self::TableNotFound => std::option::Option::Some("TABLE_NOT_FOUND"),
3026 Self::StreamAlreadyCommitted => {
3027 std::option::Option::Some("STREAM_ALREADY_COMMITTED")
3028 }
3029 Self::StreamNotFound => std::option::Option::Some("STREAM_NOT_FOUND"),
3030 Self::InvalidStreamType => std::option::Option::Some("INVALID_STREAM_TYPE"),
3031 Self::InvalidStreamState => std::option::Option::Some("INVALID_STREAM_STATE"),
3032 Self::StreamFinalized => std::option::Option::Some("STREAM_FINALIZED"),
3033 Self::SchemaMismatchExtraFields => {
3034 std::option::Option::Some("SCHEMA_MISMATCH_EXTRA_FIELDS")
3035 }
3036 Self::OffsetAlreadyExists => std::option::Option::Some("OFFSET_ALREADY_EXISTS"),
3037 Self::OffsetOutOfRange => std::option::Option::Some("OFFSET_OUT_OF_RANGE"),
3038 Self::CmekNotProvided => std::option::Option::Some("CMEK_NOT_PROVIDED"),
3039 Self::InvalidCmekProvided => std::option::Option::Some("INVALID_CMEK_PROVIDED"),
3040 Self::CmekEncryptionError => std::option::Option::Some("CMEK_ENCRYPTION_ERROR"),
3041 Self::KmsServiceError => std::option::Option::Some("KMS_SERVICE_ERROR"),
3042 Self::KmsPermissionDenied => std::option::Option::Some("KMS_PERMISSION_DENIED"),
3043 Self::UnknownValue(u) => u.0.name(),
3044 }
3045 }
3046 }
3047
3048 impl std::default::Default for StorageErrorCode {
3049 fn default() -> Self {
3050 use std::convert::From;
3051 Self::from(0)
3052 }
3053 }
3054
3055 impl std::fmt::Display for StorageErrorCode {
3056 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3057 wkt::internal::display_enum(f, self.name(), self.value())
3058 }
3059 }
3060
3061 impl std::convert::From<i32> for StorageErrorCode {
3062 fn from(value: i32) -> Self {
3063 match value {
3064 0 => Self::Unspecified,
3065 1 => Self::TableNotFound,
3066 2 => Self::StreamAlreadyCommitted,
3067 3 => Self::StreamNotFound,
3068 4 => Self::InvalidStreamType,
3069 5 => Self::InvalidStreamState,
3070 6 => Self::StreamFinalized,
3071 7 => Self::SchemaMismatchExtraFields,
3072 8 => Self::OffsetAlreadyExists,
3073 9 => Self::OffsetOutOfRange,
3074 10 => Self::CmekNotProvided,
3075 11 => Self::InvalidCmekProvided,
3076 12 => Self::CmekEncryptionError,
3077 13 => Self::KmsServiceError,
3078 14 => Self::KmsPermissionDenied,
3079 _ => Self::UnknownValue(storage_error_code::UnknownValue(
3080 wkt::internal::UnknownEnumValue::Integer(value),
3081 )),
3082 }
3083 }
3084 }
3085
3086 impl std::convert::From<&str> for StorageErrorCode {
3087 fn from(value: &str) -> Self {
3088 use std::string::ToString;
3089 match value {
3090 "STORAGE_ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
3091 "TABLE_NOT_FOUND" => Self::TableNotFound,
3092 "STREAM_ALREADY_COMMITTED" => Self::StreamAlreadyCommitted,
3093 "STREAM_NOT_FOUND" => Self::StreamNotFound,
3094 "INVALID_STREAM_TYPE" => Self::InvalidStreamType,
3095 "INVALID_STREAM_STATE" => Self::InvalidStreamState,
3096 "STREAM_FINALIZED" => Self::StreamFinalized,
3097 "SCHEMA_MISMATCH_EXTRA_FIELDS" => Self::SchemaMismatchExtraFields,
3098 "OFFSET_ALREADY_EXISTS" => Self::OffsetAlreadyExists,
3099 "OFFSET_OUT_OF_RANGE" => Self::OffsetOutOfRange,
3100 "CMEK_NOT_PROVIDED" => Self::CmekNotProvided,
3101 "INVALID_CMEK_PROVIDED" => Self::InvalidCmekProvided,
3102 "CMEK_ENCRYPTION_ERROR" => Self::CmekEncryptionError,
3103 "KMS_SERVICE_ERROR" => Self::KmsServiceError,
3104 "KMS_PERMISSION_DENIED" => Self::KmsPermissionDenied,
3105 _ => Self::UnknownValue(storage_error_code::UnknownValue(
3106 wkt::internal::UnknownEnumValue::String(value.to_string()),
3107 )),
3108 }
3109 }
3110 }
3111
3112 impl serde::ser::Serialize for StorageErrorCode {
3113 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3114 where
3115 S: serde::Serializer,
3116 {
3117 match self {
3118 Self::Unspecified => serializer.serialize_i32(0),
3119 Self::TableNotFound => serializer.serialize_i32(1),
3120 Self::StreamAlreadyCommitted => serializer.serialize_i32(2),
3121 Self::StreamNotFound => serializer.serialize_i32(3),
3122 Self::InvalidStreamType => serializer.serialize_i32(4),
3123 Self::InvalidStreamState => serializer.serialize_i32(5),
3124 Self::StreamFinalized => serializer.serialize_i32(6),
3125 Self::SchemaMismatchExtraFields => serializer.serialize_i32(7),
3126 Self::OffsetAlreadyExists => serializer.serialize_i32(8),
3127 Self::OffsetOutOfRange => serializer.serialize_i32(9),
3128 Self::CmekNotProvided => serializer.serialize_i32(10),
3129 Self::InvalidCmekProvided => serializer.serialize_i32(11),
3130 Self::CmekEncryptionError => serializer.serialize_i32(12),
3131 Self::KmsServiceError => serializer.serialize_i32(13),
3132 Self::KmsPermissionDenied => serializer.serialize_i32(14),
3133 Self::UnknownValue(u) => u.0.serialize(serializer),
3134 }
3135 }
3136 }
3137
3138 impl<'de> serde::de::Deserialize<'de> for StorageErrorCode {
3139 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3140 where
3141 D: serde::Deserializer<'de>,
3142 {
3143 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StorageErrorCode>::new(
3144 ".google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode",
3145 ))
3146 }
3147 }
3148}
3149
3150#[derive(Clone, Default, PartialEq)]
3152#[non_exhaustive]
3153pub struct RowError {
3154 pub index: i64,
3156
3157 pub code: crate::write::generated::gapic_storage::model::row_error::RowErrorCode,
3159
3160 pub message: std::string::String,
3162
3163 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3164}
3165
3166impl RowError {
3167 pub fn new() -> Self {
3169 std::default::Default::default()
3170 }
3171
3172 pub fn set_index<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3174 self.index = v.into();
3175 self
3176 }
3177
3178 pub fn set_code<
3180 T: std::convert::Into<crate::write::generated::gapic_storage::model::row_error::RowErrorCode>,
3181 >(
3182 mut self,
3183 v: T,
3184 ) -> Self {
3185 self.code = v.into();
3186 self
3187 }
3188
3189 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3191 self.message = v.into();
3192 self
3193 }
3194}
3195
3196impl wkt::message::Message for RowError {
3197 fn typename() -> &'static str {
3198 "type.googleapis.com/google.cloud.bigquery.storage.v1.RowError"
3199 }
3200}
3201
3202pub mod row_error {
3204 #[allow(unused_imports)]
3205 use super::*;
3206
3207 #[derive(Clone, Debug, PartialEq)]
3223 #[non_exhaustive]
3224 pub enum RowErrorCode {
3225 Unspecified,
3227 FieldsError,
3229 UnknownValue(row_error_code::UnknownValue),
3234 }
3235
3236 #[doc(hidden)]
3237 pub mod row_error_code {
3238 #[allow(unused_imports)]
3239 use super::*;
3240 #[derive(Clone, Debug, PartialEq)]
3241 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3242 }
3243
3244 impl RowErrorCode {
3245 pub fn value(&self) -> std::option::Option<i32> {
3250 match self {
3251 Self::Unspecified => std::option::Option::Some(0),
3252 Self::FieldsError => std::option::Option::Some(1),
3253 Self::UnknownValue(u) => u.0.value(),
3254 }
3255 }
3256
3257 pub fn name(&self) -> std::option::Option<&str> {
3262 match self {
3263 Self::Unspecified => std::option::Option::Some("ROW_ERROR_CODE_UNSPECIFIED"),
3264 Self::FieldsError => std::option::Option::Some("FIELDS_ERROR"),
3265 Self::UnknownValue(u) => u.0.name(),
3266 }
3267 }
3268 }
3269
3270 impl std::default::Default for RowErrorCode {
3271 fn default() -> Self {
3272 use std::convert::From;
3273 Self::from(0)
3274 }
3275 }
3276
3277 impl std::fmt::Display for RowErrorCode {
3278 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3279 wkt::internal::display_enum(f, self.name(), self.value())
3280 }
3281 }
3282
3283 impl std::convert::From<i32> for RowErrorCode {
3284 fn from(value: i32) -> Self {
3285 match value {
3286 0 => Self::Unspecified,
3287 1 => Self::FieldsError,
3288 _ => Self::UnknownValue(row_error_code::UnknownValue(
3289 wkt::internal::UnknownEnumValue::Integer(value),
3290 )),
3291 }
3292 }
3293 }
3294
3295 impl std::convert::From<&str> for RowErrorCode {
3296 fn from(value: &str) -> Self {
3297 use std::string::ToString;
3298 match value {
3299 "ROW_ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
3300 "FIELDS_ERROR" => Self::FieldsError,
3301 _ => Self::UnknownValue(row_error_code::UnknownValue(
3302 wkt::internal::UnknownEnumValue::String(value.to_string()),
3303 )),
3304 }
3305 }
3306 }
3307
3308 impl serde::ser::Serialize for RowErrorCode {
3309 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3310 where
3311 S: serde::Serializer,
3312 {
3313 match self {
3314 Self::Unspecified => serializer.serialize_i32(0),
3315 Self::FieldsError => serializer.serialize_i32(1),
3316 Self::UnknownValue(u) => u.0.serialize(serializer),
3317 }
3318 }
3319 }
3320
3321 impl<'de> serde::de::Deserialize<'de> for RowErrorCode {
3322 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3323 where
3324 D: serde::Deserializer<'de>,
3325 {
3326 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RowErrorCode>::new(
3327 ".google.cloud.bigquery.storage.v1.RowError.RowErrorCode",
3328 ))
3329 }
3330 }
3331}
3332
3333#[derive(Clone, Default, PartialEq)]
3336#[non_exhaustive]
3337pub struct ClientStats {
3338 pub request_stats: std::option::Option<
3340 crate::write::generated::gapic_storage::model::client_stats::RequestStats,
3341 >,
3342
3343 pub window_stats: std::option::Option<
3345 crate::write::generated::gapic_storage::model::client_stats::WindowStats,
3346 >,
3347
3348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3349}
3350
3351impl ClientStats {
3352 pub fn new() -> Self {
3354 std::default::Default::default()
3355 }
3356
3357 pub fn set_request_stats<T>(mut self, v: T) -> Self
3359 where
3360 T: std::convert::Into<
3361 crate::write::generated::gapic_storage::model::client_stats::RequestStats,
3362 >,
3363 {
3364 self.request_stats = std::option::Option::Some(v.into());
3365 self
3366 }
3367
3368 pub fn set_or_clear_request_stats<T>(mut self, v: std::option::Option<T>) -> Self
3370 where
3371 T: std::convert::Into<
3372 crate::write::generated::gapic_storage::model::client_stats::RequestStats,
3373 >,
3374 {
3375 self.request_stats = v.map(|x| x.into());
3376 self
3377 }
3378
3379 pub fn set_window_stats<T>(mut self, v: T) -> Self
3381 where
3382 T: std::convert::Into<
3383 crate::write::generated::gapic_storage::model::client_stats::WindowStats,
3384 >,
3385 {
3386 self.window_stats = std::option::Option::Some(v.into());
3387 self
3388 }
3389
3390 pub fn set_or_clear_window_stats<T>(mut self, v: std::option::Option<T>) -> Self
3392 where
3393 T: std::convert::Into<
3394 crate::write::generated::gapic_storage::model::client_stats::WindowStats,
3395 >,
3396 {
3397 self.window_stats = v.map(|x| x.into());
3398 self
3399 }
3400}
3401
3402impl wkt::message::Message for ClientStats {
3403 fn typename() -> &'static str {
3404 "type.googleapis.com/google.cloud.bigquery.storage.v1.ClientStats"
3405 }
3406}
3407
3408pub mod client_stats {
3410 #[allow(unused_imports)]
3411 use super::*;
3412
3413 #[derive(Clone, Default, PartialEq)]
3416 #[non_exhaustive]
3417 pub struct RequestStats {
3418 pub send_time_millis: std::option::Option<i64>,
3421
3422 pub queued_requests_count: std::option::Option<i64>,
3425
3426 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3427 }
3428
3429 impl RequestStats {
3430 pub fn new() -> Self {
3432 std::default::Default::default()
3433 }
3434
3435 pub fn set_send_time_millis<T>(mut self, v: T) -> Self
3437 where
3438 T: std::convert::Into<i64>,
3439 {
3440 self.send_time_millis = std::option::Option::Some(v.into());
3441 self
3442 }
3443
3444 pub fn set_or_clear_send_time_millis<T>(mut self, v: std::option::Option<T>) -> Self
3446 where
3447 T: std::convert::Into<i64>,
3448 {
3449 self.send_time_millis = v.map(|x| x.into());
3450 self
3451 }
3452
3453 pub fn set_queued_requests_count<T>(mut self, v: T) -> Self
3455 where
3456 T: std::convert::Into<i64>,
3457 {
3458 self.queued_requests_count = std::option::Option::Some(v.into());
3459 self
3460 }
3461
3462 pub fn set_or_clear_queued_requests_count<T>(mut self, v: std::option::Option<T>) -> Self
3464 where
3465 T: std::convert::Into<i64>,
3466 {
3467 self.queued_requests_count = v.map(|x| x.into());
3468 self
3469 }
3470 }
3471
3472 impl wkt::message::Message for RequestStats {
3473 fn typename() -> &'static str {
3474 "type.googleapis.com/google.cloud.bigquery.storage.v1.ClientStats.RequestStats"
3475 }
3476 }
3477
3478 #[derive(Clone, Default, PartialEq)]
3480 #[non_exhaustive]
3481 pub struct WindowStats {
3482 pub max_response_latency_millis: std::option::Option<i64>,
3485
3486 pub avg_response_latency_millis: std::option::Option<i64>,
3489
3490 pub longest_wait_no_response_millis: std::option::Option<i64>,
3495
3496 pub requests_sent_count: std::option::Option<i64>,
3498
3499 pub responses_received_count: std::option::Option<i64>,
3501
3502 pub bytes_sent_count: std::option::Option<i64>,
3504
3505 pub window_start_time_epoch_millis: std::option::Option<i64>,
3508
3509 pub window_millis: std::option::Option<i64>,
3512
3513 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3514 }
3515
3516 impl WindowStats {
3517 pub fn new() -> Self {
3519 std::default::Default::default()
3520 }
3521
3522 pub fn set_max_response_latency_millis<T>(mut self, v: T) -> Self
3524 where
3525 T: std::convert::Into<i64>,
3526 {
3527 self.max_response_latency_millis = std::option::Option::Some(v.into());
3528 self
3529 }
3530
3531 pub fn set_or_clear_max_response_latency_millis<T>(
3533 mut self,
3534 v: std::option::Option<T>,
3535 ) -> Self
3536 where
3537 T: std::convert::Into<i64>,
3538 {
3539 self.max_response_latency_millis = v.map(|x| x.into());
3540 self
3541 }
3542
3543 pub fn set_avg_response_latency_millis<T>(mut self, v: T) -> Self
3545 where
3546 T: std::convert::Into<i64>,
3547 {
3548 self.avg_response_latency_millis = std::option::Option::Some(v.into());
3549 self
3550 }
3551
3552 pub fn set_or_clear_avg_response_latency_millis<T>(
3554 mut self,
3555 v: std::option::Option<T>,
3556 ) -> Self
3557 where
3558 T: std::convert::Into<i64>,
3559 {
3560 self.avg_response_latency_millis = v.map(|x| x.into());
3561 self
3562 }
3563
3564 pub fn set_longest_wait_no_response_millis<T>(mut self, v: T) -> Self
3566 where
3567 T: std::convert::Into<i64>,
3568 {
3569 self.longest_wait_no_response_millis = std::option::Option::Some(v.into());
3570 self
3571 }
3572
3573 pub fn set_or_clear_longest_wait_no_response_millis<T>(
3575 mut self,
3576 v: std::option::Option<T>,
3577 ) -> Self
3578 where
3579 T: std::convert::Into<i64>,
3580 {
3581 self.longest_wait_no_response_millis = v.map(|x| x.into());
3582 self
3583 }
3584
3585 pub fn set_requests_sent_count<T>(mut self, v: T) -> Self
3587 where
3588 T: std::convert::Into<i64>,
3589 {
3590 self.requests_sent_count = std::option::Option::Some(v.into());
3591 self
3592 }
3593
3594 pub fn set_or_clear_requests_sent_count<T>(mut self, v: std::option::Option<T>) -> Self
3596 where
3597 T: std::convert::Into<i64>,
3598 {
3599 self.requests_sent_count = v.map(|x| x.into());
3600 self
3601 }
3602
3603 pub fn set_responses_received_count<T>(mut self, v: T) -> Self
3605 where
3606 T: std::convert::Into<i64>,
3607 {
3608 self.responses_received_count = std::option::Option::Some(v.into());
3609 self
3610 }
3611
3612 pub fn set_or_clear_responses_received_count<T>(mut self, v: std::option::Option<T>) -> Self
3614 where
3615 T: std::convert::Into<i64>,
3616 {
3617 self.responses_received_count = v.map(|x| x.into());
3618 self
3619 }
3620
3621 pub fn set_bytes_sent_count<T>(mut self, v: T) -> Self
3623 where
3624 T: std::convert::Into<i64>,
3625 {
3626 self.bytes_sent_count = std::option::Option::Some(v.into());
3627 self
3628 }
3629
3630 pub fn set_or_clear_bytes_sent_count<T>(mut self, v: std::option::Option<T>) -> Self
3632 where
3633 T: std::convert::Into<i64>,
3634 {
3635 self.bytes_sent_count = v.map(|x| x.into());
3636 self
3637 }
3638
3639 pub fn set_window_start_time_epoch_millis<T>(mut self, v: T) -> Self
3641 where
3642 T: std::convert::Into<i64>,
3643 {
3644 self.window_start_time_epoch_millis = std::option::Option::Some(v.into());
3645 self
3646 }
3647
3648 pub fn set_or_clear_window_start_time_epoch_millis<T>(
3650 mut self,
3651 v: std::option::Option<T>,
3652 ) -> Self
3653 where
3654 T: std::convert::Into<i64>,
3655 {
3656 self.window_start_time_epoch_millis = v.map(|x| x.into());
3657 self
3658 }
3659
3660 pub fn set_window_millis<T>(mut self, v: T) -> Self
3662 where
3663 T: std::convert::Into<i64>,
3664 {
3665 self.window_millis = std::option::Option::Some(v.into());
3666 self
3667 }
3668
3669 pub fn set_or_clear_window_millis<T>(mut self, v: std::option::Option<T>) -> Self
3671 where
3672 T: std::convert::Into<i64>,
3673 {
3674 self.window_millis = v.map(|x| x.into());
3675 self
3676 }
3677 }
3678
3679 impl wkt::message::Message for WindowStats {
3680 fn typename() -> &'static str {
3681 "type.googleapis.com/google.cloud.bigquery.storage.v1.ClientStats.WindowStats"
3682 }
3683 }
3684}
3685
3686#[derive(Clone, Default, PartialEq)]
3688#[non_exhaustive]
3689pub struct ReadSession {
3690 pub name: std::string::String,
3693
3694 pub expire_time: std::option::Option<wkt::Timestamp>,
3699
3700 pub data_format: crate::write::generated::gapic_storage::model::DataFormat,
3703
3704 pub table: std::string::String,
3707
3708 pub table_modifiers: std::option::Option<
3711 crate::write::generated::gapic_storage::model::read_session::TableModifiers,
3712 >,
3713
3714 pub read_options: std::option::Option<
3716 crate::write::generated::gapic_storage::model::read_session::TableReadOptions,
3717 >,
3718
3719 pub streams: std::vec::Vec<crate::write::generated::gapic_storage::model::ReadStream>,
3726
3727 pub estimated_total_bytes_scanned: i64,
3731
3732 pub estimated_total_physical_file_size: i64,
3738
3739 pub estimated_row_count: i64,
3743
3744 pub trace_id: std::string::String,
3751
3752 pub schema:
3756 std::option::Option<crate::write::generated::gapic_storage::model::read_session::Schema>,
3757
3758 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3759}
3760
3761impl ReadSession {
3762 pub fn new() -> Self {
3764 std::default::Default::default()
3765 }
3766
3767 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3769 self.name = v.into();
3770 self
3771 }
3772
3773 pub fn set_expire_time<T>(mut self, v: T) -> Self
3775 where
3776 T: std::convert::Into<wkt::Timestamp>,
3777 {
3778 self.expire_time = std::option::Option::Some(v.into());
3779 self
3780 }
3781
3782 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
3784 where
3785 T: std::convert::Into<wkt::Timestamp>,
3786 {
3787 self.expire_time = v.map(|x| x.into());
3788 self
3789 }
3790
3791 pub fn set_data_format<
3793 T: std::convert::Into<crate::write::generated::gapic_storage::model::DataFormat>,
3794 >(
3795 mut self,
3796 v: T,
3797 ) -> Self {
3798 self.data_format = v.into();
3799 self
3800 }
3801
3802 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3804 self.table = v.into();
3805 self
3806 }
3807
3808 pub fn set_table_modifiers<T>(mut self, v: T) -> Self
3810 where
3811 T: std::convert::Into<
3812 crate::write::generated::gapic_storage::model::read_session::TableModifiers,
3813 >,
3814 {
3815 self.table_modifiers = std::option::Option::Some(v.into());
3816 self
3817 }
3818
3819 pub fn set_or_clear_table_modifiers<T>(mut self, v: std::option::Option<T>) -> Self
3821 where
3822 T: std::convert::Into<
3823 crate::write::generated::gapic_storage::model::read_session::TableModifiers,
3824 >,
3825 {
3826 self.table_modifiers = v.map(|x| x.into());
3827 self
3828 }
3829
3830 pub fn set_read_options<T>(mut self, v: T) -> Self
3832 where
3833 T: std::convert::Into<
3834 crate::write::generated::gapic_storage::model::read_session::TableReadOptions,
3835 >,
3836 {
3837 self.read_options = std::option::Option::Some(v.into());
3838 self
3839 }
3840
3841 pub fn set_or_clear_read_options<T>(mut self, v: std::option::Option<T>) -> Self
3843 where
3844 T: std::convert::Into<
3845 crate::write::generated::gapic_storage::model::read_session::TableReadOptions,
3846 >,
3847 {
3848 self.read_options = v.map(|x| x.into());
3849 self
3850 }
3851
3852 pub fn set_streams<T, V>(mut self, v: T) -> Self
3854 where
3855 T: std::iter::IntoIterator<Item = V>,
3856 V: std::convert::Into<crate::write::generated::gapic_storage::model::ReadStream>,
3857 {
3858 use std::iter::Iterator;
3859 self.streams = v.into_iter().map(|i| i.into()).collect();
3860 self
3861 }
3862
3863 pub fn set_estimated_total_bytes_scanned<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3865 self.estimated_total_bytes_scanned = v.into();
3866 self
3867 }
3868
3869 pub fn set_estimated_total_physical_file_size<T: std::convert::Into<i64>>(
3871 mut self,
3872 v: T,
3873 ) -> Self {
3874 self.estimated_total_physical_file_size = v.into();
3875 self
3876 }
3877
3878 pub fn set_estimated_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3880 self.estimated_row_count = v.into();
3881 self
3882 }
3883
3884 pub fn set_trace_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3886 self.trace_id = v.into();
3887 self
3888 }
3889
3890 pub fn set_schema<
3895 T: std::convert::Into<
3896 std::option::Option<
3897 crate::write::generated::gapic_storage::model::read_session::Schema,
3898 >,
3899 >,
3900 >(
3901 mut self,
3902 v: T,
3903 ) -> Self {
3904 self.schema = v.into();
3905 self
3906 }
3907
3908 pub fn avro_schema(
3912 &self,
3913 ) -> std::option::Option<
3914 &std::boxed::Box<crate::write::generated::gapic_storage::model::AvroSchema>,
3915 > {
3916 #[allow(unreachable_patterns)]
3917 self.schema.as_ref().and_then(|v| match v {
3918 crate::write::generated::gapic_storage::model::read_session::Schema::AvroSchema(v) => {
3919 std::option::Option::Some(v)
3920 }
3921 _ => std::option::Option::None,
3922 })
3923 }
3924
3925 pub fn set_avro_schema<
3931 T: std::convert::Into<
3932 std::boxed::Box<crate::write::generated::gapic_storage::model::AvroSchema>,
3933 >,
3934 >(
3935 mut self,
3936 v: T,
3937 ) -> Self {
3938 self.schema = std::option::Option::Some(
3939 crate::write::generated::gapic_storage::model::read_session::Schema::AvroSchema(
3940 v.into(),
3941 ),
3942 );
3943 self
3944 }
3945
3946 pub fn arrow_schema(
3950 &self,
3951 ) -> std::option::Option<
3952 &std::boxed::Box<crate::write::generated::gapic_storage::model::ArrowSchema>,
3953 > {
3954 #[allow(unreachable_patterns)]
3955 self.schema.as_ref().and_then(|v| match v {
3956 crate::write::generated::gapic_storage::model::read_session::Schema::ArrowSchema(v) => {
3957 std::option::Option::Some(v)
3958 }
3959 _ => std::option::Option::None,
3960 })
3961 }
3962
3963 pub fn set_arrow_schema<
3969 T: std::convert::Into<
3970 std::boxed::Box<crate::write::generated::gapic_storage::model::ArrowSchema>,
3971 >,
3972 >(
3973 mut self,
3974 v: T,
3975 ) -> Self {
3976 self.schema = std::option::Option::Some(
3977 crate::write::generated::gapic_storage::model::read_session::Schema::ArrowSchema(
3978 v.into(),
3979 ),
3980 );
3981 self
3982 }
3983}
3984
3985impl wkt::message::Message for ReadSession {
3986 fn typename() -> &'static str {
3987 "type.googleapis.com/google.cloud.bigquery.storage.v1.ReadSession"
3988 }
3989}
3990
3991pub mod read_session {
3993 #[allow(unused_imports)]
3994 use super::*;
3995
3996 #[derive(Clone, Default, PartialEq)]
3998 #[non_exhaustive]
3999 pub struct TableModifiers {
4000 pub snapshot_time: std::option::Option<wkt::Timestamp>,
4002
4003 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4004 }
4005
4006 impl TableModifiers {
4007 pub fn new() -> Self {
4009 std::default::Default::default()
4010 }
4011
4012 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
4014 where
4015 T: std::convert::Into<wkt::Timestamp>,
4016 {
4017 self.snapshot_time = std::option::Option::Some(v.into());
4018 self
4019 }
4020
4021 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
4023 where
4024 T: std::convert::Into<wkt::Timestamp>,
4025 {
4026 self.snapshot_time = v.map(|x| x.into());
4027 self
4028 }
4029 }
4030
4031 impl wkt::message::Message for TableModifiers {
4032 fn typename() -> &'static str {
4033 "type.googleapis.com/google.cloud.bigquery.storage.v1.ReadSession.TableModifiers"
4034 }
4035 }
4036
4037 #[derive(Clone, Default, PartialEq)]
4039 #[non_exhaustive]
4040 pub struct TableReadOptions {
4041
4042 pub selected_fields: std::vec::Vec<std::string::String>,
4090
4091 pub row_restriction: std::string::String,
4102
4103 pub sample_percentage: std::option::Option<f64>,
4110
4111 pub response_compression_codec: std::option::Option<crate::write::generated::gapic_storage::model::read_session::table_read_options::ResponseCompressionCodec>,
4114
4115 #[allow(missing_docs)]
4116 pub output_format_serialization_options: std::option::Option<crate::write::generated::gapic_storage::model::read_session::table_read_options::OutputFormatSerializationOptions>,
4117
4118 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4119 }
4120
4121 impl TableReadOptions {
4122 pub fn new() -> Self {
4124 std::default::Default::default()
4125 }
4126
4127 pub fn set_selected_fields<T, V>(mut self, v: T) -> Self
4129 where
4130 T: std::iter::IntoIterator<Item = V>,
4131 V: std::convert::Into<std::string::String>,
4132 {
4133 use std::iter::Iterator;
4134 self.selected_fields = v.into_iter().map(|i| i.into()).collect();
4135 self
4136 }
4137
4138 pub fn set_row_restriction<T: std::convert::Into<std::string::String>>(
4140 mut self,
4141 v: T,
4142 ) -> Self {
4143 self.row_restriction = v.into();
4144 self
4145 }
4146
4147 pub fn set_sample_percentage<T>(mut self, v: T) -> Self
4149 where
4150 T: std::convert::Into<f64>,
4151 {
4152 self.sample_percentage = std::option::Option::Some(v.into());
4153 self
4154 }
4155
4156 pub fn set_or_clear_sample_percentage<T>(mut self, v: std::option::Option<T>) -> Self
4158 where
4159 T: std::convert::Into<f64>,
4160 {
4161 self.sample_percentage = v.map(|x| x.into());
4162 self
4163 }
4164
4165 pub fn set_response_compression_codec<T>(mut self, v: T) -> Self
4167 where T: std::convert::Into<crate::write::generated::gapic_storage::model::read_session::table_read_options::ResponseCompressionCodec>
4168 {
4169 self.response_compression_codec = std::option::Option::Some(v.into());
4170 self
4171 }
4172
4173 pub fn set_or_clear_response_compression_codec<T>(mut self, v: std::option::Option<T>) -> Self
4175 where T: std::convert::Into<crate::write::generated::gapic_storage::model::read_session::table_read_options::ResponseCompressionCodec>
4176 {
4177 self.response_compression_codec = v.map(|x| x.into());
4178 self
4179 }
4180
4181 pub fn set_output_format_serialization_options<T: std::convert::Into<std::option::Option<crate::write::generated::gapic_storage::model::read_session::table_read_options::OutputFormatSerializationOptions>>>(mut self, v: T) -> Self
4186 {
4187 self.output_format_serialization_options = v.into();
4188 self
4189 }
4190
4191 pub fn arrow_serialization_options(
4195 &self,
4196 ) -> std::option::Option<
4197 &std::boxed::Box<
4198 crate::write::generated::gapic_storage::model::ArrowSerializationOptions,
4199 >,
4200 > {
4201 #[allow(unreachable_patterns)]
4202 self.output_format_serialization_options.as_ref().and_then(|v| match v {
4203 crate::write::generated::gapic_storage::model::read_session::table_read_options::OutputFormatSerializationOptions::ArrowSerializationOptions(v) => std::option::Option::Some(v),
4204 _ => std::option::Option::None,
4205 })
4206 }
4207
4208 pub fn set_arrow_serialization_options<
4214 T: std::convert::Into<
4215 std::boxed::Box<
4216 crate::write::generated::gapic_storage::model::ArrowSerializationOptions,
4217 >,
4218 >,
4219 >(
4220 mut self,
4221 v: T,
4222 ) -> Self {
4223 self.output_format_serialization_options = std::option::Option::Some(
4224 crate::write::generated::gapic_storage::model::read_session::table_read_options::OutputFormatSerializationOptions::ArrowSerializationOptions(
4225 v.into()
4226 )
4227 );
4228 self
4229 }
4230
4231 pub fn avro_serialization_options(
4235 &self,
4236 ) -> std::option::Option<
4237 &std::boxed::Box<
4238 crate::write::generated::gapic_storage::model::AvroSerializationOptions,
4239 >,
4240 > {
4241 #[allow(unreachable_patterns)]
4242 self.output_format_serialization_options.as_ref().and_then(|v| match v {
4243 crate::write::generated::gapic_storage::model::read_session::table_read_options::OutputFormatSerializationOptions::AvroSerializationOptions(v) => std::option::Option::Some(v),
4244 _ => std::option::Option::None,
4245 })
4246 }
4247
4248 pub fn set_avro_serialization_options<
4254 T: std::convert::Into<
4255 std::boxed::Box<
4256 crate::write::generated::gapic_storage::model::AvroSerializationOptions,
4257 >,
4258 >,
4259 >(
4260 mut self,
4261 v: T,
4262 ) -> Self {
4263 self.output_format_serialization_options = std::option::Option::Some(
4264 crate::write::generated::gapic_storage::model::read_session::table_read_options::OutputFormatSerializationOptions::AvroSerializationOptions(
4265 v.into()
4266 )
4267 );
4268 self
4269 }
4270 }
4271
4272 impl wkt::message::Message for TableReadOptions {
4273 fn typename() -> &'static str {
4274 "type.googleapis.com/google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions"
4275 }
4276 }
4277
4278 pub mod table_read_options {
4280 #[allow(unused_imports)]
4281 use super::*;
4282
4283 #[derive(Clone, Debug, PartialEq)]
4305 #[non_exhaustive]
4306 pub enum ResponseCompressionCodec {
4307 Unspecified,
4309 Lz4,
4311 UnknownValue(response_compression_codec::UnknownValue),
4316 }
4317
4318 #[doc(hidden)]
4319 pub mod response_compression_codec {
4320 #[allow(unused_imports)]
4321 use super::*;
4322 #[derive(Clone, Debug, PartialEq)]
4323 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4324 }
4325
4326 impl ResponseCompressionCodec {
4327 pub fn value(&self) -> std::option::Option<i32> {
4332 match self {
4333 Self::Unspecified => std::option::Option::Some(0),
4334 Self::Lz4 => std::option::Option::Some(2),
4335 Self::UnknownValue(u) => u.0.value(),
4336 }
4337 }
4338
4339 pub fn name(&self) -> std::option::Option<&str> {
4344 match self {
4345 Self::Unspecified => {
4346 std::option::Option::Some("RESPONSE_COMPRESSION_CODEC_UNSPECIFIED")
4347 }
4348 Self::Lz4 => std::option::Option::Some("RESPONSE_COMPRESSION_CODEC_LZ4"),
4349 Self::UnknownValue(u) => u.0.name(),
4350 }
4351 }
4352 }
4353
4354 impl std::default::Default for ResponseCompressionCodec {
4355 fn default() -> Self {
4356 use std::convert::From;
4357 Self::from(0)
4358 }
4359 }
4360
4361 impl std::fmt::Display for ResponseCompressionCodec {
4362 fn fmt(
4363 &self,
4364 f: &mut std::fmt::Formatter<'_>,
4365 ) -> std::result::Result<(), std::fmt::Error> {
4366 wkt::internal::display_enum(f, self.name(), self.value())
4367 }
4368 }
4369
4370 impl std::convert::From<i32> for ResponseCompressionCodec {
4371 fn from(value: i32) -> Self {
4372 match value {
4373 0 => Self::Unspecified,
4374 2 => Self::Lz4,
4375 _ => Self::UnknownValue(response_compression_codec::UnknownValue(
4376 wkt::internal::UnknownEnumValue::Integer(value),
4377 )),
4378 }
4379 }
4380 }
4381
4382 impl std::convert::From<&str> for ResponseCompressionCodec {
4383 fn from(value: &str) -> Self {
4384 use std::string::ToString;
4385 match value {
4386 "RESPONSE_COMPRESSION_CODEC_UNSPECIFIED" => Self::Unspecified,
4387 "RESPONSE_COMPRESSION_CODEC_LZ4" => Self::Lz4,
4388 _ => Self::UnknownValue(response_compression_codec::UnknownValue(
4389 wkt::internal::UnknownEnumValue::String(value.to_string()),
4390 )),
4391 }
4392 }
4393 }
4394
4395 impl serde::ser::Serialize for ResponseCompressionCodec {
4396 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4397 where
4398 S: serde::Serializer,
4399 {
4400 match self {
4401 Self::Unspecified => serializer.serialize_i32(0),
4402 Self::Lz4 => serializer.serialize_i32(2),
4403 Self::UnknownValue(u) => u.0.serialize(serializer),
4404 }
4405 }
4406 }
4407
4408 impl<'de> serde::de::Deserialize<'de> for ResponseCompressionCodec {
4409 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4410 where
4411 D: serde::Deserializer<'de>,
4412 {
4413 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResponseCompressionCodec>::new(
4414 ".google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.ResponseCompressionCodec"))
4415 }
4416 }
4417
4418 #[allow(missing_docs)]
4419 #[derive(Clone, Debug, PartialEq)]
4420 #[non_exhaustive]
4421 pub enum OutputFormatSerializationOptions {
4422 ArrowSerializationOptions(
4424 std::boxed::Box<
4425 crate::write::generated::gapic_storage::model::ArrowSerializationOptions,
4426 >,
4427 ),
4428 AvroSerializationOptions(
4430 std::boxed::Box<
4431 crate::write::generated::gapic_storage::model::AvroSerializationOptions,
4432 >,
4433 ),
4434 }
4435
4436 impl OutputFormatSerializationOptions {
4437 pub fn from_arrow_serialization_options(
4439 value: impl std::convert::Into<
4440 std::boxed::Box<
4441 crate::write::generated::gapic_storage::model::ArrowSerializationOptions,
4442 >,
4443 >,
4444 ) -> Self {
4445 Self::ArrowSerializationOptions(value.into())
4446 }
4447 pub fn from_avro_serialization_options(
4449 value: impl std::convert::Into<
4450 std::boxed::Box<
4451 crate::write::generated::gapic_storage::model::AvroSerializationOptions,
4452 >,
4453 >,
4454 ) -> Self {
4455 Self::AvroSerializationOptions(value.into())
4456 }
4457 }
4458 }
4459
4460 #[derive(Clone, Debug, PartialEq)]
4464 #[non_exhaustive]
4465 pub enum Schema {
4466 AvroSchema(std::boxed::Box<crate::write::generated::gapic_storage::model::AvroSchema>),
4468 ArrowSchema(std::boxed::Box<crate::write::generated::gapic_storage::model::ArrowSchema>),
4470 }
4471
4472 impl Schema {
4473 pub fn from_avro_schema(
4475 value: impl std::convert::Into<
4476 std::boxed::Box<crate::write::generated::gapic_storage::model::AvroSchema>,
4477 >,
4478 ) -> Self {
4479 Self::AvroSchema(value.into())
4480 }
4481 pub fn from_arrow_schema(
4483 value: impl std::convert::Into<
4484 std::boxed::Box<crate::write::generated::gapic_storage::model::ArrowSchema>,
4485 >,
4486 ) -> Self {
4487 Self::ArrowSchema(value.into())
4488 }
4489 }
4490}
4491
4492#[derive(Clone, Default, PartialEq)]
4496#[non_exhaustive]
4497pub struct ReadStream {
4498 pub name: std::string::String,
4501
4502 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4503}
4504
4505impl ReadStream {
4506 pub fn new() -> Self {
4508 std::default::Default::default()
4509 }
4510
4511 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4513 self.name = v.into();
4514 self
4515 }
4516}
4517
4518impl wkt::message::Message for ReadStream {
4519 fn typename() -> &'static str {
4520 "type.googleapis.com/google.cloud.bigquery.storage.v1.ReadStream"
4521 }
4522}
4523
4524#[derive(Clone, Default, PartialEq)]
4526#[non_exhaustive]
4527pub struct WriteStream {
4528 pub name: std::string::String,
4531
4532 pub r#type: crate::write::generated::gapic_storage::model::write_stream::Type,
4534
4535 pub create_time: std::option::Option<wkt::Timestamp>,
4538
4539 pub commit_time: std::option::Option<wkt::Timestamp>,
4544
4545 pub table_schema:
4550 std::option::Option<crate::write::generated::gapic_storage::model::TableSchema>,
4551
4552 pub write_mode: crate::write::generated::gapic_storage::model::write_stream::WriteMode,
4554
4555 pub location: std::string::String,
4559
4560 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4561}
4562
4563impl WriteStream {
4564 pub fn new() -> Self {
4566 std::default::Default::default()
4567 }
4568
4569 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4571 self.name = v.into();
4572 self
4573 }
4574
4575 pub fn set_type<
4577 T: std::convert::Into<crate::write::generated::gapic_storage::model::write_stream::Type>,
4578 >(
4579 mut self,
4580 v: T,
4581 ) -> Self {
4582 self.r#type = v.into();
4583 self
4584 }
4585
4586 pub fn set_create_time<T>(mut self, v: T) -> Self
4588 where
4589 T: std::convert::Into<wkt::Timestamp>,
4590 {
4591 self.create_time = std::option::Option::Some(v.into());
4592 self
4593 }
4594
4595 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4597 where
4598 T: std::convert::Into<wkt::Timestamp>,
4599 {
4600 self.create_time = v.map(|x| x.into());
4601 self
4602 }
4603
4604 pub fn set_commit_time<T>(mut self, v: T) -> Self
4606 where
4607 T: std::convert::Into<wkt::Timestamp>,
4608 {
4609 self.commit_time = std::option::Option::Some(v.into());
4610 self
4611 }
4612
4613 pub fn set_or_clear_commit_time<T>(mut self, v: std::option::Option<T>) -> Self
4615 where
4616 T: std::convert::Into<wkt::Timestamp>,
4617 {
4618 self.commit_time = v.map(|x| x.into());
4619 self
4620 }
4621
4622 pub fn set_table_schema<T>(mut self, v: T) -> Self
4624 where
4625 T: std::convert::Into<crate::write::generated::gapic_storage::model::TableSchema>,
4626 {
4627 self.table_schema = std::option::Option::Some(v.into());
4628 self
4629 }
4630
4631 pub fn set_or_clear_table_schema<T>(mut self, v: std::option::Option<T>) -> Self
4633 where
4634 T: std::convert::Into<crate::write::generated::gapic_storage::model::TableSchema>,
4635 {
4636 self.table_schema = v.map(|x| x.into());
4637 self
4638 }
4639
4640 pub fn set_write_mode<
4642 T: std::convert::Into<crate::write::generated::gapic_storage::model::write_stream::WriteMode>,
4643 >(
4644 mut self,
4645 v: T,
4646 ) -> Self {
4647 self.write_mode = v.into();
4648 self
4649 }
4650
4651 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4653 self.location = v.into();
4654 self
4655 }
4656}
4657
4658impl wkt::message::Message for WriteStream {
4659 fn typename() -> &'static str {
4660 "type.googleapis.com/google.cloud.bigquery.storage.v1.WriteStream"
4661 }
4662}
4663
4664pub mod write_stream {
4666 #[allow(unused_imports)]
4667 use super::*;
4668
4669 #[derive(Clone, Debug, PartialEq)]
4685 #[non_exhaustive]
4686 pub enum Type {
4687 Unspecified,
4689 Committed,
4692 Pending,
4694 Buffered,
4696 UnknownValue(r#type::UnknownValue),
4701 }
4702
4703 #[doc(hidden)]
4704 pub mod r#type {
4705 #[allow(unused_imports)]
4706 use super::*;
4707 #[derive(Clone, Debug, PartialEq)]
4708 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4709 }
4710
4711 impl Type {
4712 pub fn value(&self) -> std::option::Option<i32> {
4717 match self {
4718 Self::Unspecified => std::option::Option::Some(0),
4719 Self::Committed => std::option::Option::Some(1),
4720 Self::Pending => std::option::Option::Some(2),
4721 Self::Buffered => std::option::Option::Some(3),
4722 Self::UnknownValue(u) => u.0.value(),
4723 }
4724 }
4725
4726 pub fn name(&self) -> std::option::Option<&str> {
4731 match self {
4732 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
4733 Self::Committed => std::option::Option::Some("COMMITTED"),
4734 Self::Pending => std::option::Option::Some("PENDING"),
4735 Self::Buffered => std::option::Option::Some("BUFFERED"),
4736 Self::UnknownValue(u) => u.0.name(),
4737 }
4738 }
4739 }
4740
4741 impl std::default::Default for Type {
4742 fn default() -> Self {
4743 use std::convert::From;
4744 Self::from(0)
4745 }
4746 }
4747
4748 impl std::fmt::Display for Type {
4749 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4750 wkt::internal::display_enum(f, self.name(), self.value())
4751 }
4752 }
4753
4754 impl std::convert::From<i32> for Type {
4755 fn from(value: i32) -> Self {
4756 match value {
4757 0 => Self::Unspecified,
4758 1 => Self::Committed,
4759 2 => Self::Pending,
4760 3 => Self::Buffered,
4761 _ => Self::UnknownValue(r#type::UnknownValue(
4762 wkt::internal::UnknownEnumValue::Integer(value),
4763 )),
4764 }
4765 }
4766 }
4767
4768 impl std::convert::From<&str> for Type {
4769 fn from(value: &str) -> Self {
4770 use std::string::ToString;
4771 match value {
4772 "TYPE_UNSPECIFIED" => Self::Unspecified,
4773 "COMMITTED" => Self::Committed,
4774 "PENDING" => Self::Pending,
4775 "BUFFERED" => Self::Buffered,
4776 _ => Self::UnknownValue(r#type::UnknownValue(
4777 wkt::internal::UnknownEnumValue::String(value.to_string()),
4778 )),
4779 }
4780 }
4781 }
4782
4783 impl serde::ser::Serialize for Type {
4784 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4785 where
4786 S: serde::Serializer,
4787 {
4788 match self {
4789 Self::Unspecified => serializer.serialize_i32(0),
4790 Self::Committed => serializer.serialize_i32(1),
4791 Self::Pending => serializer.serialize_i32(2),
4792 Self::Buffered => serializer.serialize_i32(3),
4793 Self::UnknownValue(u) => u.0.serialize(serializer),
4794 }
4795 }
4796 }
4797
4798 impl<'de> serde::de::Deserialize<'de> for Type {
4799 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4800 where
4801 D: serde::Deserializer<'de>,
4802 {
4803 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
4804 ".google.cloud.bigquery.storage.v1.WriteStream.Type",
4805 ))
4806 }
4807 }
4808
4809 #[derive(Clone, Debug, PartialEq)]
4825 #[non_exhaustive]
4826 pub enum WriteMode {
4827 Unspecified,
4829 Insert,
4832 UnknownValue(write_mode::UnknownValue),
4837 }
4838
4839 #[doc(hidden)]
4840 pub mod write_mode {
4841 #[allow(unused_imports)]
4842 use super::*;
4843 #[derive(Clone, Debug, PartialEq)]
4844 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4845 }
4846
4847 impl WriteMode {
4848 pub fn value(&self) -> std::option::Option<i32> {
4853 match self {
4854 Self::Unspecified => std::option::Option::Some(0),
4855 Self::Insert => std::option::Option::Some(1),
4856 Self::UnknownValue(u) => u.0.value(),
4857 }
4858 }
4859
4860 pub fn name(&self) -> std::option::Option<&str> {
4865 match self {
4866 Self::Unspecified => std::option::Option::Some("WRITE_MODE_UNSPECIFIED"),
4867 Self::Insert => std::option::Option::Some("INSERT"),
4868 Self::UnknownValue(u) => u.0.name(),
4869 }
4870 }
4871 }
4872
4873 impl std::default::Default for WriteMode {
4874 fn default() -> Self {
4875 use std::convert::From;
4876 Self::from(0)
4877 }
4878 }
4879
4880 impl std::fmt::Display for WriteMode {
4881 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4882 wkt::internal::display_enum(f, self.name(), self.value())
4883 }
4884 }
4885
4886 impl std::convert::From<i32> for WriteMode {
4887 fn from(value: i32) -> Self {
4888 match value {
4889 0 => Self::Unspecified,
4890 1 => Self::Insert,
4891 _ => Self::UnknownValue(write_mode::UnknownValue(
4892 wkt::internal::UnknownEnumValue::Integer(value),
4893 )),
4894 }
4895 }
4896 }
4897
4898 impl std::convert::From<&str> for WriteMode {
4899 fn from(value: &str) -> Self {
4900 use std::string::ToString;
4901 match value {
4902 "WRITE_MODE_UNSPECIFIED" => Self::Unspecified,
4903 "INSERT" => Self::Insert,
4904 _ => Self::UnknownValue(write_mode::UnknownValue(
4905 wkt::internal::UnknownEnumValue::String(value.to_string()),
4906 )),
4907 }
4908 }
4909 }
4910
4911 impl serde::ser::Serialize for WriteMode {
4912 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4913 where
4914 S: serde::Serializer,
4915 {
4916 match self {
4917 Self::Unspecified => serializer.serialize_i32(0),
4918 Self::Insert => serializer.serialize_i32(1),
4919 Self::UnknownValue(u) => u.0.serialize(serializer),
4920 }
4921 }
4922 }
4923
4924 impl<'de> serde::de::Deserialize<'de> for WriteMode {
4925 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4926 where
4927 D: serde::Deserializer<'de>,
4928 {
4929 deserializer.deserialize_any(wkt::internal::EnumVisitor::<WriteMode>::new(
4930 ".google.cloud.bigquery.storage.v1.WriteStream.WriteMode",
4931 ))
4932 }
4933 }
4934}
4935
4936#[derive(Clone, Default, PartialEq)]
4940#[non_exhaustive]
4941pub struct TableSchema {
4942 pub fields: std::vec::Vec<crate::write::generated::gapic_storage::model::TableFieldSchema>,
4944
4945 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4946}
4947
4948impl TableSchema {
4949 pub fn new() -> Self {
4951 std::default::Default::default()
4952 }
4953
4954 pub fn set_fields<T, V>(mut self, v: T) -> Self
4956 where
4957 T: std::iter::IntoIterator<Item = V>,
4958 V: std::convert::Into<crate::write::generated::gapic_storage::model::TableFieldSchema>,
4959 {
4960 use std::iter::Iterator;
4961 self.fields = v.into_iter().map(|i| i.into()).collect();
4962 self
4963 }
4964}
4965
4966impl wkt::message::Message for TableSchema {
4967 fn typename() -> &'static str {
4968 "type.googleapis.com/google.cloud.bigquery.storage.v1.TableSchema"
4969 }
4970}
4971
4972#[derive(Clone, Default, PartialEq)]
4974#[non_exhaustive]
4975pub struct TableFieldSchema {
4976 pub name: std::string::String,
4980
4981 pub r#type: crate::write::generated::gapic_storage::model::table_field_schema::Type,
4983
4984 pub mode: crate::write::generated::gapic_storage::model::table_field_schema::Mode,
4986
4987 pub fields: std::vec::Vec<crate::write::generated::gapic_storage::model::TableFieldSchema>,
4990
4991 pub description: std::string::String,
4993
4994 pub max_length: i64,
5007
5008 pub precision: i64,
5041
5042 pub scale: i64,
5044
5045 pub default_value_expression: std::string::String,
5048
5049 pub timestamp_precision: std::option::Option<wkt::Int64Value>,
5057
5058 pub range_element_type: std::option::Option<
5066 crate::write::generated::gapic_storage::model::table_field_schema::FieldElementType,
5067 >,
5068
5069 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5070}
5071
5072impl TableFieldSchema {
5073 pub fn new() -> Self {
5075 std::default::Default::default()
5076 }
5077
5078 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5080 self.name = v.into();
5081 self
5082 }
5083
5084 pub fn set_type<
5086 T: std::convert::Into<crate::write::generated::gapic_storage::model::table_field_schema::Type>,
5087 >(
5088 mut self,
5089 v: T,
5090 ) -> Self {
5091 self.r#type = v.into();
5092 self
5093 }
5094
5095 pub fn set_mode<
5097 T: std::convert::Into<crate::write::generated::gapic_storage::model::table_field_schema::Mode>,
5098 >(
5099 mut self,
5100 v: T,
5101 ) -> Self {
5102 self.mode = v.into();
5103 self
5104 }
5105
5106 pub fn set_fields<T, V>(mut self, v: T) -> Self
5108 where
5109 T: std::iter::IntoIterator<Item = V>,
5110 V: std::convert::Into<crate::write::generated::gapic_storage::model::TableFieldSchema>,
5111 {
5112 use std::iter::Iterator;
5113 self.fields = v.into_iter().map(|i| i.into()).collect();
5114 self
5115 }
5116
5117 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5119 self.description = v.into();
5120 self
5121 }
5122
5123 pub fn set_max_length<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5125 self.max_length = v.into();
5126 self
5127 }
5128
5129 pub fn set_precision<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5131 self.precision = v.into();
5132 self
5133 }
5134
5135 pub fn set_scale<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5137 self.scale = v.into();
5138 self
5139 }
5140
5141 pub fn set_default_value_expression<T: std::convert::Into<std::string::String>>(
5143 mut self,
5144 v: T,
5145 ) -> Self {
5146 self.default_value_expression = v.into();
5147 self
5148 }
5149
5150 pub fn set_timestamp_precision<T>(mut self, v: T) -> Self
5152 where
5153 T: std::convert::Into<wkt::Int64Value>,
5154 {
5155 self.timestamp_precision = std::option::Option::Some(v.into());
5156 self
5157 }
5158
5159 pub fn set_or_clear_timestamp_precision<T>(mut self, v: std::option::Option<T>) -> Self
5161 where
5162 T: std::convert::Into<wkt::Int64Value>,
5163 {
5164 self.timestamp_precision = v.map(|x| x.into());
5165 self
5166 }
5167
5168 pub fn set_range_element_type<T>(mut self, v: T) -> Self
5170 where
5171 T: std::convert::Into<
5172 crate::write::generated::gapic_storage::model::table_field_schema::FieldElementType,
5173 >,
5174 {
5175 self.range_element_type = std::option::Option::Some(v.into());
5176 self
5177 }
5178
5179 pub fn set_or_clear_range_element_type<T>(mut self, v: std::option::Option<T>) -> Self
5181 where
5182 T: std::convert::Into<
5183 crate::write::generated::gapic_storage::model::table_field_schema::FieldElementType,
5184 >,
5185 {
5186 self.range_element_type = v.map(|x| x.into());
5187 self
5188 }
5189}
5190
5191impl wkt::message::Message for TableFieldSchema {
5192 fn typename() -> &'static str {
5193 "type.googleapis.com/google.cloud.bigquery.storage.v1.TableFieldSchema"
5194 }
5195}
5196
5197pub mod table_field_schema {
5199 #[allow(unused_imports)]
5200 use super::*;
5201
5202 #[derive(Clone, Default, PartialEq)]
5204 #[non_exhaustive]
5205 pub struct FieldElementType {
5206 pub r#type: crate::write::generated::gapic_storage::model::table_field_schema::Type,
5208
5209 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5210 }
5211
5212 impl FieldElementType {
5213 pub fn new() -> Self {
5215 std::default::Default::default()
5216 }
5217
5218 pub fn set_type<
5220 T: std::convert::Into<
5221 crate::write::generated::gapic_storage::model::table_field_schema::Type,
5222 >,
5223 >(
5224 mut self,
5225 v: T,
5226 ) -> Self {
5227 self.r#type = v.into();
5228 self
5229 }
5230 }
5231
5232 impl wkt::message::Message for FieldElementType {
5233 fn typename() -> &'static str {
5234 "type.googleapis.com/google.cloud.bigquery.storage.v1.TableFieldSchema.FieldElementType"
5235 }
5236 }
5237
5238 #[derive(Clone, Debug, PartialEq)]
5254 #[non_exhaustive]
5255 pub enum Type {
5256 Unspecified,
5258 String,
5260 Int64,
5262 Double,
5264 Struct,
5266 Bytes,
5268 Bool,
5270 Timestamp,
5272 Date,
5274 Time,
5276 Datetime,
5278 Geography,
5280 Numeric,
5282 Bignumeric,
5284 Interval,
5286 Json,
5288 Range,
5290 UnknownValue(r#type::UnknownValue),
5295 }
5296
5297 #[doc(hidden)]
5298 pub mod r#type {
5299 #[allow(unused_imports)]
5300 use super::*;
5301 #[derive(Clone, Debug, PartialEq)]
5302 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5303 }
5304
5305 impl Type {
5306 pub fn value(&self) -> std::option::Option<i32> {
5311 match self {
5312 Self::Unspecified => std::option::Option::Some(0),
5313 Self::String => std::option::Option::Some(1),
5314 Self::Int64 => std::option::Option::Some(2),
5315 Self::Double => std::option::Option::Some(3),
5316 Self::Struct => std::option::Option::Some(4),
5317 Self::Bytes => std::option::Option::Some(5),
5318 Self::Bool => std::option::Option::Some(6),
5319 Self::Timestamp => std::option::Option::Some(7),
5320 Self::Date => std::option::Option::Some(8),
5321 Self::Time => std::option::Option::Some(9),
5322 Self::Datetime => std::option::Option::Some(10),
5323 Self::Geography => std::option::Option::Some(11),
5324 Self::Numeric => std::option::Option::Some(12),
5325 Self::Bignumeric => std::option::Option::Some(13),
5326 Self::Interval => std::option::Option::Some(14),
5327 Self::Json => std::option::Option::Some(15),
5328 Self::Range => std::option::Option::Some(16),
5329 Self::UnknownValue(u) => u.0.value(),
5330 }
5331 }
5332
5333 pub fn name(&self) -> std::option::Option<&str> {
5338 match self {
5339 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
5340 Self::String => std::option::Option::Some("STRING"),
5341 Self::Int64 => std::option::Option::Some("INT64"),
5342 Self::Double => std::option::Option::Some("DOUBLE"),
5343 Self::Struct => std::option::Option::Some("STRUCT"),
5344 Self::Bytes => std::option::Option::Some("BYTES"),
5345 Self::Bool => std::option::Option::Some("BOOL"),
5346 Self::Timestamp => std::option::Option::Some("TIMESTAMP"),
5347 Self::Date => std::option::Option::Some("DATE"),
5348 Self::Time => std::option::Option::Some("TIME"),
5349 Self::Datetime => std::option::Option::Some("DATETIME"),
5350 Self::Geography => std::option::Option::Some("GEOGRAPHY"),
5351 Self::Numeric => std::option::Option::Some("NUMERIC"),
5352 Self::Bignumeric => std::option::Option::Some("BIGNUMERIC"),
5353 Self::Interval => std::option::Option::Some("INTERVAL"),
5354 Self::Json => std::option::Option::Some("JSON"),
5355 Self::Range => std::option::Option::Some("RANGE"),
5356 Self::UnknownValue(u) => u.0.name(),
5357 }
5358 }
5359 }
5360
5361 impl std::default::Default for Type {
5362 fn default() -> Self {
5363 use std::convert::From;
5364 Self::from(0)
5365 }
5366 }
5367
5368 impl std::fmt::Display for Type {
5369 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5370 wkt::internal::display_enum(f, self.name(), self.value())
5371 }
5372 }
5373
5374 impl std::convert::From<i32> for Type {
5375 fn from(value: i32) -> Self {
5376 match value {
5377 0 => Self::Unspecified,
5378 1 => Self::String,
5379 2 => Self::Int64,
5380 3 => Self::Double,
5381 4 => Self::Struct,
5382 5 => Self::Bytes,
5383 6 => Self::Bool,
5384 7 => Self::Timestamp,
5385 8 => Self::Date,
5386 9 => Self::Time,
5387 10 => Self::Datetime,
5388 11 => Self::Geography,
5389 12 => Self::Numeric,
5390 13 => Self::Bignumeric,
5391 14 => Self::Interval,
5392 15 => Self::Json,
5393 16 => Self::Range,
5394 _ => Self::UnknownValue(r#type::UnknownValue(
5395 wkt::internal::UnknownEnumValue::Integer(value),
5396 )),
5397 }
5398 }
5399 }
5400
5401 impl std::convert::From<&str> for Type {
5402 fn from(value: &str) -> Self {
5403 use std::string::ToString;
5404 match value {
5405 "TYPE_UNSPECIFIED" => Self::Unspecified,
5406 "STRING" => Self::String,
5407 "INT64" => Self::Int64,
5408 "DOUBLE" => Self::Double,
5409 "STRUCT" => Self::Struct,
5410 "BYTES" => Self::Bytes,
5411 "BOOL" => Self::Bool,
5412 "TIMESTAMP" => Self::Timestamp,
5413 "DATE" => Self::Date,
5414 "TIME" => Self::Time,
5415 "DATETIME" => Self::Datetime,
5416 "GEOGRAPHY" => Self::Geography,
5417 "NUMERIC" => Self::Numeric,
5418 "BIGNUMERIC" => Self::Bignumeric,
5419 "INTERVAL" => Self::Interval,
5420 "JSON" => Self::Json,
5421 "RANGE" => Self::Range,
5422 _ => Self::UnknownValue(r#type::UnknownValue(
5423 wkt::internal::UnknownEnumValue::String(value.to_string()),
5424 )),
5425 }
5426 }
5427 }
5428
5429 impl serde::ser::Serialize for Type {
5430 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5431 where
5432 S: serde::Serializer,
5433 {
5434 match self {
5435 Self::Unspecified => serializer.serialize_i32(0),
5436 Self::String => serializer.serialize_i32(1),
5437 Self::Int64 => serializer.serialize_i32(2),
5438 Self::Double => serializer.serialize_i32(3),
5439 Self::Struct => serializer.serialize_i32(4),
5440 Self::Bytes => serializer.serialize_i32(5),
5441 Self::Bool => serializer.serialize_i32(6),
5442 Self::Timestamp => serializer.serialize_i32(7),
5443 Self::Date => serializer.serialize_i32(8),
5444 Self::Time => serializer.serialize_i32(9),
5445 Self::Datetime => serializer.serialize_i32(10),
5446 Self::Geography => serializer.serialize_i32(11),
5447 Self::Numeric => serializer.serialize_i32(12),
5448 Self::Bignumeric => serializer.serialize_i32(13),
5449 Self::Interval => serializer.serialize_i32(14),
5450 Self::Json => serializer.serialize_i32(15),
5451 Self::Range => serializer.serialize_i32(16),
5452 Self::UnknownValue(u) => u.0.serialize(serializer),
5453 }
5454 }
5455 }
5456
5457 impl<'de> serde::de::Deserialize<'de> for Type {
5458 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5459 where
5460 D: serde::Deserializer<'de>,
5461 {
5462 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
5463 ".google.cloud.bigquery.storage.v1.TableFieldSchema.Type",
5464 ))
5465 }
5466 }
5467
5468 #[derive(Clone, Debug, PartialEq)]
5484 #[non_exhaustive]
5485 pub enum Mode {
5486 Unspecified,
5488 #[allow(missing_docs)]
5489 Nullable,
5490 #[allow(missing_docs)]
5491 Required,
5492 #[allow(missing_docs)]
5493 Repeated,
5494 UnknownValue(mode::UnknownValue),
5499 }
5500
5501 #[doc(hidden)]
5502 pub mod mode {
5503 #[allow(unused_imports)]
5504 use super::*;
5505 #[derive(Clone, Debug, PartialEq)]
5506 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5507 }
5508
5509 impl Mode {
5510 pub fn value(&self) -> std::option::Option<i32> {
5515 match self {
5516 Self::Unspecified => std::option::Option::Some(0),
5517 Self::Nullable => std::option::Option::Some(1),
5518 Self::Required => std::option::Option::Some(2),
5519 Self::Repeated => std::option::Option::Some(3),
5520 Self::UnknownValue(u) => u.0.value(),
5521 }
5522 }
5523
5524 pub fn name(&self) -> std::option::Option<&str> {
5529 match self {
5530 Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
5531 Self::Nullable => std::option::Option::Some("NULLABLE"),
5532 Self::Required => std::option::Option::Some("REQUIRED"),
5533 Self::Repeated => std::option::Option::Some("REPEATED"),
5534 Self::UnknownValue(u) => u.0.name(),
5535 }
5536 }
5537 }
5538
5539 impl std::default::Default for Mode {
5540 fn default() -> Self {
5541 use std::convert::From;
5542 Self::from(0)
5543 }
5544 }
5545
5546 impl std::fmt::Display for Mode {
5547 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5548 wkt::internal::display_enum(f, self.name(), self.value())
5549 }
5550 }
5551
5552 impl std::convert::From<i32> for Mode {
5553 fn from(value: i32) -> Self {
5554 match value {
5555 0 => Self::Unspecified,
5556 1 => Self::Nullable,
5557 2 => Self::Required,
5558 3 => Self::Repeated,
5559 _ => Self::UnknownValue(mode::UnknownValue(
5560 wkt::internal::UnknownEnumValue::Integer(value),
5561 )),
5562 }
5563 }
5564 }
5565
5566 impl std::convert::From<&str> for Mode {
5567 fn from(value: &str) -> Self {
5568 use std::string::ToString;
5569 match value {
5570 "MODE_UNSPECIFIED" => Self::Unspecified,
5571 "NULLABLE" => Self::Nullable,
5572 "REQUIRED" => Self::Required,
5573 "REPEATED" => Self::Repeated,
5574 _ => Self::UnknownValue(mode::UnknownValue(
5575 wkt::internal::UnknownEnumValue::String(value.to_string()),
5576 )),
5577 }
5578 }
5579 }
5580
5581 impl serde::ser::Serialize for Mode {
5582 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5583 where
5584 S: serde::Serializer,
5585 {
5586 match self {
5587 Self::Unspecified => serializer.serialize_i32(0),
5588 Self::Nullable => serializer.serialize_i32(1),
5589 Self::Required => serializer.serialize_i32(2),
5590 Self::Repeated => serializer.serialize_i32(3),
5591 Self::UnknownValue(u) => u.0.serialize(serializer),
5592 }
5593 }
5594 }
5595
5596 impl<'de> serde::de::Deserialize<'de> for Mode {
5597 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5598 where
5599 D: serde::Deserializer<'de>,
5600 {
5601 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
5602 ".google.cloud.bigquery.storage.v1.TableFieldSchema.Mode",
5603 ))
5604 }
5605 }
5606}
5607
5608#[derive(Clone, Debug, PartialEq)]
5624#[non_exhaustive]
5625pub enum DataFormat {
5626 Unspecified,
5628 Avro,
5631 Arrow,
5634 UnknownValue(data_format::UnknownValue),
5639}
5640
5641#[doc(hidden)]
5642pub mod data_format {
5643 #[allow(unused_imports)]
5644 use super::*;
5645 #[derive(Clone, Debug, PartialEq)]
5646 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5647}
5648
5649impl DataFormat {
5650 pub fn value(&self) -> std::option::Option<i32> {
5655 match self {
5656 Self::Unspecified => std::option::Option::Some(0),
5657 Self::Avro => std::option::Option::Some(1),
5658 Self::Arrow => std::option::Option::Some(2),
5659 Self::UnknownValue(u) => u.0.value(),
5660 }
5661 }
5662
5663 pub fn name(&self) -> std::option::Option<&str> {
5668 match self {
5669 Self::Unspecified => std::option::Option::Some("DATA_FORMAT_UNSPECIFIED"),
5670 Self::Avro => std::option::Option::Some("AVRO"),
5671 Self::Arrow => std::option::Option::Some("ARROW"),
5672 Self::UnknownValue(u) => u.0.name(),
5673 }
5674 }
5675}
5676
5677impl std::default::Default for DataFormat {
5678 fn default() -> Self {
5679 use std::convert::From;
5680 Self::from(0)
5681 }
5682}
5683
5684impl std::fmt::Display for DataFormat {
5685 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5686 wkt::internal::display_enum(f, self.name(), self.value())
5687 }
5688}
5689
5690impl std::convert::From<i32> for DataFormat {
5691 fn from(value: i32) -> Self {
5692 match value {
5693 0 => Self::Unspecified,
5694 1 => Self::Avro,
5695 2 => Self::Arrow,
5696 _ => Self::UnknownValue(data_format::UnknownValue(
5697 wkt::internal::UnknownEnumValue::Integer(value),
5698 )),
5699 }
5700 }
5701}
5702
5703impl std::convert::From<&str> for DataFormat {
5704 fn from(value: &str) -> Self {
5705 use std::string::ToString;
5706 match value {
5707 "DATA_FORMAT_UNSPECIFIED" => Self::Unspecified,
5708 "AVRO" => Self::Avro,
5709 "ARROW" => Self::Arrow,
5710 _ => Self::UnknownValue(data_format::UnknownValue(
5711 wkt::internal::UnknownEnumValue::String(value.to_string()),
5712 )),
5713 }
5714 }
5715}
5716
5717impl serde::ser::Serialize for DataFormat {
5718 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5719 where
5720 S: serde::Serializer,
5721 {
5722 match self {
5723 Self::Unspecified => serializer.serialize_i32(0),
5724 Self::Avro => serializer.serialize_i32(1),
5725 Self::Arrow => serializer.serialize_i32(2),
5726 Self::UnknownValue(u) => u.0.serialize(serializer),
5727 }
5728 }
5729}
5730
5731impl<'de> serde::de::Deserialize<'de> for DataFormat {
5732 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5733 where
5734 D: serde::Deserializer<'de>,
5735 {
5736 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataFormat>::new(
5737 ".google.cloud.bigquery.storage.v1.DataFormat",
5738 ))
5739 }
5740}
5741
5742#[derive(Clone, Debug, PartialEq)]
5759#[non_exhaustive]
5760pub enum WriteStreamView {
5761 Unspecified,
5763 Basic,
5767 Full,
5771 UnknownValue(write_stream_view::UnknownValue),
5776}
5777
5778#[doc(hidden)]
5779pub mod write_stream_view {
5780 #[allow(unused_imports)]
5781 use super::*;
5782 #[derive(Clone, Debug, PartialEq)]
5783 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5784}
5785
5786impl WriteStreamView {
5787 pub fn value(&self) -> std::option::Option<i32> {
5792 match self {
5793 Self::Unspecified => std::option::Option::Some(0),
5794 Self::Basic => std::option::Option::Some(1),
5795 Self::Full => std::option::Option::Some(2),
5796 Self::UnknownValue(u) => u.0.value(),
5797 }
5798 }
5799
5800 pub fn name(&self) -> std::option::Option<&str> {
5805 match self {
5806 Self::Unspecified => std::option::Option::Some("WRITE_STREAM_VIEW_UNSPECIFIED"),
5807 Self::Basic => std::option::Option::Some("BASIC"),
5808 Self::Full => std::option::Option::Some("FULL"),
5809 Self::UnknownValue(u) => u.0.name(),
5810 }
5811 }
5812}
5813
5814impl std::default::Default for WriteStreamView {
5815 fn default() -> Self {
5816 use std::convert::From;
5817 Self::from(0)
5818 }
5819}
5820
5821impl std::fmt::Display for WriteStreamView {
5822 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5823 wkt::internal::display_enum(f, self.name(), self.value())
5824 }
5825}
5826
5827impl std::convert::From<i32> for WriteStreamView {
5828 fn from(value: i32) -> Self {
5829 match value {
5830 0 => Self::Unspecified,
5831 1 => Self::Basic,
5832 2 => Self::Full,
5833 _ => Self::UnknownValue(write_stream_view::UnknownValue(
5834 wkt::internal::UnknownEnumValue::Integer(value),
5835 )),
5836 }
5837 }
5838}
5839
5840impl std::convert::From<&str> for WriteStreamView {
5841 fn from(value: &str) -> Self {
5842 use std::string::ToString;
5843 match value {
5844 "WRITE_STREAM_VIEW_UNSPECIFIED" => Self::Unspecified,
5845 "BASIC" => Self::Basic,
5846 "FULL" => Self::Full,
5847 _ => Self::UnknownValue(write_stream_view::UnknownValue(
5848 wkt::internal::UnknownEnumValue::String(value.to_string()),
5849 )),
5850 }
5851 }
5852}
5853
5854impl serde::ser::Serialize for WriteStreamView {
5855 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5856 where
5857 S: serde::Serializer,
5858 {
5859 match self {
5860 Self::Unspecified => serializer.serialize_i32(0),
5861 Self::Basic => serializer.serialize_i32(1),
5862 Self::Full => serializer.serialize_i32(2),
5863 Self::UnknownValue(u) => u.0.serialize(serializer),
5864 }
5865 }
5866}
5867
5868impl<'de> serde::de::Deserialize<'de> for WriteStreamView {
5869 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5870 where
5871 D: serde::Deserializer<'de>,
5872 {
5873 deserializer.deserialize_any(wkt::internal::EnumVisitor::<WriteStreamView>::new(
5874 ".google.cloud.bigquery.storage.v1.WriteStreamView",
5875 ))
5876 }
5877}