Skip to main content

google_cloud_bigquery/write/generated/gapic_storage/
stub.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//! Traits to mock the clients in this library.
18//!
19//! Application developers may need to mock the clients in this library to test
20//! how their application works with different (and sometimes hard to trigger)
21//! client and service behavior. Such test can define mocks implementing the
22//! trait(s) defined in this module, initialize the client with an instance of
23//! this mock in their tests, and verify their application responds as expected.
24
25#![allow(rustdoc::broken_intra_doc_links)]
26
27pub(crate) mod dynamic;
28
29/// Defines the trait used to implement [super::client::Read].
30///
31/// Application developers may need to implement this trait to mock
32/// `client::Read`.  In other use-cases, application developers only
33/// use `client::Read` and need not be concerned with this trait or
34/// its implementations.
35///
36/// Services gain new RPCs routinely. Consequently, this trait gains new methods
37/// too. To avoid breaking applications the trait provides a default
38/// implementation of each method. Most of these implementations just return an
39/// error.
40pub trait Read: std::fmt::Debug + Send + Sync {
41    /// Implements [super::client::Read::create_read_session].
42    fn create_read_session(
43        &self,
44        _req: crate::write::generated::gapic_storage::model::CreateReadSessionRequest,
45        _options: crate::RequestOptions,
46    ) -> impl std::future::Future<
47        Output = crate::Result<
48            crate::Response<crate::write::generated::gapic_storage::model::ReadSession>,
49        >,
50    > + Send {
51        gaxi::unimplemented::unimplemented_stub()
52    }
53
54    /// Implements [super::client::Read::read_rows].
55    fn read_rows(
56        &self,
57        _req: crate::write::generated::gapic_storage::model::ReadRowsRequest,
58        _options: crate::RequestOptions,
59    ) -> impl std::future::Future<
60        Output = crate::Result<
61            google_cloud_gax::streaming::ResponseStream<
62                crate::write::generated::gapic_storage::model::ReadRowsResponse,
63            >,
64        >,
65    > + Send {
66        gaxi::unimplemented::unimplemented_server_streaming_stub()
67    }
68
69    /// Implements [super::client::Read::split_read_stream].
70    fn split_read_stream(
71        &self,
72        _req: crate::write::generated::gapic_storage::model::SplitReadStreamRequest,
73        _options: crate::RequestOptions,
74    ) -> impl std::future::Future<
75        Output = crate::Result<
76            crate::Response<crate::write::generated::gapic_storage::model::SplitReadStreamResponse>,
77        >,
78    > + Send {
79        gaxi::unimplemented::unimplemented_stub()
80    }
81}
82
83/// Defines the trait used to implement [super::client::BigQueryWrite].
84///
85/// Application developers may need to implement this trait to mock
86/// `client::BigQueryWrite`.  In other use-cases, application developers only
87/// use `client::BigQueryWrite` and need not be concerned with this trait or
88/// its implementations.
89///
90/// Services gain new RPCs routinely. Consequently, this trait gains new methods
91/// too. To avoid breaking applications the trait provides a default
92/// implementation of each method. Most of these implementations just return an
93/// error.
94pub trait BigQueryWrite: std::fmt::Debug + Send + Sync {
95    /// Implements [super::client::BigQueryWrite::create_write_stream].
96    fn create_write_stream(
97        &self,
98        _req: crate::write::generated::gapic_storage::model::CreateWriteStreamRequest,
99        _options: crate::RequestOptions,
100    ) -> impl std::future::Future<
101        Output = crate::Result<
102            crate::Response<crate::write::generated::gapic_storage::model::WriteStream>,
103        >,
104    > + Send {
105        gaxi::unimplemented::unimplemented_stub()
106    }
107
108    /// Implements [super::client::BigQueryWrite::append_rows].
109    fn append_rows(
110        &self,
111        _options: crate::RequestOptions,
112    ) -> (
113        google_cloud_gax::streaming::RequestSender<
114            crate::write::generated::gapic_storage::model::AppendRowsRequest,
115        >,
116        google_cloud_gax::streaming::ResponseStream<
117            crate::write::generated::gapic_storage::model::AppendRowsResponse,
118        >,
119    ) {
120        gaxi::unimplemented::unimplemented_bidi_stub()
121    }
122
123    /// Implements [super::client::BigQueryWrite::get_write_stream].
124    fn get_write_stream(
125        &self,
126        _req: crate::write::generated::gapic_storage::model::GetWriteStreamRequest,
127        _options: crate::RequestOptions,
128    ) -> impl std::future::Future<
129        Output = crate::Result<
130            crate::Response<crate::write::generated::gapic_storage::model::WriteStream>,
131        >,
132    > + Send {
133        gaxi::unimplemented::unimplemented_stub()
134    }
135
136    /// Implements [super::client::BigQueryWrite::finalize_write_stream].
137    fn finalize_write_stream(
138        &self,
139        _req: crate::write::generated::gapic_storage::model::FinalizeWriteStreamRequest,
140        _options: crate::RequestOptions,
141    ) -> impl std::future::Future<
142        Output = crate::Result<
143            crate::Response<
144                crate::write::generated::gapic_storage::model::FinalizeWriteStreamResponse,
145            >,
146        >,
147    > + Send {
148        gaxi::unimplemented::unimplemented_stub()
149    }
150
151    /// Implements [super::client::BigQueryWrite::batch_commit_write_streams].
152    fn batch_commit_write_streams(
153        &self,
154        _req: crate::write::generated::gapic_storage::model::BatchCommitWriteStreamsRequest,
155        _options: crate::RequestOptions,
156    ) -> impl std::future::Future<
157        Output = crate::Result<
158            crate::Response<
159                crate::write::generated::gapic_storage::model::BatchCommitWriteStreamsResponse,
160            >,
161        >,
162    > + Send {
163        gaxi::unimplemented::unimplemented_stub()
164    }
165
166    /// Implements [super::client::BigQueryWrite::flush_rows].
167    fn flush_rows(
168        &self,
169        _req: crate::write::generated::gapic_storage::model::FlushRowsRequest,
170        _options: crate::RequestOptions,
171    ) -> impl std::future::Future<
172        Output = crate::Result<
173            crate::Response<crate::write::generated::gapic_storage::model::FlushRowsResponse>,
174        >,
175    > + Send {
176        gaxi::unimplemented::unimplemented_stub()
177    }
178}