google_cloud_rust_raw/longrunning/
operations_grpc.rs

1// This file is generated. Do not edit
2// @generated
3
4// https://github.com/Manishearth/rust-clippy/issues/702
5#![allow(unknown_lints)]
6#![allow(clippy::all)]
7
8#![allow(box_pointers)]
9#![allow(dead_code)]
10#![allow(missing_docs)]
11#![allow(non_camel_case_types)]
12#![allow(non_snake_case)]
13#![allow(non_upper_case_globals)]
14#![allow(trivial_casts)]
15#![allow(unsafe_code)]
16#![allow(unused_imports)]
17#![allow(unused_results)]
18
19const METHOD_OPERATIONS_LIST_OPERATIONS: ::grpcio::Method<super::operations::ListOperationsRequest, super::operations::ListOperationsResponse> = ::grpcio::Method {
20    ty: ::grpcio::MethodType::Unary,
21    name: "/google.longrunning.Operations/ListOperations",
22    req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
23    resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
24};
25
26const METHOD_OPERATIONS_GET_OPERATION: ::grpcio::Method<super::operations::GetOperationRequest, super::operations::Operation> = ::grpcio::Method {
27    ty: ::grpcio::MethodType::Unary,
28    name: "/google.longrunning.Operations/GetOperation",
29    req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
30    resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
31};
32
33const METHOD_OPERATIONS_DELETE_OPERATION: ::grpcio::Method<super::operations::DeleteOperationRequest, super::empty::Empty> = ::grpcio::Method {
34    ty: ::grpcio::MethodType::Unary,
35    name: "/google.longrunning.Operations/DeleteOperation",
36    req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
37    resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
38};
39
40const METHOD_OPERATIONS_CANCEL_OPERATION: ::grpcio::Method<super::operations::CancelOperationRequest, super::empty::Empty> = ::grpcio::Method {
41    ty: ::grpcio::MethodType::Unary,
42    name: "/google.longrunning.Operations/CancelOperation",
43    req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
44    resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
45};
46
47const METHOD_OPERATIONS_WAIT_OPERATION: ::grpcio::Method<super::operations::WaitOperationRequest, super::operations::Operation> = ::grpcio::Method {
48    ty: ::grpcio::MethodType::Unary,
49    name: "/google.longrunning.Operations/WaitOperation",
50    req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
51    resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
52};
53
54#[derive(Clone)]
55pub struct OperationsClient {
56    pub client: ::grpcio::Client,
57}
58
59impl OperationsClient {
60    pub fn new(channel: ::grpcio::Channel) -> Self {
61        OperationsClient {
62            client: ::grpcio::Client::new(channel),
63        }
64    }
65
66    pub fn list_operations_opt(&self, req: &super::operations::ListOperationsRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::operations::ListOperationsResponse> {
67        self.client.unary_call(&METHOD_OPERATIONS_LIST_OPERATIONS, req, opt)
68    }
69
70    pub fn list_operations(&self, req: &super::operations::ListOperationsRequest) -> ::grpcio::Result<super::operations::ListOperationsResponse> {
71        self.list_operations_opt(req, ::grpcio::CallOption::default())
72    }
73
74    pub fn list_operations_async_opt(&self, req: &super::operations::ListOperationsRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::operations::ListOperationsResponse>> {
75        self.client.unary_call_async(&METHOD_OPERATIONS_LIST_OPERATIONS, req, opt)
76    }
77
78    pub fn list_operations_async(&self, req: &super::operations::ListOperationsRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::operations::ListOperationsResponse>> {
79        self.list_operations_async_opt(req, ::grpcio::CallOption::default())
80    }
81
82    pub fn get_operation_opt(&self, req: &super::operations::GetOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::operations::Operation> {
83        self.client.unary_call(&METHOD_OPERATIONS_GET_OPERATION, req, opt)
84    }
85
86    pub fn get_operation(&self, req: &super::operations::GetOperationRequest) -> ::grpcio::Result<super::operations::Operation> {
87        self.get_operation_opt(req, ::grpcio::CallOption::default())
88    }
89
90    pub fn get_operation_async_opt(&self, req: &super::operations::GetOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::operations::Operation>> {
91        self.client.unary_call_async(&METHOD_OPERATIONS_GET_OPERATION, req, opt)
92    }
93
94    pub fn get_operation_async(&self, req: &super::operations::GetOperationRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::operations::Operation>> {
95        self.get_operation_async_opt(req, ::grpcio::CallOption::default())
96    }
97
98    pub fn delete_operation_opt(&self, req: &super::operations::DeleteOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::empty::Empty> {
99        self.client.unary_call(&METHOD_OPERATIONS_DELETE_OPERATION, req, opt)
100    }
101
102    pub fn delete_operation(&self, req: &super::operations::DeleteOperationRequest) -> ::grpcio::Result<super::empty::Empty> {
103        self.delete_operation_opt(req, ::grpcio::CallOption::default())
104    }
105
106    pub fn delete_operation_async_opt(&self, req: &super::operations::DeleteOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
107        self.client.unary_call_async(&METHOD_OPERATIONS_DELETE_OPERATION, req, opt)
108    }
109
110    pub fn delete_operation_async(&self, req: &super::operations::DeleteOperationRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
111        self.delete_operation_async_opt(req, ::grpcio::CallOption::default())
112    }
113
114    pub fn cancel_operation_opt(&self, req: &super::operations::CancelOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::empty::Empty> {
115        self.client.unary_call(&METHOD_OPERATIONS_CANCEL_OPERATION, req, opt)
116    }
117
118    pub fn cancel_operation(&self, req: &super::operations::CancelOperationRequest) -> ::grpcio::Result<super::empty::Empty> {
119        self.cancel_operation_opt(req, ::grpcio::CallOption::default())
120    }
121
122    pub fn cancel_operation_async_opt(&self, req: &super::operations::CancelOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
123        self.client.unary_call_async(&METHOD_OPERATIONS_CANCEL_OPERATION, req, opt)
124    }
125
126    pub fn cancel_operation_async(&self, req: &super::operations::CancelOperationRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::empty::Empty>> {
127        self.cancel_operation_async_opt(req, ::grpcio::CallOption::default())
128    }
129
130    pub fn wait_operation_opt(&self, req: &super::operations::WaitOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::operations::Operation> {
131        self.client.unary_call(&METHOD_OPERATIONS_WAIT_OPERATION, req, opt)
132    }
133
134    pub fn wait_operation(&self, req: &super::operations::WaitOperationRequest) -> ::grpcio::Result<super::operations::Operation> {
135        self.wait_operation_opt(req, ::grpcio::CallOption::default())
136    }
137
138    pub fn wait_operation_async_opt(&self, req: &super::operations::WaitOperationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::operations::Operation>> {
139        self.client.unary_call_async(&METHOD_OPERATIONS_WAIT_OPERATION, req, opt)
140    }
141
142    pub fn wait_operation_async(&self, req: &super::operations::WaitOperationRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::operations::Operation>> {
143        self.wait_operation_async_opt(req, ::grpcio::CallOption::default())
144    }
145    pub fn spawn<F>(&self, f: F) where F: ::std::future::Future<Output = ()> + Send + 'static {
146        self.client.spawn(f)
147    }
148}
149
150pub trait Operations {
151    fn list_operations(&mut self, ctx: ::grpcio::RpcContext, _req: super::operations::ListOperationsRequest, sink: ::grpcio::UnarySink<super::operations::ListOperationsResponse>) {
152        grpcio::unimplemented_call!(ctx, sink)
153    }
154    fn get_operation(&mut self, ctx: ::grpcio::RpcContext, _req: super::operations::GetOperationRequest, sink: ::grpcio::UnarySink<super::operations::Operation>) {
155        grpcio::unimplemented_call!(ctx, sink)
156    }
157    fn delete_operation(&mut self, ctx: ::grpcio::RpcContext, _req: super::operations::DeleteOperationRequest, sink: ::grpcio::UnarySink<super::empty::Empty>) {
158        grpcio::unimplemented_call!(ctx, sink)
159    }
160    fn cancel_operation(&mut self, ctx: ::grpcio::RpcContext, _req: super::operations::CancelOperationRequest, sink: ::grpcio::UnarySink<super::empty::Empty>) {
161        grpcio::unimplemented_call!(ctx, sink)
162    }
163    fn wait_operation(&mut self, ctx: ::grpcio::RpcContext, _req: super::operations::WaitOperationRequest, sink: ::grpcio::UnarySink<super::operations::Operation>) {
164        grpcio::unimplemented_call!(ctx, sink)
165    }
166}
167
168pub fn create_operations<S: Operations + Send + Clone + 'static>(s: S) -> ::grpcio::Service {
169    let mut builder = ::grpcio::ServiceBuilder::new();
170    let mut instance = s.clone();
171    builder = builder.add_unary_handler(&METHOD_OPERATIONS_LIST_OPERATIONS, move |ctx, req, resp| {
172        instance.list_operations(ctx, req, resp)
173    });
174    let mut instance = s.clone();
175    builder = builder.add_unary_handler(&METHOD_OPERATIONS_GET_OPERATION, move |ctx, req, resp| {
176        instance.get_operation(ctx, req, resp)
177    });
178    let mut instance = s.clone();
179    builder = builder.add_unary_handler(&METHOD_OPERATIONS_DELETE_OPERATION, move |ctx, req, resp| {
180        instance.delete_operation(ctx, req, resp)
181    });
182    let mut instance = s.clone();
183    builder = builder.add_unary_handler(&METHOD_OPERATIONS_CANCEL_OPERATION, move |ctx, req, resp| {
184        instance.cancel_operation(ctx, req, resp)
185    });
186    let mut instance = s;
187    builder = builder.add_unary_handler(&METHOD_OPERATIONS_WAIT_OPERATION, move |ctx, req, resp| {
188        instance.wait_operation(ctx, req, resp)
189    });
190    builder.build()
191}