xds_api/generated/
envoy.service.discovery.v3.rs

1// This file is @generated by prost-build.
2/// Specifies a resource to be subscribed to.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct ResourceLocator {
5    /// The resource name to subscribe to.
6    #[prost(string, tag = "1")]
7    pub name: ::prost::alloc::string::String,
8    /// A set of dynamic parameters used to match against the dynamic parameter
9    /// constraints on the resource. This allows clients to select between
10    /// multiple variants of the same resource.
11    #[prost(map = "string, string", tag = "2")]
12    pub dynamic_parameters: ::std::collections::HashMap<
13        ::prost::alloc::string::String,
14        ::prost::alloc::string::String,
15    >,
16}
17impl ::prost::Name for ResourceLocator {
18    const NAME: &'static str = "ResourceLocator";
19    const PACKAGE: &'static str = "envoy.service.discovery.v3";
20    fn full_name() -> ::prost::alloc::string::String {
21        "envoy.service.discovery.v3.ResourceLocator".into()
22    }
23    fn type_url() -> ::prost::alloc::string::String {
24        "type.googleapis.com/envoy.service.discovery.v3.ResourceLocator".into()
25    }
26}
27/// Specifies a concrete resource name.
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct ResourceName {
30    /// The name of the resource.
31    #[prost(string, tag = "1")]
32    pub name: ::prost::alloc::string::String,
33    /// Dynamic parameter constraints associated with this resource. To be used by client-side caches
34    /// (including xDS proxies) when matching subscribed resource locators.
35    #[prost(message, optional, tag = "2")]
36    pub dynamic_parameter_constraints: ::core::option::Option<
37        DynamicParameterConstraints,
38    >,
39}
40impl ::prost::Name for ResourceName {
41    const NAME: &'static str = "ResourceName";
42    const PACKAGE: &'static str = "envoy.service.discovery.v3";
43    fn full_name() -> ::prost::alloc::string::String {
44        "envoy.service.discovery.v3.ResourceName".into()
45    }
46    fn type_url() -> ::prost::alloc::string::String {
47        "type.googleapis.com/envoy.service.discovery.v3.ResourceName".into()
48    }
49}
50/// A DiscoveryRequest requests a set of versioned resources of the same type for
51/// a given Envoy node on some API.
52/// \[#next-free-field: 8\]
53#[derive(Clone, PartialEq, ::prost::Message)]
54pub struct DiscoveryRequest {
55    /// The version_info provided in the request messages will be the version_info
56    /// received with the most recent successfully processed response or empty on
57    /// the first request. It is expected that no new request is sent after a
58    /// response is received until the Envoy instance is ready to ACK/NACK the new
59    /// configuration. ACK/NACK takes place by returning the new API config version
60    /// as applied or the previous API config version respectively. Each type_url
61    /// (see below) has an independent version associated with it.
62    #[prost(string, tag = "1")]
63    pub version_info: ::prost::alloc::string::String,
64    /// The node making the request.
65    #[prost(message, optional, tag = "2")]
66    pub node: ::core::option::Option<super::super::super::config::core::v3::Node>,
67    /// List of resources to subscribe to, e.g. list of cluster names or a route
68    /// configuration name. If this is empty, all resources for the API are
69    /// returned. LDS/CDS may have empty resource_names, which will cause all
70    /// resources for the Envoy instance to be returned. The LDS and CDS responses
71    /// will then imply a number of resources that need to be fetched via EDS/RDS,
72    /// which will be explicitly enumerated in resource_names.
73    #[prost(string, repeated, tag = "3")]
74    pub resource_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
75    /// \[#not-implemented-hide:\]
76    /// Alternative to ``resource_names`` field that allows specifying dynamic
77    /// parameters along with each resource name. Clients that populate this
78    /// field must be able to handle responses from the server where resources
79    /// are wrapped in a Resource message.
80    /// Note that it is legal for a request to have some resources listed
81    /// in ``resource_names`` and others in ``resource_locators``.
82    #[prost(message, repeated, tag = "7")]
83    pub resource_locators: ::prost::alloc::vec::Vec<ResourceLocator>,
84    /// Type of the resource that is being requested, e.g.
85    /// "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This is implicit
86    /// in requests made via singleton xDS APIs such as CDS, LDS, etc. but is
87    /// required for ADS.
88    #[prost(string, tag = "4")]
89    pub type_url: ::prost::alloc::string::String,
90    /// nonce corresponding to DiscoveryResponse being ACK/NACKed. See above
91    /// discussion on version_info and the DiscoveryResponse nonce comment. This
92    /// may be empty only if 1) this is a non-persistent-stream xDS such as HTTP,
93    /// or 2) the client has not yet accepted an update in this xDS stream (unlike
94    /// delta, where it is populated only for new explicit ACKs).
95    #[prost(string, tag = "5")]
96    pub response_nonce: ::prost::alloc::string::String,
97    /// This is populated when the previous :ref:`DiscoveryResponse <envoy_v3_api_msg_service.discovery.v3.DiscoveryResponse>`
98    /// failed to update configuration. The ``message`` field in ``error_details`` provides the Envoy
99    /// internal exception related to the failure. It is only intended for consumption during manual
100    /// debugging, the string provided is not guaranteed to be stable across Envoy versions.
101    #[prost(message, optional, tag = "6")]
102    pub error_detail: ::core::option::Option<
103        super::super::super::super::google::rpc::Status,
104    >,
105}
106impl ::prost::Name for DiscoveryRequest {
107    const NAME: &'static str = "DiscoveryRequest";
108    const PACKAGE: &'static str = "envoy.service.discovery.v3";
109    fn full_name() -> ::prost::alloc::string::String {
110        "envoy.service.discovery.v3.DiscoveryRequest".into()
111    }
112    fn type_url() -> ::prost::alloc::string::String {
113        "type.googleapis.com/envoy.service.discovery.v3.DiscoveryRequest".into()
114    }
115}
116/// \[#next-free-field: 7\]
117#[derive(Clone, PartialEq, ::prost::Message)]
118pub struct DiscoveryResponse {
119    /// The version of the response data.
120    #[prost(string, tag = "1")]
121    pub version_info: ::prost::alloc::string::String,
122    /// The response resources. These resources are typed and depend on the API being called.
123    #[prost(message, repeated, tag = "2")]
124    pub resources: ::prost::alloc::vec::Vec<
125        super::super::super::super::google::protobuf::Any,
126    >,
127    /// \[#not-implemented-hide:\]
128    /// Canary is used to support two Envoy command line flags:
129    ///
130    /// * --terminate-on-canary-transition-failure. When set, Envoy is able to
131    ///    terminate if it detects that configuration is stuck at canary. Consider
132    ///    this example sequence of updates:
133    ///    - Management server applies a canary config successfully.
134    ///    - Management server rolls back to a production config.
135    ///    - Envoy rejects the new production config.
136    ///    Since there is no sensible way to continue receiving configuration
137    ///    updates, Envoy will then terminate and apply production config from a
138    ///    clean slate.
139    /// * --dry-run-canary. When set, a canary response will never be applied, only
140    ///    validated via a dry run.
141    #[prost(bool, tag = "3")]
142    pub canary: bool,
143    /// Type URL for resources. Identifies the xDS API when muxing over ADS.
144    /// Must be consistent with the type_url in the 'resources' repeated Any (if non-empty).
145    #[prost(string, tag = "4")]
146    pub type_url: ::prost::alloc::string::String,
147    /// For gRPC based subscriptions, the nonce provides a way to explicitly ack a
148    /// specific DiscoveryResponse in a following DiscoveryRequest. Additional
149    /// messages may have been sent by Envoy to the management server for the
150    /// previous version on the stream prior to this DiscoveryResponse, that were
151    /// unprocessed at response send time. The nonce allows the management server
152    /// to ignore any further DiscoveryRequests for the previous version until a
153    /// DiscoveryRequest bearing the nonce. The nonce is optional and is not
154    /// required for non-stream based xDS implementations.
155    #[prost(string, tag = "5")]
156    pub nonce: ::prost::alloc::string::String,
157    /// The control plane instance that sent the response.
158    #[prost(message, optional, tag = "6")]
159    pub control_plane: ::core::option::Option<
160        super::super::super::config::core::v3::ControlPlane,
161    >,
162}
163impl ::prost::Name for DiscoveryResponse {
164    const NAME: &'static str = "DiscoveryResponse";
165    const PACKAGE: &'static str = "envoy.service.discovery.v3";
166    fn full_name() -> ::prost::alloc::string::String {
167        "envoy.service.discovery.v3.DiscoveryResponse".into()
168    }
169    fn type_url() -> ::prost::alloc::string::String {
170        "type.googleapis.com/envoy.service.discovery.v3.DiscoveryResponse".into()
171    }
172}
173/// DeltaDiscoveryRequest and DeltaDiscoveryResponse are used in a new gRPC
174/// endpoint for Delta xDS.
175///
176/// With Delta xDS, the DeltaDiscoveryResponses do not need to include a full
177/// snapshot of the tracked resources. Instead, DeltaDiscoveryResponses are a
178/// diff to the state of a xDS client.
179/// In Delta XDS there are per-resource versions, which allow tracking state at
180/// the resource granularity.
181/// An xDS Delta session is always in the context of a gRPC bidirectional
182/// stream. This allows the xDS server to keep track of the state of xDS clients
183/// connected to it.
184///
185/// In Delta xDS the nonce field is required and used to pair
186/// DeltaDiscoveryResponse to a DeltaDiscoveryRequest ACK or NACK.
187/// Optionally, a response message level system_version_info is present for
188/// debugging purposes only.
189///
190/// DeltaDiscoveryRequest plays two independent roles. Any DeltaDiscoveryRequest
191/// can be either or both of: \[1\] informing the server of what resources the
192/// client has gained/lost interest in (using resource_names_subscribe and
193/// resource_names_unsubscribe), or \[2\] (N)ACKing an earlier resource update from
194/// the server (using response_nonce, with presence of error_detail making it a NACK).
195/// Additionally, the first message (for a given type_url) of a reconnected gRPC stream
196/// has a third role: informing the server of the resources (and their versions)
197/// that the client already possesses, using the initial_resource_versions field.
198///
199/// As with state-of-the-world, when multiple resource types are multiplexed (ADS),
200/// all requests/acknowledgments/updates are logically walled off by type_url:
201/// a Cluster ACK exists in a completely separate world from a prior Route NACK.
202/// In particular, initial_resource_versions being sent at the "start" of every
203/// gRPC stream actually entails a message for each type_url, each with its own
204/// initial_resource_versions.
205/// \[#next-free-field: 10\]
206#[derive(Clone, PartialEq, ::prost::Message)]
207pub struct DeltaDiscoveryRequest {
208    /// The node making the request.
209    #[prost(message, optional, tag = "1")]
210    pub node: ::core::option::Option<super::super::super::config::core::v3::Node>,
211    /// Type of the resource that is being requested, e.g.
212    /// ``type.googleapis.com/envoy.api.v2.ClusterLoadAssignment``. This does not need to be set if
213    /// resources are only referenced via ``xds_resource_subscribe`` and
214    /// ``xds_resources_unsubscribe``.
215    #[prost(string, tag = "2")]
216    pub type_url: ::prost::alloc::string::String,
217    /// DeltaDiscoveryRequests allow the client to add or remove individual
218    /// resources to the set of tracked resources in the context of a stream.
219    /// All resource names in the resource_names_subscribe list are added to the
220    /// set of tracked resources and all resource names in the resource_names_unsubscribe
221    /// list are removed from the set of tracked resources.
222    ///
223    /// *Unlike* state-of-the-world xDS, an empty resource_names_subscribe or
224    /// resource_names_unsubscribe list simply means that no resources are to be
225    /// added or removed to the resource list.
226    /// *Like* state-of-the-world xDS, the server must send updates for all tracked
227    /// resources, but can also send updates for resources the client has not subscribed to.
228    ///
229    /// NOTE: the server must respond with all resources listed in resource_names_subscribe,
230    /// even if it believes the client has the most recent version of them. The reason:
231    /// the client may have dropped them, but then regained interest before it had a chance
232    /// to send the unsubscribe message. See DeltaSubscriptionStateTest.RemoveThenAdd.
233    ///
234    /// These two fields can be set in any DeltaDiscoveryRequest, including ACKs
235    /// and initial_resource_versions.
236    ///
237    /// A list of Resource names to add to the list of tracked resources.
238    #[prost(string, repeated, tag = "3")]
239    pub resource_names_subscribe: ::prost::alloc::vec::Vec<
240        ::prost::alloc::string::String,
241    >,
242    /// A list of Resource names to remove from the list of tracked resources.
243    #[prost(string, repeated, tag = "4")]
244    pub resource_names_unsubscribe: ::prost::alloc::vec::Vec<
245        ::prost::alloc::string::String,
246    >,
247    /// \[#not-implemented-hide:\]
248    /// Alternative to ``resource_names_subscribe`` field that allows specifying dynamic parameters
249    /// along with each resource name.
250    /// Note that it is legal for a request to have some resources listed
251    /// in ``resource_names_subscribe`` and others in ``resource_locators_subscribe``.
252    #[prost(message, repeated, tag = "8")]
253    pub resource_locators_subscribe: ::prost::alloc::vec::Vec<ResourceLocator>,
254    /// \[#not-implemented-hide:\]
255    /// Alternative to ``resource_names_unsubscribe`` field that allows specifying dynamic parameters
256    /// along with each resource name.
257    /// Note that it is legal for a request to have some resources listed
258    /// in ``resource_names_unsubscribe`` and others in ``resource_locators_unsubscribe``.
259    #[prost(message, repeated, tag = "9")]
260    pub resource_locators_unsubscribe: ::prost::alloc::vec::Vec<ResourceLocator>,
261    /// Informs the server of the versions of the resources the xDS client knows of, to enable the
262    /// client to continue the same logical xDS session even in the face of gRPC stream reconnection.
263    /// It will not be populated: \[1\] in the very first stream of a session, since the client will
264    /// not yet have any resources,  \[2\] in any message after the first in a stream (for a given
265    /// type_url), since the server will already be correctly tracking the client's state.
266    /// (In ADS, the first message *of each type_url* of a reconnected stream populates this map.)
267    /// The map's keys are names of xDS resources known to the xDS client.
268    /// The map's values are opaque resource versions.
269    #[prost(map = "string, string", tag = "5")]
270    pub initial_resource_versions: ::std::collections::HashMap<
271        ::prost::alloc::string::String,
272        ::prost::alloc::string::String,
273    >,
274    /// When the DeltaDiscoveryRequest is a ACK or NACK message in response
275    /// to a previous DeltaDiscoveryResponse, the response_nonce must be the
276    /// nonce in the DeltaDiscoveryResponse.
277    /// Otherwise (unlike in DiscoveryRequest) response_nonce must be omitted.
278    #[prost(string, tag = "6")]
279    pub response_nonce: ::prost::alloc::string::String,
280    /// This is populated when the previous :ref:`DiscoveryResponse <envoy_v3_api_msg_service.discovery.v3.DiscoveryResponse>`
281    /// failed to update configuration. The ``message`` field in ``error_details``
282    /// provides the Envoy internal exception related to the failure.
283    #[prost(message, optional, tag = "7")]
284    pub error_detail: ::core::option::Option<
285        super::super::super::super::google::rpc::Status,
286    >,
287}
288impl ::prost::Name for DeltaDiscoveryRequest {
289    const NAME: &'static str = "DeltaDiscoveryRequest";
290    const PACKAGE: &'static str = "envoy.service.discovery.v3";
291    fn full_name() -> ::prost::alloc::string::String {
292        "envoy.service.discovery.v3.DeltaDiscoveryRequest".into()
293    }
294    fn type_url() -> ::prost::alloc::string::String {
295        "type.googleapis.com/envoy.service.discovery.v3.DeltaDiscoveryRequest".into()
296    }
297}
298/// \[#next-free-field: 9\]
299#[derive(Clone, PartialEq, ::prost::Message)]
300pub struct DeltaDiscoveryResponse {
301    /// The version of the response data (used for debugging).
302    #[prost(string, tag = "1")]
303    pub system_version_info: ::prost::alloc::string::String,
304    /// The response resources. These are typed resources, whose types must match
305    /// the type_url field.
306    #[prost(message, repeated, tag = "2")]
307    pub resources: ::prost::alloc::vec::Vec<Resource>,
308    /// Type URL for resources. Identifies the xDS API when muxing over ADS.
309    /// Must be consistent with the type_url in the Any within 'resources' if 'resources' is non-empty.
310    #[prost(string, tag = "4")]
311    pub type_url: ::prost::alloc::string::String,
312    /// Resources names of resources that have be deleted and to be removed from the xDS Client.
313    /// Removed resources for missing resources can be ignored.
314    #[prost(string, repeated, tag = "6")]
315    pub removed_resources: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
316    /// Alternative to removed_resources that allows specifying which variant of
317    /// a resource is being removed. This variant must be used for any resource
318    /// for which dynamic parameter constraints were sent to the client.
319    #[prost(message, repeated, tag = "8")]
320    pub removed_resource_names: ::prost::alloc::vec::Vec<ResourceName>,
321    /// The nonce provides a way for DeltaDiscoveryRequests to uniquely
322    /// reference a DeltaDiscoveryResponse when (N)ACKing. The nonce is required.
323    #[prost(string, tag = "5")]
324    pub nonce: ::prost::alloc::string::String,
325    /// \[#not-implemented-hide:\]
326    /// The control plane instance that sent the response.
327    #[prost(message, optional, tag = "7")]
328    pub control_plane: ::core::option::Option<
329        super::super::super::config::core::v3::ControlPlane,
330    >,
331}
332impl ::prost::Name for DeltaDiscoveryResponse {
333    const NAME: &'static str = "DeltaDiscoveryResponse";
334    const PACKAGE: &'static str = "envoy.service.discovery.v3";
335    fn full_name() -> ::prost::alloc::string::String {
336        "envoy.service.discovery.v3.DeltaDiscoveryResponse".into()
337    }
338    fn type_url() -> ::prost::alloc::string::String {
339        "type.googleapis.com/envoy.service.discovery.v3.DeltaDiscoveryResponse".into()
340    }
341}
342/// A set of dynamic parameter constraints associated with a variant of an individual xDS resource.
343/// These constraints determine whether the resource matches a subscription based on the set of
344/// dynamic parameters in the subscription, as specified in the
345/// :ref:`ResourceLocator.dynamic_parameters<envoy_v3_api_field_service.discovery.v3.ResourceLocator.dynamic_parameters>`
346/// field. This allows xDS implementations (clients, servers, and caching proxies) to determine
347/// which variant of a resource is appropriate for a given client.
348#[derive(Clone, PartialEq, ::prost::Message)]
349pub struct DynamicParameterConstraints {
350    #[prost(oneof = "dynamic_parameter_constraints::Type", tags = "1, 2, 3, 4")]
351    pub r#type: ::core::option::Option<dynamic_parameter_constraints::Type>,
352}
353/// Nested message and enum types in `DynamicParameterConstraints`.
354pub mod dynamic_parameter_constraints {
355    /// A single constraint for a given key.
356    #[derive(Clone, PartialEq, ::prost::Message)]
357    pub struct SingleConstraint {
358        /// The key to match against.
359        #[prost(string, tag = "1")]
360        pub key: ::prost::alloc::string::String,
361        #[prost(oneof = "single_constraint::ConstraintType", tags = "2, 3")]
362        pub constraint_type: ::core::option::Option<single_constraint::ConstraintType>,
363    }
364    /// Nested message and enum types in `SingleConstraint`.
365    pub mod single_constraint {
366        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
367        pub struct Exists {}
368        impl ::prost::Name for Exists {
369            const NAME: &'static str = "Exists";
370            const PACKAGE: &'static str = "envoy.service.discovery.v3";
371            fn full_name() -> ::prost::alloc::string::String {
372                "envoy.service.discovery.v3.DynamicParameterConstraints.SingleConstraint.Exists"
373                    .into()
374            }
375            fn type_url() -> ::prost::alloc::string::String {
376                "type.googleapis.com/envoy.service.discovery.v3.DynamicParameterConstraints.SingleConstraint.Exists"
377                    .into()
378            }
379        }
380        #[derive(Clone, PartialEq, ::prost::Oneof)]
381        pub enum ConstraintType {
382            /// Matches this exact value.
383            #[prost(string, tag = "2")]
384            Value(::prost::alloc::string::String),
385            /// Key is present (matches any value except for the key being absent).
386            /// This allows setting a default constraint for clients that do
387            /// not send a key at all, while there may be other clients that need
388            /// special configuration based on that key.
389            #[prost(message, tag = "3")]
390            Exists(Exists),
391        }
392    }
393    impl ::prost::Name for SingleConstraint {
394        const NAME: &'static str = "SingleConstraint";
395        const PACKAGE: &'static str = "envoy.service.discovery.v3";
396        fn full_name() -> ::prost::alloc::string::String {
397            "envoy.service.discovery.v3.DynamicParameterConstraints.SingleConstraint"
398                .into()
399        }
400        fn type_url() -> ::prost::alloc::string::String {
401            "type.googleapis.com/envoy.service.discovery.v3.DynamicParameterConstraints.SingleConstraint"
402                .into()
403        }
404    }
405    #[derive(Clone, PartialEq, ::prost::Message)]
406    pub struct ConstraintList {
407        #[prost(message, repeated, tag = "1")]
408        pub constraints: ::prost::alloc::vec::Vec<super::DynamicParameterConstraints>,
409    }
410    impl ::prost::Name for ConstraintList {
411        const NAME: &'static str = "ConstraintList";
412        const PACKAGE: &'static str = "envoy.service.discovery.v3";
413        fn full_name() -> ::prost::alloc::string::String {
414            "envoy.service.discovery.v3.DynamicParameterConstraints.ConstraintList"
415                .into()
416        }
417        fn type_url() -> ::prost::alloc::string::String {
418            "type.googleapis.com/envoy.service.discovery.v3.DynamicParameterConstraints.ConstraintList"
419                .into()
420        }
421    }
422    #[derive(Clone, PartialEq, ::prost::Oneof)]
423    pub enum Type {
424        /// A single constraint to evaluate.
425        #[prost(message, tag = "1")]
426        Constraint(SingleConstraint),
427        /// A list of constraints that match if any one constraint in the list
428        /// matches.
429        #[prost(message, tag = "2")]
430        OrConstraints(ConstraintList),
431        /// A list of constraints that must all match.
432        #[prost(message, tag = "3")]
433        AndConstraints(ConstraintList),
434        /// The inverse (NOT) of a set of constraints.
435        #[prost(message, tag = "4")]
436        NotConstraints(::prost::alloc::boxed::Box<super::DynamicParameterConstraints>),
437    }
438}
439impl ::prost::Name for DynamicParameterConstraints {
440    const NAME: &'static str = "DynamicParameterConstraints";
441    const PACKAGE: &'static str = "envoy.service.discovery.v3";
442    fn full_name() -> ::prost::alloc::string::String {
443        "envoy.service.discovery.v3.DynamicParameterConstraints".into()
444    }
445    fn type_url() -> ::prost::alloc::string::String {
446        "type.googleapis.com/envoy.service.discovery.v3.DynamicParameterConstraints"
447            .into()
448    }
449}
450/// \[#next-free-field: 10\]
451#[derive(Clone, PartialEq, ::prost::Message)]
452pub struct Resource {
453    /// The resource's name, to distinguish it from others of the same type of resource.
454    /// Only one of ``name`` or ``resource_name`` may be set.
455    #[prost(string, tag = "3")]
456    pub name: ::prost::alloc::string::String,
457    /// Alternative to the ``name`` field, to be used when the server supports
458    /// multiple variants of the named resource that are differentiated by
459    /// dynamic parameter constraints.
460    /// Only one of ``name`` or ``resource_name`` may be set.
461    #[prost(message, optional, tag = "8")]
462    pub resource_name: ::core::option::Option<ResourceName>,
463    /// The aliases are a list of other names that this resource can go by.
464    #[prost(string, repeated, tag = "4")]
465    pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
466    /// The resource level version. It allows xDS to track the state of individual
467    /// resources.
468    #[prost(string, tag = "1")]
469    pub version: ::prost::alloc::string::String,
470    /// The resource being tracked.
471    #[prost(message, optional, tag = "2")]
472    pub resource: ::core::option::Option<
473        super::super::super::super::google::protobuf::Any,
474    >,
475    /// Time-to-live value for the resource. For each resource, a timer is started. The timer is
476    /// reset each time the resource is received with a new TTL. If the resource is received with
477    /// no TTL set, the timer is removed for the resource. Upon expiration of the timer, the
478    /// configuration for the resource will be removed.
479    ///
480    /// The TTL can be refreshed or changed by sending a response that doesn't change the resource
481    /// version. In this case the resource field does not need to be populated, which allows for
482    /// light-weight "heartbeat" updates to keep a resource with a TTL alive.
483    ///
484    /// The TTL feature is meant to support configurations that should be removed in the event of
485    /// a management server failure. For example, the feature may be used for fault injection
486    /// testing where the fault injection should be terminated in the event that Envoy loses contact
487    /// with the management server.
488    #[prost(message, optional, tag = "6")]
489    pub ttl: ::core::option::Option<
490        super::super::super::super::google::protobuf::Duration,
491    >,
492    /// Cache control properties for the resource.
493    /// \[#not-implemented-hide:\]
494    #[prost(message, optional, tag = "7")]
495    pub cache_control: ::core::option::Option<resource::CacheControl>,
496    /// The Metadata field can be used to provide additional information for the resource.
497    /// E.g. the trace data for debugging.
498    #[prost(message, optional, tag = "9")]
499    pub metadata: ::core::option::Option<
500        super::super::super::config::core::v3::Metadata,
501    >,
502}
503/// Nested message and enum types in `Resource`.
504pub mod resource {
505    /// Cache control properties for the resource.
506    /// \[#not-implemented-hide:\]
507    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
508    pub struct CacheControl {
509        /// If true, xDS proxies may not cache this resource.
510        /// Note that this does not apply to clients other than xDS proxies, which must cache resources
511        /// for their own use, regardless of the value of this field.
512        #[prost(bool, tag = "1")]
513        pub do_not_cache: bool,
514    }
515    impl ::prost::Name for CacheControl {
516        const NAME: &'static str = "CacheControl";
517        const PACKAGE: &'static str = "envoy.service.discovery.v3";
518        fn full_name() -> ::prost::alloc::string::String {
519            "envoy.service.discovery.v3.Resource.CacheControl".into()
520        }
521        fn type_url() -> ::prost::alloc::string::String {
522            "type.googleapis.com/envoy.service.discovery.v3.Resource.CacheControl".into()
523        }
524    }
525}
526impl ::prost::Name for Resource {
527    const NAME: &'static str = "Resource";
528    const PACKAGE: &'static str = "envoy.service.discovery.v3";
529    fn full_name() -> ::prost::alloc::string::String {
530        "envoy.service.discovery.v3.Resource".into()
531    }
532    fn type_url() -> ::prost::alloc::string::String {
533        "type.googleapis.com/envoy.service.discovery.v3.Resource".into()
534    }
535}
536/// \[#not-implemented-hide:\] Not configuration. Workaround c++ protobuf issue with importing
537/// services: <https://github.com/google/protobuf/issues/4221>
538#[derive(Clone, Copy, PartialEq, ::prost::Message)]
539pub struct AdsDummy {}
540impl ::prost::Name for AdsDummy {
541    const NAME: &'static str = "AdsDummy";
542    const PACKAGE: &'static str = "envoy.service.discovery.v3";
543    fn full_name() -> ::prost::alloc::string::String {
544        "envoy.service.discovery.v3.AdsDummy".into()
545    }
546    fn type_url() -> ::prost::alloc::string::String {
547        "type.googleapis.com/envoy.service.discovery.v3.AdsDummy".into()
548    }
549}
550/// Generated client implementations.
551pub mod aggregated_discovery_service_client {
552    #![allow(
553        unused_variables,
554        dead_code,
555        missing_docs,
556        clippy::wildcard_imports,
557        clippy::let_unit_value,
558    )]
559    use tonic::codegen::*;
560    use tonic::codegen::http::Uri;
561    /// See https://github.com/envoyproxy/envoy-api#apis for a description of the role of
562    /// ADS and how it is intended to be used by a management server. ADS requests
563    /// have the same structure as their singleton xDS counterparts, but can
564    /// multiplex many resource types on a single stream. The type_url in the
565    /// DiscoveryRequest/DiscoveryResponse provides sufficient information to recover
566    /// the multiplexed singleton APIs at the Envoy instance and management server.
567    #[derive(Debug, Clone)]
568    pub struct AggregatedDiscoveryServiceClient<T> {
569        inner: tonic::client::Grpc<T>,
570    }
571    impl<T> AggregatedDiscoveryServiceClient<T>
572    where
573        T: tonic::client::GrpcService<tonic::body::BoxBody>,
574        T::Error: Into<StdError>,
575        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
576        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
577    {
578        pub fn new(inner: T) -> Self {
579            let inner = tonic::client::Grpc::new(inner);
580            Self { inner }
581        }
582        pub fn with_origin(inner: T, origin: Uri) -> Self {
583            let inner = tonic::client::Grpc::with_origin(inner, origin);
584            Self { inner }
585        }
586        pub fn with_interceptor<F>(
587            inner: T,
588            interceptor: F,
589        ) -> AggregatedDiscoveryServiceClient<InterceptedService<T, F>>
590        where
591            F: tonic::service::Interceptor,
592            T::ResponseBody: Default,
593            T: tonic::codegen::Service<
594                http::Request<tonic::body::BoxBody>,
595                Response = http::Response<
596                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
597                >,
598            >,
599            <T as tonic::codegen::Service<
600                http::Request<tonic::body::BoxBody>,
601            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
602        {
603            AggregatedDiscoveryServiceClient::new(
604                InterceptedService::new(inner, interceptor),
605            )
606        }
607        /// Compress requests with the given encoding.
608        ///
609        /// This requires the server to support it otherwise it might respond with an
610        /// error.
611        #[must_use]
612        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
613            self.inner = self.inner.send_compressed(encoding);
614            self
615        }
616        /// Enable decompressing responses.
617        #[must_use]
618        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
619            self.inner = self.inner.accept_compressed(encoding);
620            self
621        }
622        /// Limits the maximum size of a decoded message.
623        ///
624        /// Default: `4MB`
625        #[must_use]
626        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
627            self.inner = self.inner.max_decoding_message_size(limit);
628            self
629        }
630        /// Limits the maximum size of an encoded message.
631        ///
632        /// Default: `usize::MAX`
633        #[must_use]
634        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
635            self.inner = self.inner.max_encoding_message_size(limit);
636            self
637        }
638        /// This is a gRPC-only API.
639        pub async fn stream_aggregated_resources(
640            &mut self,
641            request: impl tonic::IntoStreamingRequest<Message = super::DiscoveryRequest>,
642        ) -> std::result::Result<
643            tonic::Response<tonic::codec::Streaming<super::DiscoveryResponse>>,
644            tonic::Status,
645        > {
646            self.inner
647                .ready()
648                .await
649                .map_err(|e| {
650                    tonic::Status::unknown(
651                        format!("Service was not ready: {}", e.into()),
652                    )
653                })?;
654            let codec = tonic::codec::ProstCodec::default();
655            let path = http::uri::PathAndQuery::from_static(
656                "/envoy.service.discovery.v3.AggregatedDiscoveryService/StreamAggregatedResources",
657            );
658            let mut req = request.into_streaming_request();
659            req.extensions_mut()
660                .insert(
661                    GrpcMethod::new(
662                        "envoy.service.discovery.v3.AggregatedDiscoveryService",
663                        "StreamAggregatedResources",
664                    ),
665                );
666            self.inner.streaming(req, path, codec).await
667        }
668        pub async fn delta_aggregated_resources(
669            &mut self,
670            request: impl tonic::IntoStreamingRequest<
671                Message = super::DeltaDiscoveryRequest,
672            >,
673        ) -> std::result::Result<
674            tonic::Response<tonic::codec::Streaming<super::DeltaDiscoveryResponse>>,
675            tonic::Status,
676        > {
677            self.inner
678                .ready()
679                .await
680                .map_err(|e| {
681                    tonic::Status::unknown(
682                        format!("Service was not ready: {}", e.into()),
683                    )
684                })?;
685            let codec = tonic::codec::ProstCodec::default();
686            let path = http::uri::PathAndQuery::from_static(
687                "/envoy.service.discovery.v3.AggregatedDiscoveryService/DeltaAggregatedResources",
688            );
689            let mut req = request.into_streaming_request();
690            req.extensions_mut()
691                .insert(
692                    GrpcMethod::new(
693                        "envoy.service.discovery.v3.AggregatedDiscoveryService",
694                        "DeltaAggregatedResources",
695                    ),
696                );
697            self.inner.streaming(req, path, codec).await
698        }
699    }
700}
701/// Generated server implementations.
702pub mod aggregated_discovery_service_server {
703    #![allow(
704        unused_variables,
705        dead_code,
706        missing_docs,
707        clippy::wildcard_imports,
708        clippy::let_unit_value,
709    )]
710    use tonic::codegen::*;
711    /// Generated trait containing gRPC methods that should be implemented for use with AggregatedDiscoveryServiceServer.
712    #[async_trait]
713    pub trait AggregatedDiscoveryService: std::marker::Send + std::marker::Sync + 'static {
714        /// Server streaming response type for the StreamAggregatedResources method.
715        type StreamAggregatedResourcesStream: tonic::codegen::tokio_stream::Stream<
716                Item = std::result::Result<super::DiscoveryResponse, tonic::Status>,
717            >
718            + std::marker::Send
719            + 'static;
720        /// This is a gRPC-only API.
721        async fn stream_aggregated_resources(
722            &self,
723            request: tonic::Request<tonic::Streaming<super::DiscoveryRequest>>,
724        ) -> std::result::Result<
725            tonic::Response<Self::StreamAggregatedResourcesStream>,
726            tonic::Status,
727        >;
728        /// Server streaming response type for the DeltaAggregatedResources method.
729        type DeltaAggregatedResourcesStream: tonic::codegen::tokio_stream::Stream<
730                Item = std::result::Result<super::DeltaDiscoveryResponse, tonic::Status>,
731            >
732            + std::marker::Send
733            + 'static;
734        async fn delta_aggregated_resources(
735            &self,
736            request: tonic::Request<tonic::Streaming<super::DeltaDiscoveryRequest>>,
737        ) -> std::result::Result<
738            tonic::Response<Self::DeltaAggregatedResourcesStream>,
739            tonic::Status,
740        >;
741    }
742    /// See https://github.com/envoyproxy/envoy-api#apis for a description of the role of
743    /// ADS and how it is intended to be used by a management server. ADS requests
744    /// have the same structure as their singleton xDS counterparts, but can
745    /// multiplex many resource types on a single stream. The type_url in the
746    /// DiscoveryRequest/DiscoveryResponse provides sufficient information to recover
747    /// the multiplexed singleton APIs at the Envoy instance and management server.
748    #[derive(Debug)]
749    pub struct AggregatedDiscoveryServiceServer<T> {
750        inner: Arc<T>,
751        accept_compression_encodings: EnabledCompressionEncodings,
752        send_compression_encodings: EnabledCompressionEncodings,
753        max_decoding_message_size: Option<usize>,
754        max_encoding_message_size: Option<usize>,
755    }
756    impl<T> AggregatedDiscoveryServiceServer<T> {
757        pub fn new(inner: T) -> Self {
758            Self::from_arc(Arc::new(inner))
759        }
760        pub fn from_arc(inner: Arc<T>) -> Self {
761            Self {
762                inner,
763                accept_compression_encodings: Default::default(),
764                send_compression_encodings: Default::default(),
765                max_decoding_message_size: None,
766                max_encoding_message_size: None,
767            }
768        }
769        pub fn with_interceptor<F>(
770            inner: T,
771            interceptor: F,
772        ) -> InterceptedService<Self, F>
773        where
774            F: tonic::service::Interceptor,
775        {
776            InterceptedService::new(Self::new(inner), interceptor)
777        }
778        /// Enable decompressing requests with the given encoding.
779        #[must_use]
780        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
781            self.accept_compression_encodings.enable(encoding);
782            self
783        }
784        /// Compress responses with the given encoding, if the client supports it.
785        #[must_use]
786        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
787            self.send_compression_encodings.enable(encoding);
788            self
789        }
790        /// Limits the maximum size of a decoded message.
791        ///
792        /// Default: `4MB`
793        #[must_use]
794        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
795            self.max_decoding_message_size = Some(limit);
796            self
797        }
798        /// Limits the maximum size of an encoded message.
799        ///
800        /// Default: `usize::MAX`
801        #[must_use]
802        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
803            self.max_encoding_message_size = Some(limit);
804            self
805        }
806    }
807    impl<T, B> tonic::codegen::Service<http::Request<B>>
808    for AggregatedDiscoveryServiceServer<T>
809    where
810        T: AggregatedDiscoveryService,
811        B: Body + std::marker::Send + 'static,
812        B::Error: Into<StdError> + std::marker::Send + 'static,
813    {
814        type Response = http::Response<tonic::body::BoxBody>;
815        type Error = std::convert::Infallible;
816        type Future = BoxFuture<Self::Response, Self::Error>;
817        fn poll_ready(
818            &mut self,
819            _cx: &mut Context<'_>,
820        ) -> Poll<std::result::Result<(), Self::Error>> {
821            Poll::Ready(Ok(()))
822        }
823        fn call(&mut self, req: http::Request<B>) -> Self::Future {
824            match req.uri().path() {
825                "/envoy.service.discovery.v3.AggregatedDiscoveryService/StreamAggregatedResources" => {
826                    #[allow(non_camel_case_types)]
827                    struct StreamAggregatedResourcesSvc<T: AggregatedDiscoveryService>(
828                        pub Arc<T>,
829                    );
830                    impl<
831                        T: AggregatedDiscoveryService,
832                    > tonic::server::StreamingService<super::DiscoveryRequest>
833                    for StreamAggregatedResourcesSvc<T> {
834                        type Response = super::DiscoveryResponse;
835                        type ResponseStream = T::StreamAggregatedResourcesStream;
836                        type Future = BoxFuture<
837                            tonic::Response<Self::ResponseStream>,
838                            tonic::Status,
839                        >;
840                        fn call(
841                            &mut self,
842                            request: tonic::Request<
843                                tonic::Streaming<super::DiscoveryRequest>,
844                            >,
845                        ) -> Self::Future {
846                            let inner = Arc::clone(&self.0);
847                            let fut = async move {
848                                <T as AggregatedDiscoveryService>::stream_aggregated_resources(
849                                        &inner,
850                                        request,
851                                    )
852                                    .await
853                            };
854                            Box::pin(fut)
855                        }
856                    }
857                    let accept_compression_encodings = self.accept_compression_encodings;
858                    let send_compression_encodings = self.send_compression_encodings;
859                    let max_decoding_message_size = self.max_decoding_message_size;
860                    let max_encoding_message_size = self.max_encoding_message_size;
861                    let inner = self.inner.clone();
862                    let fut = async move {
863                        let method = StreamAggregatedResourcesSvc(inner);
864                        let codec = tonic::codec::ProstCodec::default();
865                        let mut grpc = tonic::server::Grpc::new(codec)
866                            .apply_compression_config(
867                                accept_compression_encodings,
868                                send_compression_encodings,
869                            )
870                            .apply_max_message_size_config(
871                                max_decoding_message_size,
872                                max_encoding_message_size,
873                            );
874                        let res = grpc.streaming(method, req).await;
875                        Ok(res)
876                    };
877                    Box::pin(fut)
878                }
879                "/envoy.service.discovery.v3.AggregatedDiscoveryService/DeltaAggregatedResources" => {
880                    #[allow(non_camel_case_types)]
881                    struct DeltaAggregatedResourcesSvc<T: AggregatedDiscoveryService>(
882                        pub Arc<T>,
883                    );
884                    impl<
885                        T: AggregatedDiscoveryService,
886                    > tonic::server::StreamingService<super::DeltaDiscoveryRequest>
887                    for DeltaAggregatedResourcesSvc<T> {
888                        type Response = super::DeltaDiscoveryResponse;
889                        type ResponseStream = T::DeltaAggregatedResourcesStream;
890                        type Future = BoxFuture<
891                            tonic::Response<Self::ResponseStream>,
892                            tonic::Status,
893                        >;
894                        fn call(
895                            &mut self,
896                            request: tonic::Request<
897                                tonic::Streaming<super::DeltaDiscoveryRequest>,
898                            >,
899                        ) -> Self::Future {
900                            let inner = Arc::clone(&self.0);
901                            let fut = async move {
902                                <T as AggregatedDiscoveryService>::delta_aggregated_resources(
903                                        &inner,
904                                        request,
905                                    )
906                                    .await
907                            };
908                            Box::pin(fut)
909                        }
910                    }
911                    let accept_compression_encodings = self.accept_compression_encodings;
912                    let send_compression_encodings = self.send_compression_encodings;
913                    let max_decoding_message_size = self.max_decoding_message_size;
914                    let max_encoding_message_size = self.max_encoding_message_size;
915                    let inner = self.inner.clone();
916                    let fut = async move {
917                        let method = DeltaAggregatedResourcesSvc(inner);
918                        let codec = tonic::codec::ProstCodec::default();
919                        let mut grpc = tonic::server::Grpc::new(codec)
920                            .apply_compression_config(
921                                accept_compression_encodings,
922                                send_compression_encodings,
923                            )
924                            .apply_max_message_size_config(
925                                max_decoding_message_size,
926                                max_encoding_message_size,
927                            );
928                        let res = grpc.streaming(method, req).await;
929                        Ok(res)
930                    };
931                    Box::pin(fut)
932                }
933                _ => {
934                    Box::pin(async move {
935                        let mut response = http::Response::new(empty_body());
936                        let headers = response.headers_mut();
937                        headers
938                            .insert(
939                                tonic::Status::GRPC_STATUS,
940                                (tonic::Code::Unimplemented as i32).into(),
941                            );
942                        headers
943                            .insert(
944                                http::header::CONTENT_TYPE,
945                                tonic::metadata::GRPC_CONTENT_TYPE,
946                            );
947                        Ok(response)
948                    })
949                }
950            }
951        }
952    }
953    impl<T> Clone for AggregatedDiscoveryServiceServer<T> {
954        fn clone(&self) -> Self {
955            let inner = self.inner.clone();
956            Self {
957                inner,
958                accept_compression_encodings: self.accept_compression_encodings,
959                send_compression_encodings: self.send_compression_encodings,
960                max_decoding_message_size: self.max_decoding_message_size,
961                max_encoding_message_size: self.max_encoding_message_size,
962            }
963        }
964    }
965    /// Generated gRPC service name
966    pub const SERVICE_NAME: &str = "envoy.service.discovery.v3.AggregatedDiscoveryService";
967    impl<T> tonic::server::NamedService for AggregatedDiscoveryServiceServer<T> {
968        const NAME: &'static str = SERVICE_NAME;
969    }
970}