1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
// This file is generated. Do not edit
// @generated

// https://github.com/Manishearth/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy::all)]

#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
#![allow(unsafe_code)]
#![allow(unused_imports)]
#![allow(unused_results)]

const METHOD_BIGTABLE_READ_ROWS: ::grpcio::Method<super::bigtable::ReadRowsRequest, super::bigtable::ReadRowsResponse> = ::grpcio::Method {
    ty: ::grpcio::MethodType::ServerStreaming,
    name: "/google.bigtable.v2.Bigtable/ReadRows",
    req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
    resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
};

const METHOD_BIGTABLE_SAMPLE_ROW_KEYS: ::grpcio::Method<super::bigtable::SampleRowKeysRequest, super::bigtable::SampleRowKeysResponse> = ::grpcio::Method {
    ty: ::grpcio::MethodType::ServerStreaming,
    name: "/google.bigtable.v2.Bigtable/SampleRowKeys",
    req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
    resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
};

const METHOD_BIGTABLE_MUTATE_ROW: ::grpcio::Method<super::bigtable::MutateRowRequest, super::bigtable::MutateRowResponse> = ::grpcio::Method {
    ty: ::grpcio::MethodType::Unary,
    name: "/google.bigtable.v2.Bigtable/MutateRow",
    req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
    resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
};

const METHOD_BIGTABLE_MUTATE_ROWS: ::grpcio::Method<super::bigtable::MutateRowsRequest, super::bigtable::MutateRowsResponse> = ::grpcio::Method {
    ty: ::grpcio::MethodType::ServerStreaming,
    name: "/google.bigtable.v2.Bigtable/MutateRows",
    req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
    resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
};

const METHOD_BIGTABLE_CHECK_AND_MUTATE_ROW: ::grpcio::Method<super::bigtable::CheckAndMutateRowRequest, super::bigtable::CheckAndMutateRowResponse> = ::grpcio::Method {
    ty: ::grpcio::MethodType::Unary,
    name: "/google.bigtable.v2.Bigtable/CheckAndMutateRow",
    req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
    resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
};

const METHOD_BIGTABLE_READ_MODIFY_WRITE_ROW: ::grpcio::Method<super::bigtable::ReadModifyWriteRowRequest, super::bigtable::ReadModifyWriteRowResponse> = ::grpcio::Method {
    ty: ::grpcio::MethodType::Unary,
    name: "/google.bigtable.v2.Bigtable/ReadModifyWriteRow",
    req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
    resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
};

#[derive(Clone)]
pub struct BigtableClient {
    client: ::grpcio::Client,
}

impl BigtableClient {
    pub fn new(channel: ::grpcio::Channel) -> Self {
        BigtableClient {
            client: ::grpcio::Client::new(channel),
        }
    }

    pub fn read_rows_opt(&self, req: &super::bigtable::ReadRowsRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver<super::bigtable::ReadRowsResponse>> {
        self.client.server_streaming(&METHOD_BIGTABLE_READ_ROWS, req, opt)
    }

    pub fn read_rows(&self, req: &super::bigtable::ReadRowsRequest) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver<super::bigtable::ReadRowsResponse>> {
        self.read_rows_opt(req, ::grpcio::CallOption::default())
    }

    pub fn sample_row_keys_opt(&self, req: &super::bigtable::SampleRowKeysRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver<super::bigtable::SampleRowKeysResponse>> {
        self.client.server_streaming(&METHOD_BIGTABLE_SAMPLE_ROW_KEYS, req, opt)
    }

    pub fn sample_row_keys(&self, req: &super::bigtable::SampleRowKeysRequest) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver<super::bigtable::SampleRowKeysResponse>> {
        self.sample_row_keys_opt(req, ::grpcio::CallOption::default())
    }

    pub fn mutate_row_opt(&self, req: &super::bigtable::MutateRowRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::bigtable::MutateRowResponse> {
        self.client.unary_call(&METHOD_BIGTABLE_MUTATE_ROW, req, opt)
    }

    pub fn mutate_row(&self, req: &super::bigtable::MutateRowRequest) -> ::grpcio::Result<super::bigtable::MutateRowResponse> {
        self.mutate_row_opt(req, ::grpcio::CallOption::default())
    }

    pub fn mutate_row_async_opt(&self, req: &super::bigtable::MutateRowRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::bigtable::MutateRowResponse>> {
        self.client.unary_call_async(&METHOD_BIGTABLE_MUTATE_ROW, req, opt)
    }

    pub fn mutate_row_async(&self, req: &super::bigtable::MutateRowRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::bigtable::MutateRowResponse>> {
        self.mutate_row_async_opt(req, ::grpcio::CallOption::default())
    }

    pub fn mutate_rows_opt(&self, req: &super::bigtable::MutateRowsRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver<super::bigtable::MutateRowsResponse>> {
        self.client.server_streaming(&METHOD_BIGTABLE_MUTATE_ROWS, req, opt)
    }

    pub fn mutate_rows(&self, req: &super::bigtable::MutateRowsRequest) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver<super::bigtable::MutateRowsResponse>> {
        self.mutate_rows_opt(req, ::grpcio::CallOption::default())
    }

    pub fn check_and_mutate_row_opt(&self, req: &super::bigtable::CheckAndMutateRowRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::bigtable::CheckAndMutateRowResponse> {
        self.client.unary_call(&METHOD_BIGTABLE_CHECK_AND_MUTATE_ROW, req, opt)
    }

    pub fn check_and_mutate_row(&self, req: &super::bigtable::CheckAndMutateRowRequest) -> ::grpcio::Result<super::bigtable::CheckAndMutateRowResponse> {
        self.check_and_mutate_row_opt(req, ::grpcio::CallOption::default())
    }

    pub fn check_and_mutate_row_async_opt(&self, req: &super::bigtable::CheckAndMutateRowRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::bigtable::CheckAndMutateRowResponse>> {
        self.client.unary_call_async(&METHOD_BIGTABLE_CHECK_AND_MUTATE_ROW, req, opt)
    }

    pub fn check_and_mutate_row_async(&self, req: &super::bigtable::CheckAndMutateRowRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::bigtable::CheckAndMutateRowResponse>> {
        self.check_and_mutate_row_async_opt(req, ::grpcio::CallOption::default())
    }

    pub fn read_modify_write_row_opt(&self, req: &super::bigtable::ReadModifyWriteRowRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::bigtable::ReadModifyWriteRowResponse> {
        self.client.unary_call(&METHOD_BIGTABLE_READ_MODIFY_WRITE_ROW, req, opt)
    }

    pub fn read_modify_write_row(&self, req: &super::bigtable::ReadModifyWriteRowRequest) -> ::grpcio::Result<super::bigtable::ReadModifyWriteRowResponse> {
        self.read_modify_write_row_opt(req, ::grpcio::CallOption::default())
    }

    pub fn read_modify_write_row_async_opt(&self, req: &super::bigtable::ReadModifyWriteRowRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::bigtable::ReadModifyWriteRowResponse>> {
        self.client.unary_call_async(&METHOD_BIGTABLE_READ_MODIFY_WRITE_ROW, req, opt)
    }

    pub fn read_modify_write_row_async(&self, req: &super::bigtable::ReadModifyWriteRowRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::bigtable::ReadModifyWriteRowResponse>> {
        self.read_modify_write_row_async_opt(req, ::grpcio::CallOption::default())
    }
    pub fn spawn<F>(&self, f: F) where F: ::std::future::Future<Output = ()> + Send + 'static {
        self.client.spawn(f)
    }
}

pub trait Bigtable {
    fn read_rows(&mut self, ctx: ::grpcio::RpcContext, _req: super::bigtable::ReadRowsRequest, sink: ::grpcio::ServerStreamingSink<super::bigtable::ReadRowsResponse>) {
        grpcio::unimplemented_call!(ctx, sink)
    }
    fn sample_row_keys(&mut self, ctx: ::grpcio::RpcContext, _req: super::bigtable::SampleRowKeysRequest, sink: ::grpcio::ServerStreamingSink<super::bigtable::SampleRowKeysResponse>) {
        grpcio::unimplemented_call!(ctx, sink)
    }
    fn mutate_row(&mut self, ctx: ::grpcio::RpcContext, _req: super::bigtable::MutateRowRequest, sink: ::grpcio::UnarySink<super::bigtable::MutateRowResponse>) {
        grpcio::unimplemented_call!(ctx, sink)
    }
    fn mutate_rows(&mut self, ctx: ::grpcio::RpcContext, _req: super::bigtable::MutateRowsRequest, sink: ::grpcio::ServerStreamingSink<super::bigtable::MutateRowsResponse>) {
        grpcio::unimplemented_call!(ctx, sink)
    }
    fn check_and_mutate_row(&mut self, ctx: ::grpcio::RpcContext, _req: super::bigtable::CheckAndMutateRowRequest, sink: ::grpcio::UnarySink<super::bigtable::CheckAndMutateRowResponse>) {
        grpcio::unimplemented_call!(ctx, sink)
    }
    fn read_modify_write_row(&mut self, ctx: ::grpcio::RpcContext, _req: super::bigtable::ReadModifyWriteRowRequest, sink: ::grpcio::UnarySink<super::bigtable::ReadModifyWriteRowResponse>) {
        grpcio::unimplemented_call!(ctx, sink)
    }
}

pub fn create_bigtable<S: Bigtable + Send + Clone + 'static>(s: S) -> ::grpcio::Service {
    let mut builder = ::grpcio::ServiceBuilder::new();
    let mut instance = s.clone();
    builder = builder.add_server_streaming_handler(&METHOD_BIGTABLE_READ_ROWS, move |ctx, req, resp| {
        instance.read_rows(ctx, req, resp)
    });
    let mut instance = s.clone();
    builder = builder.add_server_streaming_handler(&METHOD_BIGTABLE_SAMPLE_ROW_KEYS, move |ctx, req, resp| {
        instance.sample_row_keys(ctx, req, resp)
    });
    let mut instance = s.clone();
    builder = builder.add_unary_handler(&METHOD_BIGTABLE_MUTATE_ROW, move |ctx, req, resp| {
        instance.mutate_row(ctx, req, resp)
    });
    let mut instance = s.clone();
    builder = builder.add_server_streaming_handler(&METHOD_BIGTABLE_MUTATE_ROWS, move |ctx, req, resp| {
        instance.mutate_rows(ctx, req, resp)
    });
    let mut instance = s.clone();
    builder = builder.add_unary_handler(&METHOD_BIGTABLE_CHECK_AND_MUTATE_ROW, move |ctx, req, resp| {
        instance.check_and_mutate_row(ctx, req, resp)
    });
    let mut instance = s;
    builder = builder.add_unary_handler(&METHOD_BIGTABLE_READ_MODIFY_WRITE_ROW, move |ctx, req, resp| {
        instance.read_modify_write_row(ctx, req, resp)
    });
    builder.build()
}