google_cloud_rust_raw/cloud/osconfig/agentendpoint/v1/
agentendpoint_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_AGENT_ENDPOINT_SERVICE_RECEIVE_TASK_NOTIFICATION: ::grpcio::Method<super::agentendpoint::ReceiveTaskNotificationRequest, super::agentendpoint::ReceiveTaskNotificationResponse> = ::grpcio::Method {
20    ty: ::grpcio::MethodType::ServerStreaming,
21    name: "/google.cloud.osconfig.agentendpoint.v1.AgentEndpointService/ReceiveTaskNotification",
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_AGENT_ENDPOINT_SERVICE_START_NEXT_TASK: ::grpcio::Method<super::agentendpoint::StartNextTaskRequest, super::agentendpoint::StartNextTaskResponse> = ::grpcio::Method {
27    ty: ::grpcio::MethodType::Unary,
28    name: "/google.cloud.osconfig.agentendpoint.v1.AgentEndpointService/StartNextTask",
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_AGENT_ENDPOINT_SERVICE_REPORT_TASK_PROGRESS: ::grpcio::Method<super::agentendpoint::ReportTaskProgressRequest, super::agentendpoint::ReportTaskProgressResponse> = ::grpcio::Method {
34    ty: ::grpcio::MethodType::Unary,
35    name: "/google.cloud.osconfig.agentendpoint.v1.AgentEndpointService/ReportTaskProgress",
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_AGENT_ENDPOINT_SERVICE_REPORT_TASK_COMPLETE: ::grpcio::Method<super::agentendpoint::ReportTaskCompleteRequest, super::agentendpoint::ReportTaskCompleteResponse> = ::grpcio::Method {
41    ty: ::grpcio::MethodType::Unary,
42    name: "/google.cloud.osconfig.agentendpoint.v1.AgentEndpointService/ReportTaskComplete",
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_AGENT_ENDPOINT_SERVICE_REGISTER_AGENT: ::grpcio::Method<super::agentendpoint::RegisterAgentRequest, super::agentendpoint::RegisterAgentResponse> = ::grpcio::Method {
48    ty: ::grpcio::MethodType::Unary,
49    name: "/google.cloud.osconfig.agentendpoint.v1.AgentEndpointService/RegisterAgent",
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
54const METHOD_AGENT_ENDPOINT_SERVICE_REPORT_INVENTORY: ::grpcio::Method<super::agentendpoint::ReportInventoryRequest, super::agentendpoint::ReportInventoryResponse> = ::grpcio::Method {
55    ty: ::grpcio::MethodType::Unary,
56    name: "/google.cloud.osconfig.agentendpoint.v1.AgentEndpointService/ReportInventory",
57    req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
58    resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
59};
60
61#[derive(Clone)]
62pub struct AgentEndpointServiceClient {
63    pub client: ::grpcio::Client,
64}
65
66impl AgentEndpointServiceClient {
67    pub fn new(channel: ::grpcio::Channel) -> Self {
68        AgentEndpointServiceClient {
69            client: ::grpcio::Client::new(channel),
70        }
71    }
72
73    pub fn receive_task_notification_opt(&self, req: &super::agentendpoint::ReceiveTaskNotificationRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver<super::agentendpoint::ReceiveTaskNotificationResponse>> {
74        self.client.server_streaming(&METHOD_AGENT_ENDPOINT_SERVICE_RECEIVE_TASK_NOTIFICATION, req, opt)
75    }
76
77    pub fn receive_task_notification(&self, req: &super::agentendpoint::ReceiveTaskNotificationRequest) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver<super::agentendpoint::ReceiveTaskNotificationResponse>> {
78        self.receive_task_notification_opt(req, ::grpcio::CallOption::default())
79    }
80
81    pub fn start_next_task_opt(&self, req: &super::agentendpoint::StartNextTaskRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::agentendpoint::StartNextTaskResponse> {
82        self.client.unary_call(&METHOD_AGENT_ENDPOINT_SERVICE_START_NEXT_TASK, req, opt)
83    }
84
85    pub fn start_next_task(&self, req: &super::agentendpoint::StartNextTaskRequest) -> ::grpcio::Result<super::agentendpoint::StartNextTaskResponse> {
86        self.start_next_task_opt(req, ::grpcio::CallOption::default())
87    }
88
89    pub fn start_next_task_async_opt(&self, req: &super::agentendpoint::StartNextTaskRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::agentendpoint::StartNextTaskResponse>> {
90        self.client.unary_call_async(&METHOD_AGENT_ENDPOINT_SERVICE_START_NEXT_TASK, req, opt)
91    }
92
93    pub fn start_next_task_async(&self, req: &super::agentendpoint::StartNextTaskRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::agentendpoint::StartNextTaskResponse>> {
94        self.start_next_task_async_opt(req, ::grpcio::CallOption::default())
95    }
96
97    pub fn report_task_progress_opt(&self, req: &super::agentendpoint::ReportTaskProgressRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::agentendpoint::ReportTaskProgressResponse> {
98        self.client.unary_call(&METHOD_AGENT_ENDPOINT_SERVICE_REPORT_TASK_PROGRESS, req, opt)
99    }
100
101    pub fn report_task_progress(&self, req: &super::agentendpoint::ReportTaskProgressRequest) -> ::grpcio::Result<super::agentendpoint::ReportTaskProgressResponse> {
102        self.report_task_progress_opt(req, ::grpcio::CallOption::default())
103    }
104
105    pub fn report_task_progress_async_opt(&self, req: &super::agentendpoint::ReportTaskProgressRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::agentendpoint::ReportTaskProgressResponse>> {
106        self.client.unary_call_async(&METHOD_AGENT_ENDPOINT_SERVICE_REPORT_TASK_PROGRESS, req, opt)
107    }
108
109    pub fn report_task_progress_async(&self, req: &super::agentendpoint::ReportTaskProgressRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::agentendpoint::ReportTaskProgressResponse>> {
110        self.report_task_progress_async_opt(req, ::grpcio::CallOption::default())
111    }
112
113    pub fn report_task_complete_opt(&self, req: &super::agentendpoint::ReportTaskCompleteRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::agentendpoint::ReportTaskCompleteResponse> {
114        self.client.unary_call(&METHOD_AGENT_ENDPOINT_SERVICE_REPORT_TASK_COMPLETE, req, opt)
115    }
116
117    pub fn report_task_complete(&self, req: &super::agentendpoint::ReportTaskCompleteRequest) -> ::grpcio::Result<super::agentendpoint::ReportTaskCompleteResponse> {
118        self.report_task_complete_opt(req, ::grpcio::CallOption::default())
119    }
120
121    pub fn report_task_complete_async_opt(&self, req: &super::agentendpoint::ReportTaskCompleteRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::agentendpoint::ReportTaskCompleteResponse>> {
122        self.client.unary_call_async(&METHOD_AGENT_ENDPOINT_SERVICE_REPORT_TASK_COMPLETE, req, opt)
123    }
124
125    pub fn report_task_complete_async(&self, req: &super::agentendpoint::ReportTaskCompleteRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::agentendpoint::ReportTaskCompleteResponse>> {
126        self.report_task_complete_async_opt(req, ::grpcio::CallOption::default())
127    }
128
129    pub fn register_agent_opt(&self, req: &super::agentendpoint::RegisterAgentRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::agentendpoint::RegisterAgentResponse> {
130        self.client.unary_call(&METHOD_AGENT_ENDPOINT_SERVICE_REGISTER_AGENT, req, opt)
131    }
132
133    pub fn register_agent(&self, req: &super::agentendpoint::RegisterAgentRequest) -> ::grpcio::Result<super::agentendpoint::RegisterAgentResponse> {
134        self.register_agent_opt(req, ::grpcio::CallOption::default())
135    }
136
137    pub fn register_agent_async_opt(&self, req: &super::agentendpoint::RegisterAgentRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::agentendpoint::RegisterAgentResponse>> {
138        self.client.unary_call_async(&METHOD_AGENT_ENDPOINT_SERVICE_REGISTER_AGENT, req, opt)
139    }
140
141    pub fn register_agent_async(&self, req: &super::agentendpoint::RegisterAgentRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::agentendpoint::RegisterAgentResponse>> {
142        self.register_agent_async_opt(req, ::grpcio::CallOption::default())
143    }
144
145    pub fn report_inventory_opt(&self, req: &super::agentendpoint::ReportInventoryRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::agentendpoint::ReportInventoryResponse> {
146        self.client.unary_call(&METHOD_AGENT_ENDPOINT_SERVICE_REPORT_INVENTORY, req, opt)
147    }
148
149    pub fn report_inventory(&self, req: &super::agentendpoint::ReportInventoryRequest) -> ::grpcio::Result<super::agentendpoint::ReportInventoryResponse> {
150        self.report_inventory_opt(req, ::grpcio::CallOption::default())
151    }
152
153    pub fn report_inventory_async_opt(&self, req: &super::agentendpoint::ReportInventoryRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::agentendpoint::ReportInventoryResponse>> {
154        self.client.unary_call_async(&METHOD_AGENT_ENDPOINT_SERVICE_REPORT_INVENTORY, req, opt)
155    }
156
157    pub fn report_inventory_async(&self, req: &super::agentendpoint::ReportInventoryRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::agentendpoint::ReportInventoryResponse>> {
158        self.report_inventory_async_opt(req, ::grpcio::CallOption::default())
159    }
160    pub fn spawn<F>(&self, f: F) where F: ::std::future::Future<Output = ()> + Send + 'static {
161        self.client.spawn(f)
162    }
163}
164
165pub trait AgentEndpointService {
166    fn receive_task_notification(&mut self, ctx: ::grpcio::RpcContext, _req: super::agentendpoint::ReceiveTaskNotificationRequest, sink: ::grpcio::ServerStreamingSink<super::agentendpoint::ReceiveTaskNotificationResponse>) {
167        grpcio::unimplemented_call!(ctx, sink)
168    }
169    fn start_next_task(&mut self, ctx: ::grpcio::RpcContext, _req: super::agentendpoint::StartNextTaskRequest, sink: ::grpcio::UnarySink<super::agentendpoint::StartNextTaskResponse>) {
170        grpcio::unimplemented_call!(ctx, sink)
171    }
172    fn report_task_progress(&mut self, ctx: ::grpcio::RpcContext, _req: super::agentendpoint::ReportTaskProgressRequest, sink: ::grpcio::UnarySink<super::agentendpoint::ReportTaskProgressResponse>) {
173        grpcio::unimplemented_call!(ctx, sink)
174    }
175    fn report_task_complete(&mut self, ctx: ::grpcio::RpcContext, _req: super::agentendpoint::ReportTaskCompleteRequest, sink: ::grpcio::UnarySink<super::agentendpoint::ReportTaskCompleteResponse>) {
176        grpcio::unimplemented_call!(ctx, sink)
177    }
178    fn register_agent(&mut self, ctx: ::grpcio::RpcContext, _req: super::agentendpoint::RegisterAgentRequest, sink: ::grpcio::UnarySink<super::agentendpoint::RegisterAgentResponse>) {
179        grpcio::unimplemented_call!(ctx, sink)
180    }
181    fn report_inventory(&mut self, ctx: ::grpcio::RpcContext, _req: super::agentendpoint::ReportInventoryRequest, sink: ::grpcio::UnarySink<super::agentendpoint::ReportInventoryResponse>) {
182        grpcio::unimplemented_call!(ctx, sink)
183    }
184}
185
186pub fn create_agent_endpoint_service<S: AgentEndpointService + Send + Clone + 'static>(s: S) -> ::grpcio::Service {
187    let mut builder = ::grpcio::ServiceBuilder::new();
188    let mut instance = s.clone();
189    builder = builder.add_server_streaming_handler(&METHOD_AGENT_ENDPOINT_SERVICE_RECEIVE_TASK_NOTIFICATION, move |ctx, req, resp| {
190        instance.receive_task_notification(ctx, req, resp)
191    });
192    let mut instance = s.clone();
193    builder = builder.add_unary_handler(&METHOD_AGENT_ENDPOINT_SERVICE_START_NEXT_TASK, move |ctx, req, resp| {
194        instance.start_next_task(ctx, req, resp)
195    });
196    let mut instance = s.clone();
197    builder = builder.add_unary_handler(&METHOD_AGENT_ENDPOINT_SERVICE_REPORT_TASK_PROGRESS, move |ctx, req, resp| {
198        instance.report_task_progress(ctx, req, resp)
199    });
200    let mut instance = s.clone();
201    builder = builder.add_unary_handler(&METHOD_AGENT_ENDPOINT_SERVICE_REPORT_TASK_COMPLETE, move |ctx, req, resp| {
202        instance.report_task_complete(ctx, req, resp)
203    });
204    let mut instance = s.clone();
205    builder = builder.add_unary_handler(&METHOD_AGENT_ENDPOINT_SERVICE_REGISTER_AGENT, move |ctx, req, resp| {
206        instance.register_agent(ctx, req, resp)
207    });
208    let mut instance = s;
209    builder = builder.add_unary_handler(&METHOD_AGENT_ENDPOINT_SERVICE_REPORT_INVENTORY, move |ctx, req, resp| {
210        instance.report_inventory(ctx, req, resp)
211    });
212    builder.build()
213}