Skip to main content

google_cloud_bigquery/write/generated/gapic_storage/
builder.rs

1// Copyright 2026 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17/// Request and client builders for [Read][crate::client::Read].
18pub mod read {
19    use crate::Result;
20
21    /// A builder for [Read][crate::client::Read].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_bigquery::*;
26    /// # use builder::read::ClientBuilder;
27    /// # use client::Read;
28    /// let builder : ClientBuilder = Read::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://bigquerystorage.googleapis.com")
31    ///     .build().await?;
32    /// # Ok(()) }
33    /// ```
34    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::Read;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = Read;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> crate::ClientBuilderResult<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::Read] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::Read>,
55        request: R,
56        options: crate::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Read>) -> Self {
64            Self {
65                stub,
66                request: R::default(),
67                options: crate::RequestOptions::default(),
68            }
69        }
70    }
71
72    /// The request builder for [Read::create_read_session][crate::client::Read::create_read_session] calls.
73    ///
74    /// # Example
75    /// ```
76    /// # use google_cloud_bigquery::builder::read::CreateReadSession;
77    /// # async fn sample() -> google_cloud_bigquery::Result<()> {
78    ///
79    /// let builder = prepare_request_builder();
80    /// let response = builder.send().await?;
81    /// # Ok(()) }
82    ///
83    /// fn prepare_request_builder() -> CreateReadSession {
84    ///   # panic!();
85    ///   // ... details omitted ...
86    /// }
87    /// ```
88    #[derive(Clone, Debug)]
89    pub struct CreateReadSession(
90        RequestBuilder<crate::write::generated::gapic_storage::model::CreateReadSessionRequest>,
91    );
92
93    impl CreateReadSession {
94        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Read>) -> Self {
95            Self(RequestBuilder::new(stub))
96        }
97
98        /// Sets the full request, replacing any prior values.
99        pub fn with_request<
100            V: Into<crate::write::generated::gapic_storage::model::CreateReadSessionRequest>,
101        >(
102            mut self,
103            v: V,
104        ) -> Self {
105            self.0.request = v.into();
106            self
107        }
108
109        /// Sets all the options, replacing any prior values.
110        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111            self.0.options = v.into();
112            self
113        }
114
115        /// Sends the request.
116        pub async fn send(
117            self,
118        ) -> Result<crate::write::generated::gapic_storage::model::ReadSession> {
119            (*self.0.stub)
120                .create_read_session(self.0.request, self.0.options)
121                .await
122                .map(crate::Response::into_body)
123        }
124
125        /// Sets the value of [parent][crate::write::generated::gapic_storage::model::CreateReadSessionRequest::parent].
126        ///
127        /// This is a **required** field for requests.
128        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
129            self.0.request.parent = v.into();
130            self
131        }
132
133        /// Sets the value of [read_session][crate::write::generated::gapic_storage::model::CreateReadSessionRequest::read_session].
134        ///
135        /// This is a **required** field for requests.
136        pub fn set_read_session<T>(mut self, v: T) -> Self
137        where
138            T: std::convert::Into<crate::write::generated::gapic_storage::model::ReadSession>,
139        {
140            self.0.request.read_session = std::option::Option::Some(v.into());
141            self
142        }
143
144        /// Sets or clears the value of [read_session][crate::write::generated::gapic_storage::model::CreateReadSessionRequest::read_session].
145        ///
146        /// This is a **required** field for requests.
147        pub fn set_or_clear_read_session<T>(mut self, v: std::option::Option<T>) -> Self
148        where
149            T: std::convert::Into<crate::write::generated::gapic_storage::model::ReadSession>,
150        {
151            self.0.request.read_session = v.map(|x| x.into());
152            self
153        }
154
155        /// Sets the value of [max_stream_count][crate::write::generated::gapic_storage::model::CreateReadSessionRequest::max_stream_count].
156        pub fn set_max_stream_count<T: Into<i32>>(mut self, v: T) -> Self {
157            self.0.request.max_stream_count = v.into();
158            self
159        }
160
161        /// Sets the value of [preferred_min_stream_count][crate::write::generated::gapic_storage::model::CreateReadSessionRequest::preferred_min_stream_count].
162        pub fn set_preferred_min_stream_count<T: Into<i32>>(mut self, v: T) -> Self {
163            self.0.request.preferred_min_stream_count = v.into();
164            self
165        }
166    }
167
168    #[doc(hidden)]
169    impl crate::RequestBuilder for CreateReadSession {
170        fn request_options(&mut self) -> &mut crate::RequestOptions {
171            &mut self.0.options
172        }
173    }
174
175    /// The request builder for [Read::read_rows][crate::client::Read::read_rows] calls.
176    ///
177    /// # Example
178    /// ```
179    /// # use google_cloud_bigquery::builder::read::ReadRows;
180    /// # async fn sample() -> google_cloud_bigquery::Result<()> {
181    /// let builder = prepare_request_builder();
182    /// let mut resp_stream = builder.send().await?;
183    /// while let Some(response) = resp_stream.next().await {
184    ///     let response = response?;
185    ///     println!("response {:?}", response);
186    /// }
187    /// # Ok(()) }
188    ///
189    /// fn prepare_request_builder() -> ReadRows {
190    ///   # panic!();
191    ///   // ... details omitted ...
192    /// }
193    /// ```
194    #[derive(Clone, Debug)]
195    pub struct ReadRows(
196        RequestBuilder<crate::write::generated::gapic_storage::model::ReadRowsRequest>,
197    );
198
199    impl ReadRows {
200        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Read>) -> Self {
201            Self(RequestBuilder::new(stub))
202        }
203
204        /// Sets the full request, replacing any prior values.
205        pub fn with_request<
206            V: Into<crate::write::generated::gapic_storage::model::ReadRowsRequest>,
207        >(
208            mut self,
209            v: V,
210        ) -> Self {
211            self.0.request = v.into();
212            self
213        }
214
215        /// Sets all the options, replacing any prior values.
216        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
217            self.0.options = v.into();
218            self
219        }
220
221        /// Initiates the server stream.
222        pub async fn send(
223            self,
224        ) -> Result<
225            google_cloud_gax::streaming::ResponseStream<
226                crate::write::generated::gapic_storage::model::ReadRowsResponse,
227            >,
228        > {
229            (*self.0.stub)
230                .read_rows(self.0.request, self.0.options)
231                .await
232        }
233
234        /// Sets the value of [read_stream][crate::write::generated::gapic_storage::model::ReadRowsRequest::read_stream].
235        ///
236        /// This is a **required** field for requests.
237        pub fn set_read_stream<T: Into<std::string::String>>(mut self, v: T) -> Self {
238            self.0.request.read_stream = v.into();
239            self
240        }
241
242        /// Sets the value of [offset][crate::write::generated::gapic_storage::model::ReadRowsRequest::offset].
243        pub fn set_offset<T: Into<i64>>(mut self, v: T) -> Self {
244            self.0.request.offset = v.into();
245            self
246        }
247
248        /// Sets the value of [output_format_serialization_options][crate::write::generated::gapic_storage::model::ReadRowsRequest::output_format_serialization_options].
249        ///
250        /// Note that all the setters affecting `output_format_serialization_options` are
251        /// mutually exclusive.
252        pub fn set_output_format_serialization_options<T: Into<Option<crate::write::generated::gapic_storage::model::read_rows_request::OutputFormatSerializationOptions>>>(mut self, v: T) ->Self{
253            self.0.request.output_format_serialization_options = v.into();
254            self
255        }
256
257        /// Sets the value of [output_format_serialization_options][crate::write::generated::gapic_storage::model::ReadRowsRequest::output_format_serialization_options]
258        /// to hold a `ArrowSerializationOptions`.
259        ///
260        /// Note that all the setters affecting `output_format_serialization_options` are
261        /// mutually exclusive.
262        pub fn set_arrow_serialization_options<
263            T: std::convert::Into<
264                    std::boxed::Box<
265                        crate::write::generated::gapic_storage::model::ArrowSerializationOptions,
266                    >,
267                >,
268        >(
269            mut self,
270            v: T,
271        ) -> Self {
272            self.0.request = self.0.request.set_arrow_serialization_options(v);
273            self
274        }
275    }
276
277    #[doc(hidden)]
278    impl crate::RequestBuilder for ReadRows {
279        fn request_options(&mut self) -> &mut crate::RequestOptions {
280            &mut self.0.options
281        }
282    }
283
284    /// The request builder for [Read::split_read_stream][crate::client::Read::split_read_stream] calls.
285    ///
286    /// # Example
287    /// ```
288    /// # use google_cloud_bigquery::builder::read::SplitReadStream;
289    /// # async fn sample() -> google_cloud_bigquery::Result<()> {
290    ///
291    /// let builder = prepare_request_builder();
292    /// let response = builder.send().await?;
293    /// # Ok(()) }
294    ///
295    /// fn prepare_request_builder() -> SplitReadStream {
296    ///   # panic!();
297    ///   // ... details omitted ...
298    /// }
299    /// ```
300    #[derive(Clone, Debug)]
301    pub struct SplitReadStream(
302        RequestBuilder<crate::write::generated::gapic_storage::model::SplitReadStreamRequest>,
303    );
304
305    impl SplitReadStream {
306        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Read>) -> Self {
307            Self(RequestBuilder::new(stub))
308        }
309
310        /// Sets the full request, replacing any prior values.
311        pub fn with_request<
312            V: Into<crate::write::generated::gapic_storage::model::SplitReadStreamRequest>,
313        >(
314            mut self,
315            v: V,
316        ) -> Self {
317            self.0.request = v.into();
318            self
319        }
320
321        /// Sets all the options, replacing any prior values.
322        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
323            self.0.options = v.into();
324            self
325        }
326
327        /// Sends the request.
328        pub async fn send(
329            self,
330        ) -> Result<crate::write::generated::gapic_storage::model::SplitReadStreamResponse>
331        {
332            (*self.0.stub)
333                .split_read_stream(self.0.request, self.0.options)
334                .await
335                .map(crate::Response::into_body)
336        }
337
338        /// Sets the value of [name][crate::write::generated::gapic_storage::model::SplitReadStreamRequest::name].
339        ///
340        /// This is a **required** field for requests.
341        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
342            self.0.request.name = v.into();
343            self
344        }
345
346        /// Sets the value of [fraction][crate::write::generated::gapic_storage::model::SplitReadStreamRequest::fraction].
347        pub fn set_fraction<T: Into<f64>>(mut self, v: T) -> Self {
348            self.0.request.fraction = v.into();
349            self
350        }
351    }
352
353    #[doc(hidden)]
354    impl crate::RequestBuilder for SplitReadStream {
355        fn request_options(&mut self) -> &mut crate::RequestOptions {
356            &mut self.0.options
357        }
358    }
359}
360
361/// Request and client builders for [BigQueryWrite][crate::client::BigQueryWrite].
362pub mod big_query_write {
363    use crate::Result;
364
365    /// Common implementation for [crate::client::BigQueryWrite] request builders.
366    #[derive(Clone, Debug)]
367    pub(crate) struct RequestBuilder<R: std::default::Default> {
368        stub: std::sync::Arc<dyn super::super::stub::dynamic::BigQueryWrite>,
369        request: R,
370        options: crate::RequestOptions,
371    }
372
373    impl<R> RequestBuilder<R>
374    where
375        R: std::default::Default,
376    {
377        pub(crate) fn new(
378            stub: std::sync::Arc<dyn super::super::stub::dynamic::BigQueryWrite>,
379        ) -> Self {
380            Self {
381                stub,
382                request: R::default(),
383                options: crate::RequestOptions::default(),
384            }
385        }
386    }
387
388    /// Common implementation for [crate::client::BigQueryWrite] bidi stream builders.
389    #[derive(Clone, Debug)]
390    pub(crate) struct BidiStreamBuilder {
391        stub: std::sync::Arc<dyn super::super::stub::dynamic::BigQueryWrite>,
392        options: crate::RequestOptions,
393    }
394
395    impl BidiStreamBuilder {
396        pub(crate) fn new(
397            stub: std::sync::Arc<dyn super::super::stub::dynamic::BigQueryWrite>,
398        ) -> Self {
399            Self {
400                stub,
401                options: crate::RequestOptions::default(),
402            }
403        }
404    }
405
406    /// The request builder for [BigQueryWrite::create_write_stream][crate::client::BigQueryWrite::create_write_stream] calls.
407    #[derive(Clone, Debug)]
408    pub(crate) struct CreateWriteStream(
409        RequestBuilder<crate::write::generated::gapic_storage::model::CreateWriteStreamRequest>,
410    );
411
412    impl CreateWriteStream {
413        pub(crate) fn new(
414            stub: std::sync::Arc<dyn super::super::stub::dynamic::BigQueryWrite>,
415        ) -> Self {
416            Self(RequestBuilder::new(stub))
417        }
418
419        /// Sets the full request, replacing any prior values.
420        pub fn with_request<
421            V: Into<crate::write::generated::gapic_storage::model::CreateWriteStreamRequest>,
422        >(
423            mut self,
424            v: V,
425        ) -> Self {
426            self.0.request = v.into();
427            self
428        }
429
430        /// Sets all the options, replacing any prior values.
431        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
432            self.0.options = v.into();
433            self
434        }
435
436        /// Sends the request.
437        pub async fn send(
438            self,
439        ) -> Result<crate::write::generated::gapic_storage::model::WriteStream> {
440            (*self.0.stub)
441                .create_write_stream(self.0.request, self.0.options)
442                .await
443                .map(crate::Response::into_body)
444        }
445
446        /// Sets the value of [parent][crate::write::generated::gapic_storage::model::CreateWriteStreamRequest::parent].
447        ///
448        /// This is a **required** field for requests.
449        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
450            self.0.request.parent = v.into();
451            self
452        }
453
454        /// Sets the value of [write_stream][crate::write::generated::gapic_storage::model::CreateWriteStreamRequest::write_stream].
455        ///
456        /// This is a **required** field for requests.
457        pub fn set_write_stream<T>(mut self, v: T) -> Self
458        where
459            T: std::convert::Into<crate::write::generated::gapic_storage::model::WriteStream>,
460        {
461            self.0.request.write_stream = std::option::Option::Some(v.into());
462            self
463        }
464
465        /// Sets or clears the value of [write_stream][crate::write::generated::gapic_storage::model::CreateWriteStreamRequest::write_stream].
466        ///
467        /// This is a **required** field for requests.
468        pub fn set_or_clear_write_stream<T>(mut self, v: std::option::Option<T>) -> Self
469        where
470            T: std::convert::Into<crate::write::generated::gapic_storage::model::WriteStream>,
471        {
472            self.0.request.write_stream = v.map(|x| x.into());
473            self
474        }
475    }
476
477    #[doc(hidden)]
478    impl crate::RequestBuilder for CreateWriteStream {
479        fn request_options(&mut self) -> &mut crate::RequestOptions {
480            &mut self.0.options
481        }
482    }
483
484    /// The request builder for [BigQueryWrite::append_rows][crate::client::BigQueryWrite::append_rows] calls.
485    #[derive(Clone, Debug)]
486    pub(crate) struct AppendRows(BidiStreamBuilder);
487
488    impl AppendRows {
489        pub(crate) fn new(
490            stub: std::sync::Arc<dyn super::super::stub::dynamic::BigQueryWrite>,
491        ) -> Self {
492            Self(BidiStreamBuilder::new(stub))
493        }
494
495        /// Sets all the options, replacing any prior values.
496        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
497            self.0.options = v.into();
498            self
499        }
500
501        /// Initiates the bidirectional stream.
502        pub fn build(
503            self,
504        ) -> (
505            google_cloud_gax::streaming::RequestSender<
506                crate::write::generated::gapic_storage::model::AppendRowsRequest,
507            >,
508            google_cloud_gax::streaming::ResponseStream<
509                crate::write::generated::gapic_storage::model::AppendRowsResponse,
510            >,
511        ) {
512            (*self.0.stub).append_rows(self.0.options)
513        }
514    }
515
516    #[doc(hidden)]
517    impl crate::RequestBuilder for AppendRows {
518        fn request_options(&mut self) -> &mut crate::RequestOptions {
519            &mut self.0.options
520        }
521    }
522
523    /// The request builder for [BigQueryWrite::get_write_stream][crate::client::BigQueryWrite::get_write_stream] calls.
524    #[derive(Clone, Debug)]
525    pub(crate) struct GetWriteStream(
526        RequestBuilder<crate::write::generated::gapic_storage::model::GetWriteStreamRequest>,
527    );
528
529    impl GetWriteStream {
530        pub(crate) fn new(
531            stub: std::sync::Arc<dyn super::super::stub::dynamic::BigQueryWrite>,
532        ) -> Self {
533            Self(RequestBuilder::new(stub))
534        }
535
536        /// Sets the full request, replacing any prior values.
537        pub fn with_request<
538            V: Into<crate::write::generated::gapic_storage::model::GetWriteStreamRequest>,
539        >(
540            mut self,
541            v: V,
542        ) -> Self {
543            self.0.request = v.into();
544            self
545        }
546
547        /// Sets all the options, replacing any prior values.
548        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
549            self.0.options = v.into();
550            self
551        }
552
553        /// Sends the request.
554        pub async fn send(
555            self,
556        ) -> Result<crate::write::generated::gapic_storage::model::WriteStream> {
557            (*self.0.stub)
558                .get_write_stream(self.0.request, self.0.options)
559                .await
560                .map(crate::Response::into_body)
561        }
562
563        /// Sets the value of [name][crate::write::generated::gapic_storage::model::GetWriteStreamRequest::name].
564        ///
565        /// This is a **required** field for requests.
566        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
567            self.0.request.name = v.into();
568            self
569        }
570
571        /// Sets the value of [view][crate::write::generated::gapic_storage::model::GetWriteStreamRequest::view].
572        pub fn set_view<T: Into<crate::write::generated::gapic_storage::model::WriteStreamView>>(
573            mut self,
574            v: T,
575        ) -> Self {
576            self.0.request.view = v.into();
577            self
578        }
579    }
580
581    #[doc(hidden)]
582    impl crate::RequestBuilder for GetWriteStream {
583        fn request_options(&mut self) -> &mut crate::RequestOptions {
584            &mut self.0.options
585        }
586    }
587
588    /// The request builder for [BigQueryWrite::finalize_write_stream][crate::client::BigQueryWrite::finalize_write_stream] calls.
589    #[derive(Clone, Debug)]
590    pub(crate) struct FinalizeWriteStream(
591        RequestBuilder<crate::write::generated::gapic_storage::model::FinalizeWriteStreamRequest>,
592    );
593
594    impl FinalizeWriteStream {
595        pub(crate) fn new(
596            stub: std::sync::Arc<dyn super::super::stub::dynamic::BigQueryWrite>,
597        ) -> Self {
598            Self(RequestBuilder::new(stub))
599        }
600
601        /// Sets the full request, replacing any prior values.
602        pub fn with_request<
603            V: Into<crate::write::generated::gapic_storage::model::FinalizeWriteStreamRequest>,
604        >(
605            mut self,
606            v: V,
607        ) -> Self {
608            self.0.request = v.into();
609            self
610        }
611
612        /// Sets all the options, replacing any prior values.
613        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
614            self.0.options = v.into();
615            self
616        }
617
618        /// Sends the request.
619        pub async fn send(
620            self,
621        ) -> Result<crate::write::generated::gapic_storage::model::FinalizeWriteStreamResponse>
622        {
623            (*self.0.stub)
624                .finalize_write_stream(self.0.request, self.0.options)
625                .await
626                .map(crate::Response::into_body)
627        }
628
629        /// Sets the value of [name][crate::write::generated::gapic_storage::model::FinalizeWriteStreamRequest::name].
630        ///
631        /// This is a **required** field for requests.
632        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
633            self.0.request.name = v.into();
634            self
635        }
636    }
637
638    #[doc(hidden)]
639    impl crate::RequestBuilder for FinalizeWriteStream {
640        fn request_options(&mut self) -> &mut crate::RequestOptions {
641            &mut self.0.options
642        }
643    }
644
645    /// The request builder for [BigQueryWrite::batch_commit_write_streams][crate::client::BigQueryWrite::batch_commit_write_streams] calls.
646    #[derive(Clone, Debug)]
647    pub(crate) struct BatchCommitWriteStreams(
648        RequestBuilder<
649            crate::write::generated::gapic_storage::model::BatchCommitWriteStreamsRequest,
650        >,
651    );
652
653    impl BatchCommitWriteStreams {
654        pub(crate) fn new(
655            stub: std::sync::Arc<dyn super::super::stub::dynamic::BigQueryWrite>,
656        ) -> Self {
657            Self(RequestBuilder::new(stub))
658        }
659
660        /// Sets the full request, replacing any prior values.
661        pub fn with_request<
662            V: Into<crate::write::generated::gapic_storage::model::BatchCommitWriteStreamsRequest>,
663        >(
664            mut self,
665            v: V,
666        ) -> Self {
667            self.0.request = v.into();
668            self
669        }
670
671        /// Sets all the options, replacing any prior values.
672        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
673            self.0.options = v.into();
674            self
675        }
676
677        /// Sends the request.
678        pub async fn send(
679            self,
680        ) -> Result<crate::write::generated::gapic_storage::model::BatchCommitWriteStreamsResponse>
681        {
682            (*self.0.stub)
683                .batch_commit_write_streams(self.0.request, self.0.options)
684                .await
685                .map(crate::Response::into_body)
686        }
687
688        /// Sets the value of [parent][crate::write::generated::gapic_storage::model::BatchCommitWriteStreamsRequest::parent].
689        ///
690        /// This is a **required** field for requests.
691        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
692            self.0.request.parent = v.into();
693            self
694        }
695
696        /// Sets the value of [write_streams][crate::write::generated::gapic_storage::model::BatchCommitWriteStreamsRequest::write_streams].
697        ///
698        /// This is a **required** field for requests.
699        pub fn set_write_streams<T, V>(mut self, v: T) -> Self
700        where
701            T: std::iter::IntoIterator<Item = V>,
702            V: std::convert::Into<std::string::String>,
703        {
704            use std::iter::Iterator;
705            self.0.request.write_streams = v.into_iter().map(|i| i.into()).collect();
706            self
707        }
708    }
709
710    #[doc(hidden)]
711    impl crate::RequestBuilder for BatchCommitWriteStreams {
712        fn request_options(&mut self) -> &mut crate::RequestOptions {
713            &mut self.0.options
714        }
715    }
716
717    /// The request builder for [BigQueryWrite::flush_rows][crate::client::BigQueryWrite::flush_rows] calls.
718    #[derive(Clone, Debug)]
719    pub(crate) struct FlushRows(
720        RequestBuilder<crate::write::generated::gapic_storage::model::FlushRowsRequest>,
721    );
722
723    impl FlushRows {
724        pub(crate) fn new(
725            stub: std::sync::Arc<dyn super::super::stub::dynamic::BigQueryWrite>,
726        ) -> Self {
727            Self(RequestBuilder::new(stub))
728        }
729
730        /// Sets the full request, replacing any prior values.
731        pub fn with_request<
732            V: Into<crate::write::generated::gapic_storage::model::FlushRowsRequest>,
733        >(
734            mut self,
735            v: V,
736        ) -> Self {
737            self.0.request = v.into();
738            self
739        }
740
741        /// Sets all the options, replacing any prior values.
742        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
743            self.0.options = v.into();
744            self
745        }
746
747        /// Sends the request.
748        pub async fn send(
749            self,
750        ) -> Result<crate::write::generated::gapic_storage::model::FlushRowsResponse> {
751            (*self.0.stub)
752                .flush_rows(self.0.request, self.0.options)
753                .await
754                .map(crate::Response::into_body)
755        }
756
757        /// Sets the value of [write_stream][crate::write::generated::gapic_storage::model::FlushRowsRequest::write_stream].
758        ///
759        /// This is a **required** field for requests.
760        pub fn set_write_stream<T: Into<std::string::String>>(mut self, v: T) -> Self {
761            self.0.request.write_stream = v.into();
762            self
763        }
764
765        /// Sets the value of [offset][crate::write::generated::gapic_storage::model::FlushRowsRequest::offset].
766        pub fn set_offset<T>(mut self, v: T) -> Self
767        where
768            T: std::convert::Into<wkt::Int64Value>,
769        {
770            self.0.request.offset = std::option::Option::Some(v.into());
771            self
772        }
773
774        /// Sets or clears the value of [offset][crate::write::generated::gapic_storage::model::FlushRowsRequest::offset].
775        pub fn set_or_clear_offset<T>(mut self, v: std::option::Option<T>) -> Self
776        where
777            T: std::convert::Into<wkt::Int64Value>,
778        {
779            self.0.request.offset = v.map(|x| x.into());
780            self
781        }
782    }
783
784    #[doc(hidden)]
785    impl crate::RequestBuilder for FlushRows {
786        fn request_options(&mut self) -> &mut crate::RequestOptions {
787            &mut self.0.options
788        }
789    }
790}