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
#![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_OPERATIONS_LIST_OPERATIONS: ::grpcio::Method<super::operations::ListOperationsRequest, super::operations::ListOperationsResponse> = ::grpcio::Method {
ty: ::grpcio::MethodType::Unary,
name: "/google.longrunning.Operations/ListOperations",
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_OPERATIONS_GET_OPERATION: ::grpcio::Method<super::operations::GetOperationRequest, super::operations::Operation> = ::grpcio::Method {
ty: ::grpcio::MethodType::Unary,
name: "/google.longrunning.Operations/GetOperation",
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_OPERATIONS_DELETE_OPERATION: ::grpcio::Method<super::operations::DeleteOperationRequest, super::empty::Empty> = ::grpcio::Method {
ty: ::grpcio::MethodType::Unary,
name: "/google.longrunning.Operations/DeleteOperation",
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_OPERATIONS_CANCEL_OPERATION: ::grpcio::Method<super::operations::CancelOperationRequest, super::empty::Empty> = ::grpcio::Method {
ty: ::grpcio::MethodType::Unary,
name: "/google.longrunning.Operations/CancelOperation",
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_OPERATIONS_WAIT_OPERATION: ::grpcio::Method<super::operations::WaitOperationRequest, super::operations::Operation> = ::grpcio::Method {
ty: ::grpcio::MethodType::Unary,
name: "/google.longrunning.Operations/WaitOperation",
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 OperationsClient {
client: ::grpcio::Client,
}
impl OperationsClient {
pub fn new(channel: ::grpcio::Channel) -> Self {
OperationsClient {
client: ::grpcio::Client::new(channel),
}
}
pub fn list_operations_opt(&self, req: &super::operations::ListOperationsRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::operations::ListOperationsResponse> {
self.client.unary_call(&METHOD_OPERATIONS_LIST_OPERATIONS, req, opt)
}
pub fn list_operations(&self, req: &super::operations::ListOperationsRequest) -> ::grpcio::Result<super::operations::ListOperationsResponse> {
self.list_operations_opt(req, ::grpcio::CallOption::default())
}
pub fn list_operations_async_opt(&self, req: &super::operations::ListOperationsRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::operations::ListOperationsResponse>> {
self.client.unary_call_async(&METHOD_OPERATIONS_LIST_OPERATIONS, req, opt)
}
pub fn list_operations_async(&self, req: &super::operations::ListOperationsRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::operations::ListOperationsResponse>> {
self.list_operations_async_opt(req, ::grpcio::CallOption::default())
}
pub fn get_operation_opt(&self, req: &super::operations::GetOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::operations::Operation> {
self.client.unary_call(&METHOD_OPERATIONS_GET_OPERATION, req, opt)
}
pub fn get_operation(&self, req: &super::operations::GetOperationRequest) -> ::grpcio::Result<super::operations::Operation> {
self.get_operation_opt(req, ::grpcio::CallOption::default())
}
pub fn get_operation_async_opt(&self, req: &super::operations::GetOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::operations::Operation>> {
self.client.unary_call_async(&METHOD_OPERATIONS_GET_OPERATION, req, opt)
}
pub fn get_operation_async(&self, req: &super::operations::GetOperationRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::operations::Operation>> {
self.get_operation_async_opt(req, ::grpcio::CallOption::default())
}
pub fn delete_operation_opt(&self, req: &super::operations::DeleteOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::empty::Empty> {
self.client.unary_call(&METHOD_OPERATIONS_DELETE_OPERATION, req, opt)
}
pub fn delete_operation(&self, req: &super::operations::DeleteOperationRequest) -> ::grpcio::Result<super::empty::Empty> {
self.delete_operation_opt(req, ::grpcio::CallOption::default())
}
pub fn delete_operation_async_opt(&self, req: &super::operations::DeleteOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
self.client.unary_call_async(&METHOD_OPERATIONS_DELETE_OPERATION, req, opt)
}
pub fn delete_operation_async(&self, req: &super::operations::DeleteOperationRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
self.delete_operation_async_opt(req, ::grpcio::CallOption::default())
}
pub fn cancel_operation_opt(&self, req: &super::operations::CancelOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::empty::Empty> {
self.client.unary_call(&METHOD_OPERATIONS_CANCEL_OPERATION, req, opt)
}
pub fn cancel_operation(&self, req: &super::operations::CancelOperationRequest) -> ::grpcio::Result<super::empty::Empty> {
self.cancel_operation_opt(req, ::grpcio::CallOption::default())
}
pub fn cancel_operation_async_opt(&self, req: &super::operations::CancelOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
self.client.unary_call_async(&METHOD_OPERATIONS_CANCEL_OPERATION, req, opt)
}
pub fn cancel_operation_async(&self, req: &super::operations::CancelOperationRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
self.cancel_operation_async_opt(req, ::grpcio::CallOption::default())
}
pub fn wait_operation_opt(&self, req: &super::operations::WaitOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::operations::Operation> {
self.client.unary_call(&METHOD_OPERATIONS_WAIT_OPERATION, req, opt)
}
pub fn wait_operation(&self, req: &super::operations::WaitOperationRequest) -> ::grpcio::Result<super::operations::Operation> {
self.wait_operation_opt(req, ::grpcio::CallOption::default())
}
pub fn wait_operation_async_opt(&self, req: &super::operations::WaitOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::operations::Operation>> {
self.client.unary_call_async(&METHOD_OPERATIONS_WAIT_OPERATION, req, opt)
}
pub fn wait_operation_async(&self, req: &super::operations::WaitOperationRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::operations::Operation>> {
self.wait_operation_async_opt(req, ::grpcio::CallOption::default())
}
pub fn spawn<F>(&self, f: F) where F: ::futures::Future<Output = ()> + Send + 'static {
self.client.spawn(f)
}
}
pub trait Operations {
fn list_operations(&mut self, ctx: ::grpcio::RpcContext, _req: super::operations::ListOperationsRequest, sink: ::grpcio::UnarySink<super::operations::ListOperationsResponse>) {
grpcio::unimplemented_call!(ctx, sink)
}
fn get_operation(&mut self, ctx: ::grpcio::RpcContext, _req: super::operations::GetOperationRequest, sink: ::grpcio::UnarySink<super::operations::Operation>) {
grpcio::unimplemented_call!(ctx, sink)
}
fn delete_operation(&mut self, ctx: ::grpcio::RpcContext, _req: super::operations::DeleteOperationRequest, sink: ::grpcio::UnarySink<super::empty::Empty>) {
grpcio::unimplemented_call!(ctx, sink)
}
fn cancel_operation(&mut self, ctx: ::grpcio::RpcContext, _req: super::operations::CancelOperationRequest, sink: ::grpcio::UnarySink<super::empty::Empty>) {
grpcio::unimplemented_call!(ctx, sink)
}
fn wait_operation(&mut self, ctx: ::grpcio::RpcContext, _req: super::operations::WaitOperationRequest, sink: ::grpcio::UnarySink<super::operations::Operation>) {
grpcio::unimplemented_call!(ctx, sink)
}
}
pub fn create_operations<S: Operations + Send + Clone + 'static>(s: S) -> ::grpcio::Service {
let mut builder = ::grpcio::ServiceBuilder::new();
let mut instance = s.clone();
builder = builder.add_unary_handler(&METHOD_OPERATIONS_LIST_OPERATIONS, move |ctx, req, resp| {
instance.list_operations(ctx, req, resp)
});
let mut instance = s.clone();
builder = builder.add_unary_handler(&METHOD_OPERATIONS_GET_OPERATION, move |ctx, req, resp| {
instance.get_operation(ctx, req, resp)
});
let mut instance = s.clone();
builder = builder.add_unary_handler(&METHOD_OPERATIONS_DELETE_OPERATION, move |ctx, req, resp| {
instance.delete_operation(ctx, req, resp)
});
let mut instance = s.clone();
builder = builder.add_unary_handler(&METHOD_OPERATIONS_CANCEL_OPERATION, move |ctx, req, resp| {
instance.cancel_operation(ctx, req, resp)
});
let mut instance = s;
builder = builder.add_unary_handler(&METHOD_OPERATIONS_WAIT_OPERATION, move |ctx, req, resp| {
instance.wait_operation(ctx, req, resp)
});
builder.build()
}