gcp_client/google/cloud/servicedirectory/
v1beta1.rs

1/// A container for [services][google.cloud.servicedirectory.v1beta1.Service].
2/// Namespaces allow administrators to group services together and define
3/// permissions for a collection of services.
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct Namespace {
6    /// Immutable. The resource name for the namespace in the format
7    /// 'projects/*/locations/*/namespaces/*'.
8    #[prost(string, tag="1")]
9    pub name: std::string::String,
10    /// Optional. Resource labels associated with this Namespace.
11    /// No more than 64 user labels can be associated with a given resource.  Label
12    /// keys and values can be no longer than 63 characters.
13    #[prost(map="string, string", tag="2")]
14    pub labels: ::std::collections::HashMap<std::string::String, std::string::String>,
15}
16/// An individual endpoint that provides a
17/// [service][google.cloud.servicedirectory.v1beta1.Service]. The service must
18/// already exist to create an endpoint.
19#[derive(Clone, PartialEq, ::prost::Message)]
20pub struct Endpoint {
21    /// Immutable. The resource name for the endpoint in the format
22    /// 'projects/*/locations/*/namespaces/*/services/*/endpoints/*'.
23    #[prost(string, tag="1")]
24    pub name: std::string::String,
25    /// Optional. An IPv4 or IPv6 address. Service Directory will reject bad
26    /// addresses like:
27    ///   "8.8.8"
28    ///   "8.8.8.8:53"
29    ///   "test:bad:address"
30    ///   "[::1]"
31    ///   "[::1]:8080"
32    /// Limited to 45 characters.
33    #[prost(string, tag="2")]
34    pub address: std::string::String,
35    /// Optional. Service Directory will reject values outside of [0, 65535].
36    #[prost(int32, tag="3")]
37    pub port: i32,
38    /// Optional. Metadata for the endpoint. This data can be consumed by service
39    /// clients.  The entire metadata dictionary may contain up to 512 characters,
40    /// spread accoss all key-value pairs. Metadata that goes beyond any these
41    /// limits will be rejected.
42    #[prost(map="string, string", tag="4")]
43    pub metadata: ::std::collections::HashMap<std::string::String, std::string::String>,
44}
45/// An individual service. A service contains a name and optional metadata.
46/// A service must exist before
47/// [endpoints][google.cloud.servicedirectory.v1beta1.Endpoint] can be
48/// added to it.
49#[derive(Clone, PartialEq, ::prost::Message)]
50pub struct Service {
51    /// Immutable. The resource name for the service in the format
52    /// 'projects/*/locations/*/namespaces/*/services/*'.
53    #[prost(string, tag="1")]
54    pub name: std::string::String,
55    /// Optional. Metadata for the service. This data can be consumed by service
56    /// clients.  The entire metadata dictionary may contain up to 2000 characters,
57    /// spread across all key-value pairs. Metadata that goes beyond any these
58    /// limits will be rejected.
59    #[prost(map="string, string", tag="2")]
60    pub metadata: ::std::collections::HashMap<std::string::String, std::string::String>,
61    /// Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
62    /// Control plane clients should use RegistrationService.ListEndpoints.
63    #[prost(message, repeated, tag="3")]
64    pub endpoints: ::std::vec::Vec<Endpoint>,
65}
66/// The request message for [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService].
67/// Looks up a service by its name, returns the service and its endpoints.
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct ResolveServiceRequest {
70    /// Required. The name of the service to resolve.
71    #[prost(string, tag="1")]
72    pub name: std::string::String,
73    /// Optional. The maximum number of endpoints to return. Defaults to 25. Maximum is 100.
74    /// If a value less than one is specified, the Default is used.
75    /// If a value greater than the Maximum is specified, the Maximum is used.
76    #[prost(int32, tag="2")]
77    pub max_endpoints: i32,
78    /// Optional. The filter applied to the endpoints of the resolved service.
79    ///
80    /// General filter string syntax:
81    /// <field> <operator> <value> (<logical connector>)
82    /// <field> can be "name" or "metadata.<key>" for map field.
83    /// <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is
84    /// roughly the same as "=".
85    /// <value> must be the same data type as the field.
86    /// <logical connector> can be "AND, OR, NOT".
87    ///
88    /// Examples of valid filters:
89    /// * "metadata.owner" returns Endpoints that have a label with the
90    ///   key "owner", this is the same as "metadata:owner"
91    /// * "metadata.protocol=gRPC" returns Endpoints that have key/value
92    ///   "protocol=gRPC"
93    /// * "metadata.owner!=sd AND metadata.foo=bar" returns
94    ///   Endpoints that have "owner" field in metadata with a value that is not
95    ///   "sd" AND have the key/value foo=bar.
96    #[prost(string, tag="3")]
97    pub endpoint_filter: std::string::String,
98}
99/// The response message for [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService].
100#[derive(Clone, PartialEq, ::prost::Message)]
101pub struct ResolveServiceResponse {
102    #[prost(message, optional, tag="1")]
103    pub service: ::std::option::Option<Service>,
104}
105# [ doc = r" Generated client implementations." ] pub mod lookup_service_client { # ! [ allow ( unused_variables , dead_code , missing_docs ) ] use tonic :: codegen :: * ; # [ doc = " Service Directory API for looking up service data at runtime." ] pub struct LookupServiceClient < T > { inner : tonic :: client :: Grpc < T > , } impl < T > LookupServiceClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + HttpBody + Send + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as HttpBody > :: Error : Into < StdError > + Send , { pub fn new ( inner : T ) -> Self { let inner = tonic :: client :: Grpc :: new ( inner ) ; Self { inner } } pub fn with_interceptor ( inner : T , interceptor : impl Into < tonic :: Interceptor > ) -> Self { let inner = tonic :: client :: Grpc :: with_interceptor ( inner , interceptor ) ; Self { inner } } # [ doc = " Returns a [service][google.cloud.servicedirectory.v1beta1.Service] and its" ] # [ doc = " associated endpoints." ] # [ doc = " Resolving a service is not considered an active developer method." ] pub async fn resolve_service ( & mut self , request : impl tonic :: IntoRequest < super :: ResolveServiceRequest > , ) -> Result < tonic :: Response < super :: ResolveServiceResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.LookupService/ResolveService" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } } impl < T : Clone > Clone for LookupServiceClient < T > { fn clone ( & self ) -> Self { Self { inner : self . inner . clone ( ) , } } } impl < T > std :: fmt :: Debug for LookupServiceClient < T > { fn fmt ( & self , f : & mut std :: fmt :: Formatter < '_ > ) -> std :: fmt :: Result { write ! ( f , "LookupServiceClient {{ ... }}" ) } } }/// The request message for [RegistrationService.CreateNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateNamespace].
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct CreateNamespaceRequest {
108    /// Required. The resource name of the project and location the namespace
109    /// will be created in.
110    #[prost(string, tag="1")]
111    pub parent: std::string::String,
112    /// Required. The Resource ID must be 1-63 characters long, and comply with
113    /// <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
114    /// Specifically, the name must be 1-63 characters long and match the regular
115    /// expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
116    /// character must be a lowercase letter, and all following characters must
117    /// be a dash, lowercase letter, or digit, except the last character, which
118    /// cannot be a dash.
119    #[prost(string, tag="2")]
120    pub namespace_id: std::string::String,
121    /// Required. A namespace with initial fields set.
122    #[prost(message, optional, tag="3")]
123    pub namespace: ::std::option::Option<Namespace>,
124}
125/// The request message for [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces].
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct ListNamespacesRequest {
128    /// Required. The resource name of the project and location whose namespaces we'd like to
129    /// list.
130    #[prost(string, tag="1")]
131    pub parent: std::string::String,
132    /// Optional. The maximum number of items to return.
133    #[prost(int32, tag="2")]
134    pub page_size: i32,
135    /// Optional. The next_page_token value returned from a previous List request, if any.
136    #[prost(string, tag="3")]
137    pub page_token: std::string::String,
138    /// Optional. The filter to list result by.
139    ///
140    /// General filter string syntax:
141    /// <field> <operator> <value> (<logical connector>)
142    /// <field> can be "name", or "labels.<key>" for map field.
143    /// <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
144    /// is roughly the same as "=".
145    /// <value> must be the same data type as field.
146    /// <logical connector> can be "AND, OR, NOT".
147    ///
148    /// Examples of valid filters:
149    /// * "labels.owner" returns Namespaces that have a label with the key "owner"
150    ///   this is the same as "labels:owner".
151    /// * "labels.protocol=gRPC" returns Namespaces that have key/value
152    ///   "protocol=gRPC".
153    /// * "name>projects/my-project/locations/us-east/namespaces/namespace-c"
154    ///   returns Namespaces that have name that is alphabetically later than the
155    ///   string, so "namespace-e" will be returned but "namespace-a" will not be.
156    /// * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have
157    ///   "owner" in label key but value is not "sd" AND have key/value foo=bar.
158    /// * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't
159    ///   have a field called "doesnotexist". Since the filter does not match any
160    ///   Namespaces, it returns no results.
161    #[prost(string, tag="4")]
162    pub filter: std::string::String,
163    /// Optional. The order to list result by.
164    ///
165    /// General order by string syntax:
166    /// <field> (<asc|desc>) (,)
167    /// <field> allows values {"name"}
168    /// <asc/desc> ascending or descending order by <field>. If this is left
169    /// blank, "asc" is used.
170    /// Note that an empty order_by string result in default order, which is order
171    /// by name in ascending order.
172    #[prost(string, tag="5")]
173    pub order_by: std::string::String,
174}
175/// The response message for [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces].
176#[derive(Clone, PartialEq, ::prost::Message)]
177pub struct ListNamespacesResponse {
178    /// The list of namespaces.
179    #[prost(message, repeated, tag="1")]
180    pub namespaces: ::std::vec::Vec<Namespace>,
181    /// Token to retrieve the next page of results, or empty if there are no
182    /// more results in the list.
183    #[prost(string, tag="2")]
184    pub next_page_token: std::string::String,
185}
186/// The request message for [RegistrationService.GetNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.GetNamespace].
187#[derive(Clone, PartialEq, ::prost::Message)]
188pub struct GetNamespaceRequest {
189    /// Required. The name of the namespace to retrieve.
190    #[prost(string, tag="1")]
191    pub name: std::string::String,
192}
193/// The request message for [RegistrationService.UpdateNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateNamespace].
194#[derive(Clone, PartialEq, ::prost::Message)]
195pub struct UpdateNamespaceRequest {
196    /// Required. The updated namespace.
197    #[prost(message, optional, tag="1")]
198    pub namespace: ::std::option::Option<Namespace>,
199    /// Required. List of fields to be updated in this request.
200    #[prost(message, optional, tag="2")]
201    pub update_mask: ::std::option::Option<::prost_types::FieldMask>,
202}
203/// The request message for [RegistrationService.DeleteNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteNamespace].
204#[derive(Clone, PartialEq, ::prost::Message)]
205pub struct DeleteNamespaceRequest {
206    /// Required. The name of the namespace to delete.
207    #[prost(string, tag="1")]
208    pub name: std::string::String,
209}
210/// The request message for [RegistrationService.CreateService][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateService].
211#[derive(Clone, PartialEq, ::prost::Message)]
212pub struct CreateServiceRequest {
213    /// Required. The resource name of the namespace this service will belong to.
214    #[prost(string, tag="1")]
215    pub parent: std::string::String,
216    /// Required. The Resource ID must be 1-63 characters long, and comply with
217    /// <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
218    /// Specifically, the name must be 1-63 characters long and match the regular
219    /// expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
220    /// character must be a lowercase letter, and all following characters must
221    /// be a dash, lowercase letter, or digit, except the last character, which
222    /// cannot be a dash.
223    #[prost(string, tag="2")]
224    pub service_id: std::string::String,
225    /// Required. A service  with initial fields set.
226    #[prost(message, optional, tag="3")]
227    pub service: ::std::option::Option<Service>,
228}
229/// The request message for [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices].
230#[derive(Clone, PartialEq, ::prost::Message)]
231pub struct ListServicesRequest {
232    /// Required. The resource name of the namespace whose services we'd
233    /// like to list.
234    #[prost(string, tag="1")]
235    pub parent: std::string::String,
236    /// Optional. The maximum number of items to return.
237    #[prost(int32, tag="2")]
238    pub page_size: i32,
239    /// Optional. The next_page_token value returned from a previous List request,
240    /// if any.
241    #[prost(string, tag="3")]
242    pub page_token: std::string::String,
243    /// Optional. The filter to list result by.
244    ///
245    /// General filter string syntax:
246    /// <field> <operator> <value> (<logical connector>)
247    /// <field> can be "name", or "metadata.<key>" for map field.
248    /// <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
249    /// is roughly the same as "=".
250    /// <value> must be the same data type as field.
251    /// <logical connector> can be "AND, OR, NOT".
252    ///
253    /// Examples of valid filters:
254    /// * "metadata.owner" returns Services that have a label with the key "owner"
255    ///   this is the same as "metadata:owner".
256    /// * "metadata.protocol=gRPC" returns Services that have key/value
257    ///   "protocol=gRPC".
258    /// * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c"
259    ///   returns Services that have name that is alphabetically later than the
260    ///   string, so "service-e" will be returned but "service-a" will not be.
261    /// * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have
262    ///   "owner" in label key but value is not "sd" AND have key/value foo=bar.
263    /// * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't
264    ///   have a field called "doesnotexist". Since the filter does not match any
265    ///   Services, it returns no results.
266    #[prost(string, tag="4")]
267    pub filter: std::string::String,
268    /// Optional. The order to list result by.
269    #[prost(string, tag="5")]
270    pub order_by: std::string::String,
271}
272/// The response message for [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices].
273#[derive(Clone, PartialEq, ::prost::Message)]
274pub struct ListServicesResponse {
275    /// The list of services.
276    #[prost(message, repeated, tag="1")]
277    pub services: ::std::vec::Vec<Service>,
278    /// Token to retrieve the next page of results, or empty if there are no
279    /// more results in the list.
280    #[prost(string, tag="2")]
281    pub next_page_token: std::string::String,
282}
283/// The request message for [RegistrationService.GetService][google.cloud.servicedirectory.v1beta1.RegistrationService.GetService].
284/// This should not be used for looking up a service. Insead, use the `resolve`
285/// method as it will contain all endpoints and associated metadata.
286#[derive(Clone, PartialEq, ::prost::Message)]
287pub struct GetServiceRequest {
288    /// Required. The name of the service to get.
289    #[prost(string, tag="1")]
290    pub name: std::string::String,
291}
292/// The request message for [RegistrationService.UpdateService][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateService].
293#[derive(Clone, PartialEq, ::prost::Message)]
294pub struct UpdateServiceRequest {
295    /// Required. The updated service.
296    #[prost(message, optional, tag="1")]
297    pub service: ::std::option::Option<Service>,
298    /// Required. List of fields to be updated in this request.
299    #[prost(message, optional, tag="2")]
300    pub update_mask: ::std::option::Option<::prost_types::FieldMask>,
301}
302/// The request message for [RegistrationService.DeleteService][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteService].
303#[derive(Clone, PartialEq, ::prost::Message)]
304pub struct DeleteServiceRequest {
305    /// Required. The name of the service to delete.
306    #[prost(string, tag="1")]
307    pub name: std::string::String,
308}
309/// The request message for [RegistrationService.CreateEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateEndpoint].
310#[derive(Clone, PartialEq, ::prost::Message)]
311pub struct CreateEndpointRequest {
312    /// Required. The resource name of the service that this endpoint provides.
313    #[prost(string, tag="1")]
314    pub parent: std::string::String,
315    /// Required. The Resource ID must be 1-63 characters long, and comply with
316    /// <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
317    /// Specifically, the name must be 1-63 characters long and match the regular
318    /// expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
319    /// character must be a lowercase letter, and all following characters must
320    /// be a dash, lowercase letter, or digit, except the last character, which
321    /// cannot be a dash.
322    #[prost(string, tag="2")]
323    pub endpoint_id: std::string::String,
324    /// Required. A endpoint with initial fields set.
325    #[prost(message, optional, tag="3")]
326    pub endpoint: ::std::option::Option<Endpoint>,
327}
328/// The request message for [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints].
329#[derive(Clone, PartialEq, ::prost::Message)]
330pub struct ListEndpointsRequest {
331    /// Required. The resource name of the service whose endpoints we'd like to
332    /// list.
333    #[prost(string, tag="1")]
334    pub parent: std::string::String,
335    /// Optional. The maximum number of items to return.
336    #[prost(int32, tag="2")]
337    pub page_size: i32,
338    /// Optional. The next_page_token value returned from a previous List request,
339    /// if any.
340    #[prost(string, tag="3")]
341    pub page_token: std::string::String,
342    /// Optional. The filter to list result by.
343    ///
344    /// General filter string syntax:
345    /// <field> <operator> <value> (<logical connector>)
346    /// <field> can be "name", "address", "port" or "metadata.<key>" for map field.
347    /// <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
348    /// is roughly the same as "=".
349    /// <value> must be the same data type as field.
350    /// <logical connector> can be "AND, OR, NOT".
351    ///
352    /// Examples of valid filters:
353    /// * "metadata.owner" returns Endpoints that have a label with the key "owner"
354    ///   this is the same as "metadata:owner".
355    /// * "metadata.protocol=gRPC" returns Endpoints that have key/value
356    ///   "protocol=gRPC".
357    /// * "address=192.108.1.105" returns Endpoints that have this address.
358    /// * "port>8080" returns Endpoints that have port number larger than 8080.
359    /// * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c"
360    ///   returns Endpoints that have name that is alphabetically later than the
361    ///   string, so "endpoint-e" will be returned but "endpoint-a" will not be.
362    /// * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have
363    ///   "owner" in label key but value is not "sd" AND have key/value foo=bar.
364    /// * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't
365    ///   have a field called "doesnotexist". Since the filter does not match any
366    ///   Endpoints, it returns no results.
367    #[prost(string, tag="4")]
368    pub filter: std::string::String,
369    /// Optional. The order to list result by.
370    #[prost(string, tag="5")]
371    pub order_by: std::string::String,
372}
373/// The response message for [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints].
374#[derive(Clone, PartialEq, ::prost::Message)]
375pub struct ListEndpointsResponse {
376    /// The list of endpoints.
377    #[prost(message, repeated, tag="1")]
378    pub endpoints: ::std::vec::Vec<Endpoint>,
379    /// Token to retrieve the next page of results, or empty if there are no
380    /// more results in the list.
381    #[prost(string, tag="2")]
382    pub next_page_token: std::string::String,
383}
384/// The request message for [RegistrationService.GetEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.GetEndpoint].
385/// This should not be used to lookup endpoints at runtime. Instead, use
386/// the `resolve` method.
387#[derive(Clone, PartialEq, ::prost::Message)]
388pub struct GetEndpointRequest {
389    /// Required. The name of the endpoint to get.
390    #[prost(string, tag="1")]
391    pub name: std::string::String,
392}
393/// The request message for [RegistrationService.UpdateEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateEndpoint].
394#[derive(Clone, PartialEq, ::prost::Message)]
395pub struct UpdateEndpointRequest {
396    /// Required. The updated endpoint.
397    #[prost(message, optional, tag="1")]
398    pub endpoint: ::std::option::Option<Endpoint>,
399    /// Required. List of fields to be updated in this request.
400    #[prost(message, optional, tag="2")]
401    pub update_mask: ::std::option::Option<::prost_types::FieldMask>,
402}
403/// The request message for [RegistrationService.DeleteEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteEndpoint].
404#[derive(Clone, PartialEq, ::prost::Message)]
405pub struct DeleteEndpointRequest {
406    /// Required. The name of the endpoint to delete.
407    #[prost(string, tag="1")]
408    pub name: std::string::String,
409}
410# [ doc = r" Generated client implementations." ] pub mod registration_service_client { # ! [ allow ( unused_variables , dead_code , missing_docs ) ] use tonic :: codegen :: * ; # [ doc = " Service Directory API for registering services. It defines the following" ] # [ doc = " resource model:" ] # [ doc = "" ] # [ doc = " - The API has a collection of" ] # [ doc = " [Namespace][google.cloud.servicedirectory.v1beta1.Namespace]" ] # [ doc = " resources, named `projects/*/locations/*/namespaces/*`." ] # [ doc = "" ] # [ doc = " - Each Namespace has a collection of" ] # [ doc = " [Service][google.cloud.servicedirectory.v1beta1.Service] resources, named" ] # [ doc = " `projects/*/locations/*/namespaces/*/services/*`." ] # [ doc = "" ] # [ doc = " - Each Service has a collection of" ] # [ doc = " [Endpoint][google.cloud.servicedirectory.v1beta1.Endpoint]" ] # [ doc = " resources, named" ] # [ doc = " `projects/*/locations/*/namespaces/*/services/*/endpoints/*`." ] pub struct RegistrationServiceClient < T > { inner : tonic :: client :: Grpc < T > , } impl < T > RegistrationServiceClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + HttpBody + Send + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as HttpBody > :: Error : Into < StdError > + Send , { pub fn new ( inner : T ) -> Self { let inner = tonic :: client :: Grpc :: new ( inner ) ; Self { inner } } pub fn with_interceptor ( inner : T , interceptor : impl Into < tonic :: Interceptor > ) -> Self { let inner = tonic :: client :: Grpc :: with_interceptor ( inner , interceptor ) ; Self { inner } } # [ doc = " Creates a namespace, and returns the new Namespace." ] pub async fn create_namespace ( & mut self , request : impl tonic :: IntoRequest < super :: CreateNamespaceRequest > , ) -> Result < tonic :: Response < super :: Namespace > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/CreateNamespace" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Lists all namespaces." ] pub async fn list_namespaces ( & mut self , request : impl tonic :: IntoRequest < super :: ListNamespacesRequest > , ) -> Result < tonic :: Response < super :: ListNamespacesResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/ListNamespaces" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Gets a namespace." ] pub async fn get_namespace ( & mut self , request : impl tonic :: IntoRequest < super :: GetNamespaceRequest > , ) -> Result < tonic :: Response < super :: Namespace > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/GetNamespace" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Updates a namespace." ] pub async fn update_namespace ( & mut self , request : impl tonic :: IntoRequest < super :: UpdateNamespaceRequest > , ) -> Result < tonic :: Response < super :: Namespace > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/UpdateNamespace" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Deletes a namespace. This also deletes all services and endpoints in" ] # [ doc = " the namespace." ] pub async fn delete_namespace ( & mut self , request : impl tonic :: IntoRequest < super :: DeleteNamespaceRequest > , ) -> Result < tonic :: Response < ( ) > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/DeleteNamespace" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Creates a service, and returns the new Service." ] pub async fn create_service ( & mut self , request : impl tonic :: IntoRequest < super :: CreateServiceRequest > , ) -> Result < tonic :: Response < super :: Service > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/CreateService" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Lists all services belonging to a namespace." ] pub async fn list_services ( & mut self , request : impl tonic :: IntoRequest < super :: ListServicesRequest > , ) -> Result < tonic :: Response < super :: ListServicesResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/ListServices" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Gets a service." ] pub async fn get_service ( & mut self , request : impl tonic :: IntoRequest < super :: GetServiceRequest > , ) -> Result < tonic :: Response < super :: Service > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/GetService" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Updates a service." ] pub async fn update_service ( & mut self , request : impl tonic :: IntoRequest < super :: UpdateServiceRequest > , ) -> Result < tonic :: Response < super :: Service > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/UpdateService" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Deletes a service. This also deletes all endpoints associated with" ] # [ doc = " the service." ] pub async fn delete_service ( & mut self , request : impl tonic :: IntoRequest < super :: DeleteServiceRequest > , ) -> Result < tonic :: Response < ( ) > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/DeleteService" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Creates a endpoint, and returns the new Endpoint." ] pub async fn create_endpoint ( & mut self , request : impl tonic :: IntoRequest < super :: CreateEndpointRequest > , ) -> Result < tonic :: Response < super :: Endpoint > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/CreateEndpoint" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Lists all endpoints." ] pub async fn list_endpoints ( & mut self , request : impl tonic :: IntoRequest < super :: ListEndpointsRequest > , ) -> Result < tonic :: Response < super :: ListEndpointsResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/ListEndpoints" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Gets a endpoint." ] pub async fn get_endpoint ( & mut self , request : impl tonic :: IntoRequest < super :: GetEndpointRequest > , ) -> Result < tonic :: Response < super :: Endpoint > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/GetEndpoint" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Updates a endpoint." ] pub async fn update_endpoint ( & mut self , request : impl tonic :: IntoRequest < super :: UpdateEndpointRequest > , ) -> Result < tonic :: Response < super :: Endpoint > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/UpdateEndpoint" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Deletes a endpoint." ] pub async fn delete_endpoint ( & mut self , request : impl tonic :: IntoRequest < super :: DeleteEndpointRequest > , ) -> Result < tonic :: Response < ( ) > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/DeleteEndpoint" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Gets the IAM Policy for a resource (namespace or service only)." ] pub async fn get_iam_policy ( & mut self , request : impl tonic :: IntoRequest < super :: super :: super :: super :: iam :: v1 :: GetIamPolicyRequest > , ) -> Result < tonic :: Response < super :: super :: super :: super :: iam :: v1 :: Policy > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/GetIamPolicy" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Sets the IAM Policy for a resource (namespace or service only)." ] pub async fn set_iam_policy ( & mut self , request : impl tonic :: IntoRequest < super :: super :: super :: super :: iam :: v1 :: SetIamPolicyRequest > , ) -> Result < tonic :: Response < super :: super :: super :: super :: iam :: v1 :: Policy > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/SetIamPolicy" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Tests IAM permissions for a resource (namespace or service only)." ] pub async fn test_iam_permissions ( & mut self , request : impl tonic :: IntoRequest < super :: super :: super :: super :: iam :: v1 :: TestIamPermissionsRequest > , ) -> Result < tonic :: Response < super :: super :: super :: super :: iam :: v1 :: TestIamPermissionsResponse > , tonic :: Status > { self . inner . ready ( ) . await . map_err ( | e | { tonic :: Status :: new ( tonic :: Code :: Unknown , format ! ( "Service was not ready: {}" , e . into ( ) ) ) } ) ? ; let codec = tonic :: codec :: ProstCodec :: default ( ) ; let path = http :: uri :: PathAndQuery :: from_static ( "/google.cloud.servicedirectory.v1beta1.RegistrationService/TestIamPermissions" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } } impl < T : Clone > Clone for RegistrationServiceClient < T > { fn clone ( & self ) -> Self { Self { inner : self . inner . clone ( ) , } } } impl < T > std :: fmt :: Debug for RegistrationServiceClient < T > { fn fmt ( & self , f : & mut std :: fmt :: Formatter < '_ > ) -> std :: fmt :: Result { write ! ( f , "RegistrationServiceClient {{ ... }}" ) } } }use serde :: { Serialize , Deserialize } ;