1pub mod open_fga_service_client {
4 #![allow(
5 unused_variables,
6 dead_code,
7 missing_docs,
8 clippy::wildcard_imports,
9 clippy::let_unit_value,
10 )]
11 use tonic::codegen::*;
12 use tonic::codegen::http::Uri;
13 #[derive(Debug, Clone)]
14 pub struct OpenFgaServiceClient<T> {
15 inner: tonic::client::Grpc<T>,
16 }
17 impl OpenFgaServiceClient<tonic::transport::Channel> {
18 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
20 where
21 D: TryInto<tonic::transport::Endpoint>,
22 D::Error: Into<StdError>,
23 {
24 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
25 Ok(Self::new(conn))
26 }
27 }
28 impl<T> OpenFgaServiceClient<T>
29 where
30 T: tonic::client::GrpcService<tonic::body::Body>,
31 T::Error: Into<StdError>,
32 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
33 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
34 {
35 pub fn new(inner: T) -> Self {
36 let inner = tonic::client::Grpc::new(inner);
37 Self { inner }
38 }
39 pub fn with_origin(inner: T, origin: Uri) -> Self {
40 let inner = tonic::client::Grpc::with_origin(inner, origin);
41 Self { inner }
42 }
43 pub fn with_interceptor<F>(
44 inner: T,
45 interceptor: F,
46 ) -> OpenFgaServiceClient<InterceptedService<T, F>>
47 where
48 F: tonic::service::Interceptor,
49 T::ResponseBody: Default,
50 T: tonic::codegen::Service<
51 http::Request<tonic::body::Body>,
52 Response = http::Response<
53 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
54 >,
55 >,
56 <T as tonic::codegen::Service<
57 http::Request<tonic::body::Body>,
58 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
59 {
60 OpenFgaServiceClient::new(InterceptedService::new(inner, interceptor))
61 }
62 #[must_use]
67 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
68 self.inner = self.inner.send_compressed(encoding);
69 self
70 }
71 #[must_use]
73 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
74 self.inner = self.inner.accept_compressed(encoding);
75 self
76 }
77 #[must_use]
81 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
82 self.inner = self.inner.max_decoding_message_size(limit);
83 self
84 }
85 #[must_use]
89 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
90 self.inner = self.inner.max_encoding_message_size(limit);
91 self
92 }
93 pub async fn read(
94 &mut self,
95 request: impl tonic::IntoRequest<super::ReadRequest>,
96 ) -> std::result::Result<tonic::Response<super::ReadResponse>, tonic::Status> {
97 self.inner
98 .ready()
99 .await
100 .map_err(|e| {
101 tonic::Status::unknown(
102 format!("Service was not ready: {}", e.into()),
103 )
104 })?;
105 let codec = tonic_prost::ProstCodec::default();
106 let path = http::uri::PathAndQuery::from_static(
107 "/openfga.v1.OpenFGAService/Read",
108 );
109 let mut req = request.into_request();
110 req.extensions_mut()
111 .insert(GrpcMethod::new("openfga.v1.OpenFGAService", "Read"));
112 self.inner.unary(req, path, codec).await
113 }
114 pub async fn write(
115 &mut self,
116 request: impl tonic::IntoRequest<super::WriteRequest>,
117 ) -> std::result::Result<tonic::Response<super::WriteResponse>, tonic::Status> {
118 self.inner
119 .ready()
120 .await
121 .map_err(|e| {
122 tonic::Status::unknown(
123 format!("Service was not ready: {}", e.into()),
124 )
125 })?;
126 let codec = tonic_prost::ProstCodec::default();
127 let path = http::uri::PathAndQuery::from_static(
128 "/openfga.v1.OpenFGAService/Write",
129 );
130 let mut req = request.into_request();
131 req.extensions_mut()
132 .insert(GrpcMethod::new("openfga.v1.OpenFGAService", "Write"));
133 self.inner.unary(req, path, codec).await
134 }
135 pub async fn check(
136 &mut self,
137 request: impl tonic::IntoRequest<super::CheckRequest>,
138 ) -> std::result::Result<tonic::Response<super::CheckResponse>, tonic::Status> {
139 self.inner
140 .ready()
141 .await
142 .map_err(|e| {
143 tonic::Status::unknown(
144 format!("Service was not ready: {}", e.into()),
145 )
146 })?;
147 let codec = tonic_prost::ProstCodec::default();
148 let path = http::uri::PathAndQuery::from_static(
149 "/openfga.v1.OpenFGAService/Check",
150 );
151 let mut req = request.into_request();
152 req.extensions_mut()
153 .insert(GrpcMethod::new("openfga.v1.OpenFGAService", "Check"));
154 self.inner.unary(req, path, codec).await
155 }
156 pub async fn batch_check(
157 &mut self,
158 request: impl tonic::IntoRequest<super::BatchCheckRequest>,
159 ) -> std::result::Result<
160 tonic::Response<super::BatchCheckResponse>,
161 tonic::Status,
162 > {
163 self.inner
164 .ready()
165 .await
166 .map_err(|e| {
167 tonic::Status::unknown(
168 format!("Service was not ready: {}", e.into()),
169 )
170 })?;
171 let codec = tonic_prost::ProstCodec::default();
172 let path = http::uri::PathAndQuery::from_static(
173 "/openfga.v1.OpenFGAService/BatchCheck",
174 );
175 let mut req = request.into_request();
176 req.extensions_mut()
177 .insert(GrpcMethod::new("openfga.v1.OpenFGAService", "BatchCheck"));
178 self.inner.unary(req, path, codec).await
179 }
180 pub async fn expand(
181 &mut self,
182 request: impl tonic::IntoRequest<super::ExpandRequest>,
183 ) -> std::result::Result<tonic::Response<super::ExpandResponse>, tonic::Status> {
184 self.inner
185 .ready()
186 .await
187 .map_err(|e| {
188 tonic::Status::unknown(
189 format!("Service was not ready: {}", e.into()),
190 )
191 })?;
192 let codec = tonic_prost::ProstCodec::default();
193 let path = http::uri::PathAndQuery::from_static(
194 "/openfga.v1.OpenFGAService/Expand",
195 );
196 let mut req = request.into_request();
197 req.extensions_mut()
198 .insert(GrpcMethod::new("openfga.v1.OpenFGAService", "Expand"));
199 self.inner.unary(req, path, codec).await
200 }
201 pub async fn read_authorization_models(
202 &mut self,
203 request: impl tonic::IntoRequest<super::ReadAuthorizationModelsRequest>,
204 ) -> std::result::Result<
205 tonic::Response<super::ReadAuthorizationModelsResponse>,
206 tonic::Status,
207 > {
208 self.inner
209 .ready()
210 .await
211 .map_err(|e| {
212 tonic::Status::unknown(
213 format!("Service was not ready: {}", e.into()),
214 )
215 })?;
216 let codec = tonic_prost::ProstCodec::default();
217 let path = http::uri::PathAndQuery::from_static(
218 "/openfga.v1.OpenFGAService/ReadAuthorizationModels",
219 );
220 let mut req = request.into_request();
221 req.extensions_mut()
222 .insert(
223 GrpcMethod::new(
224 "openfga.v1.OpenFGAService",
225 "ReadAuthorizationModels",
226 ),
227 );
228 self.inner.unary(req, path, codec).await
229 }
230 pub async fn read_authorization_model(
231 &mut self,
232 request: impl tonic::IntoRequest<super::ReadAuthorizationModelRequest>,
233 ) -> std::result::Result<
234 tonic::Response<super::ReadAuthorizationModelResponse>,
235 tonic::Status,
236 > {
237 self.inner
238 .ready()
239 .await
240 .map_err(|e| {
241 tonic::Status::unknown(
242 format!("Service was not ready: {}", e.into()),
243 )
244 })?;
245 let codec = tonic_prost::ProstCodec::default();
246 let path = http::uri::PathAndQuery::from_static(
247 "/openfga.v1.OpenFGAService/ReadAuthorizationModel",
248 );
249 let mut req = request.into_request();
250 req.extensions_mut()
251 .insert(
252 GrpcMethod::new(
253 "openfga.v1.OpenFGAService",
254 "ReadAuthorizationModel",
255 ),
256 );
257 self.inner.unary(req, path, codec).await
258 }
259 pub async fn write_authorization_model(
260 &mut self,
261 request: impl tonic::IntoRequest<super::WriteAuthorizationModelRequest>,
262 ) -> std::result::Result<
263 tonic::Response<super::WriteAuthorizationModelResponse>,
264 tonic::Status,
265 > {
266 self.inner
267 .ready()
268 .await
269 .map_err(|e| {
270 tonic::Status::unknown(
271 format!("Service was not ready: {}", e.into()),
272 )
273 })?;
274 let codec = tonic_prost::ProstCodec::default();
275 let path = http::uri::PathAndQuery::from_static(
276 "/openfga.v1.OpenFGAService/WriteAuthorizationModel",
277 );
278 let mut req = request.into_request();
279 req.extensions_mut()
280 .insert(
281 GrpcMethod::new(
282 "openfga.v1.OpenFGAService",
283 "WriteAuthorizationModel",
284 ),
285 );
286 self.inner.unary(req, path, codec).await
287 }
288 pub async fn write_assertions(
289 &mut self,
290 request: impl tonic::IntoRequest<super::WriteAssertionsRequest>,
291 ) -> std::result::Result<
292 tonic::Response<super::WriteAssertionsResponse>,
293 tonic::Status,
294 > {
295 self.inner
296 .ready()
297 .await
298 .map_err(|e| {
299 tonic::Status::unknown(
300 format!("Service was not ready: {}", e.into()),
301 )
302 })?;
303 let codec = tonic_prost::ProstCodec::default();
304 let path = http::uri::PathAndQuery::from_static(
305 "/openfga.v1.OpenFGAService/WriteAssertions",
306 );
307 let mut req = request.into_request();
308 req.extensions_mut()
309 .insert(GrpcMethod::new("openfga.v1.OpenFGAService", "WriteAssertions"));
310 self.inner.unary(req, path, codec).await
311 }
312 pub async fn read_assertions(
313 &mut self,
314 request: impl tonic::IntoRequest<super::ReadAssertionsRequest>,
315 ) -> std::result::Result<
316 tonic::Response<super::ReadAssertionsResponse>,
317 tonic::Status,
318 > {
319 self.inner
320 .ready()
321 .await
322 .map_err(|e| {
323 tonic::Status::unknown(
324 format!("Service was not ready: {}", e.into()),
325 )
326 })?;
327 let codec = tonic_prost::ProstCodec::default();
328 let path = http::uri::PathAndQuery::from_static(
329 "/openfga.v1.OpenFGAService/ReadAssertions",
330 );
331 let mut req = request.into_request();
332 req.extensions_mut()
333 .insert(GrpcMethod::new("openfga.v1.OpenFGAService", "ReadAssertions"));
334 self.inner.unary(req, path, codec).await
335 }
336 pub async fn read_changes(
337 &mut self,
338 request: impl tonic::IntoRequest<super::ReadChangesRequest>,
339 ) -> std::result::Result<
340 tonic::Response<super::ReadChangesResponse>,
341 tonic::Status,
342 > {
343 self.inner
344 .ready()
345 .await
346 .map_err(|e| {
347 tonic::Status::unknown(
348 format!("Service was not ready: {}", e.into()),
349 )
350 })?;
351 let codec = tonic_prost::ProstCodec::default();
352 let path = http::uri::PathAndQuery::from_static(
353 "/openfga.v1.OpenFGAService/ReadChanges",
354 );
355 let mut req = request.into_request();
356 req.extensions_mut()
357 .insert(GrpcMethod::new("openfga.v1.OpenFGAService", "ReadChanges"));
358 self.inner.unary(req, path, codec).await
359 }
360 pub async fn create_store(
361 &mut self,
362 request: impl tonic::IntoRequest<super::CreateStoreRequest>,
363 ) -> std::result::Result<
364 tonic::Response<super::CreateStoreResponse>,
365 tonic::Status,
366 > {
367 self.inner
368 .ready()
369 .await
370 .map_err(|e| {
371 tonic::Status::unknown(
372 format!("Service was not ready: {}", e.into()),
373 )
374 })?;
375 let codec = tonic_prost::ProstCodec::default();
376 let path = http::uri::PathAndQuery::from_static(
377 "/openfga.v1.OpenFGAService/CreateStore",
378 );
379 let mut req = request.into_request();
380 req.extensions_mut()
381 .insert(GrpcMethod::new("openfga.v1.OpenFGAService", "CreateStore"));
382 self.inner.unary(req, path, codec).await
383 }
384 pub async fn update_store(
385 &mut self,
386 request: impl tonic::IntoRequest<super::UpdateStoreRequest>,
387 ) -> std::result::Result<
388 tonic::Response<super::UpdateStoreResponse>,
389 tonic::Status,
390 > {
391 self.inner
392 .ready()
393 .await
394 .map_err(|e| {
395 tonic::Status::unknown(
396 format!("Service was not ready: {}", e.into()),
397 )
398 })?;
399 let codec = tonic_prost::ProstCodec::default();
400 let path = http::uri::PathAndQuery::from_static(
401 "/openfga.v1.OpenFGAService/UpdateStore",
402 );
403 let mut req = request.into_request();
404 req.extensions_mut()
405 .insert(GrpcMethod::new("openfga.v1.OpenFGAService", "UpdateStore"));
406 self.inner.unary(req, path, codec).await
407 }
408 pub async fn delete_store(
409 &mut self,
410 request: impl tonic::IntoRequest<super::DeleteStoreRequest>,
411 ) -> std::result::Result<
412 tonic::Response<super::DeleteStoreResponse>,
413 tonic::Status,
414 > {
415 self.inner
416 .ready()
417 .await
418 .map_err(|e| {
419 tonic::Status::unknown(
420 format!("Service was not ready: {}", e.into()),
421 )
422 })?;
423 let codec = tonic_prost::ProstCodec::default();
424 let path = http::uri::PathAndQuery::from_static(
425 "/openfga.v1.OpenFGAService/DeleteStore",
426 );
427 let mut req = request.into_request();
428 req.extensions_mut()
429 .insert(GrpcMethod::new("openfga.v1.OpenFGAService", "DeleteStore"));
430 self.inner.unary(req, path, codec).await
431 }
432 pub async fn get_store(
433 &mut self,
434 request: impl tonic::IntoRequest<super::GetStoreRequest>,
435 ) -> std::result::Result<
436 tonic::Response<super::GetStoreResponse>,
437 tonic::Status,
438 > {
439 self.inner
440 .ready()
441 .await
442 .map_err(|e| {
443 tonic::Status::unknown(
444 format!("Service was not ready: {}", e.into()),
445 )
446 })?;
447 let codec = tonic_prost::ProstCodec::default();
448 let path = http::uri::PathAndQuery::from_static(
449 "/openfga.v1.OpenFGAService/GetStore",
450 );
451 let mut req = request.into_request();
452 req.extensions_mut()
453 .insert(GrpcMethod::new("openfga.v1.OpenFGAService", "GetStore"));
454 self.inner.unary(req, path, codec).await
455 }
456 pub async fn list_stores(
457 &mut self,
458 request: impl tonic::IntoRequest<super::ListStoresRequest>,
459 ) -> std::result::Result<
460 tonic::Response<super::ListStoresResponse>,
461 tonic::Status,
462 > {
463 self.inner
464 .ready()
465 .await
466 .map_err(|e| {
467 tonic::Status::unknown(
468 format!("Service was not ready: {}", e.into()),
469 )
470 })?;
471 let codec = tonic_prost::ProstCodec::default();
472 let path = http::uri::PathAndQuery::from_static(
473 "/openfga.v1.OpenFGAService/ListStores",
474 );
475 let mut req = request.into_request();
476 req.extensions_mut()
477 .insert(GrpcMethod::new("openfga.v1.OpenFGAService", "ListStores"));
478 self.inner.unary(req, path, codec).await
479 }
480 pub async fn streamed_list_objects(
481 &mut self,
482 request: impl tonic::IntoRequest<super::StreamedListObjectsRequest>,
483 ) -> std::result::Result<
484 tonic::Response<tonic::codec::Streaming<super::StreamedListObjectsResponse>>,
485 tonic::Status,
486 > {
487 self.inner
488 .ready()
489 .await
490 .map_err(|e| {
491 tonic::Status::unknown(
492 format!("Service was not ready: {}", e.into()),
493 )
494 })?;
495 let codec = tonic_prost::ProstCodec::default();
496 let path = http::uri::PathAndQuery::from_static(
497 "/openfga.v1.OpenFGAService/StreamedListObjects",
498 );
499 let mut req = request.into_request();
500 req.extensions_mut()
501 .insert(
502 GrpcMethod::new("openfga.v1.OpenFGAService", "StreamedListObjects"),
503 );
504 self.inner.server_streaming(req, path, codec).await
505 }
506 pub async fn list_objects(
507 &mut self,
508 request: impl tonic::IntoRequest<super::ListObjectsRequest>,
509 ) -> std::result::Result<
510 tonic::Response<super::ListObjectsResponse>,
511 tonic::Status,
512 > {
513 self.inner
514 .ready()
515 .await
516 .map_err(|e| {
517 tonic::Status::unknown(
518 format!("Service was not ready: {}", e.into()),
519 )
520 })?;
521 let codec = tonic_prost::ProstCodec::default();
522 let path = http::uri::PathAndQuery::from_static(
523 "/openfga.v1.OpenFGAService/ListObjects",
524 );
525 let mut req = request.into_request();
526 req.extensions_mut()
527 .insert(GrpcMethod::new("openfga.v1.OpenFGAService", "ListObjects"));
528 self.inner.unary(req, path, codec).await
529 }
530 pub async fn list_users(
531 &mut self,
532 request: impl tonic::IntoRequest<super::ListUsersRequest>,
533 ) -> std::result::Result<
534 tonic::Response<super::ListUsersResponse>,
535 tonic::Status,
536 > {
537 self.inner
538 .ready()
539 .await
540 .map_err(|e| {
541 tonic::Status::unknown(
542 format!("Service was not ready: {}", e.into()),
543 )
544 })?;
545 let codec = tonic_prost::ProstCodec::default();
546 let path = http::uri::PathAndQuery::from_static(
547 "/openfga.v1.OpenFGAService/ListUsers",
548 );
549 let mut req = request.into_request();
550 req.extensions_mut()
551 .insert(GrpcMethod::new("openfga.v1.OpenFGAService", "ListUsers"));
552 self.inner.unary(req, path, codec).await
553 }
554 }
555}