Skip to main content

consul_api/
structs_1_22_x.rs

1// The content of this file is generated by 'scanner/main.go'.
2// Do not modify it manually.
3// Manual changes may cause issues with the program's operation.
4// If modifications are needed, please do so through the program's logic.
5
6use base64::{engine::general_purpose::STANDARD, Engine as _};
7use serde::{Deserialize, Serialize};
8
9#[derive(Debug, Copy, Clone, Serialize, Deserialize, Eq, PartialEq)]
10pub enum MeshGatewayMode {
11    /// MeshGatewayModeDefault represents no specific mode and should
12    /// be used to indicate that a different layer of the configuration
13    /// chain should take precedence
14    #[serde(rename = "")]
15    Default,
16
17    /// MeshGatewayModeNone represents that the Upstream Connect connections
18    /// should be direct and not flow through a mesh gateway.
19    #[serde(rename = "none")]
20    None,
21
22    /// MeshGatewayModeLocal represents that the Upstream Connect connections
23    /// should be made to a mesh gateway in the local datacenter.
24    #[serde(rename = "local")]
25    Local,
26
27    /// MeshGatewayModeRemote represents that the Upstream Connect connections
28    /// should be made to a mesh gateway in a remote datacenter.
29    #[serde(rename = "remote")]
30    Remote,
31}
32
33impl Default for MeshGatewayMode {
34    fn default() -> Self {
35        Self::Default
36    }
37}
38
39impl ::core::fmt::Display for MeshGatewayMode {
40    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
41        match self {
42            Self::Default => write!(f, ""),
43            Self::None => write!(f, "none"),
44            Self::Local => write!(f, "local"),
45            Self::Remote => write!(f, "remote"),
46        }
47    }
48}
49
50// TODO 不清楚为何会返回 “Default”,但又不在定义中,所以暂时用字符串代替这个定义
51// #[derive(Debug, Copy, Clone, Serialize, Deserialize, Eq, PartialEq)]
52// pub enum ProxyMode {
53//     /// ProxyModeDefault represents no specific mode and should
54//     /// be used to indicate that a different layer of the configuration
55//     /// chain should take precedence
56//     #[serde(rename = "")]
57//     Default,
58
59//     /// ProxyModeTransparent represents that inbound and outbound application
60//     /// traffic is being captured and redirected through the proxy.
61//     #[serde(rename = "transparent")]
62//     Transparent,
63
64//     /// ProxyModeDirect represents that the proxy's listeners must be dialed directly
65//     /// by the local application and other proxies.
66//     #[serde(rename = "direct")]
67//     Direct,
68// }
69
70// impl Default for ProxyMode {
71//     fn default() -> Self {
72//         Self::Default
73//     }
74// }
75
76// impl ::core::fmt::Display for ProxyMode {
77//     fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
78//         match self {
79//             Self::Default => write!(f, ""),
80//             Self::Transparent => write!(f, "transparent"),
81//             Self::Direct => write!(f, "direct"),
82//         }
83//     }
84// }
85
86#[derive(Debug, Copy, Clone, Serialize, Deserialize, Eq, PartialEq)]
87pub enum LogSinkType {
88    #[serde(rename = "")]
89    Default,
90    #[serde(rename = "file")]
91    File,
92    #[serde(rename = "stderr")]
93    StdErr,
94    #[serde(rename = "stdout")]
95    StdOut,
96}
97
98impl Default for LogSinkType {
99    fn default() -> Self {
100        Self::Default
101    }
102}
103
104impl ::core::fmt::Display for LogSinkType {
105    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
106        match self {
107            Self::Default => write!(f, ""),
108            Self::File => write!(f, "file"),
109            Self::StdErr => write!(f, "stderr"),
110            Self::StdOut => write!(f, "stdout"),
111        }
112    }
113}
114
115#[derive(Debug, Copy, Clone, Serialize, Deserialize, Eq, PartialEq)]
116pub enum Health {
117    /// HealthAny is special, and is used as a wild card,
118    /// not as a specific state.
119    #[serde(rename = "any")]
120    Any,
121    #[serde(rename = "passing")]
122    Passing,
123    #[serde(rename = "warning")]
124    Warning,
125    #[serde(rename = "critical")]
126    Critical,
127    #[serde(rename = "maintenance")]
128    Maintenance,
129}
130
131impl Default for Health {
132    fn default() -> Self {
133        Self::Any
134    }
135}
136
137impl From<&str> for Health {
138    fn from(s: &str) -> Self {
139        match s {
140            _ => Self::Any,
141            "passing" => Self::Passing,
142            "warning" => Self::Warning,
143            "critical" => Self::Critical,
144            "maintenance" => Self::Maintenance,
145        }
146    }
147}
148
149impl ::core::fmt::Display for Health {
150    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
151        match self {
152            Self::Any => write!(f, "any"),
153            Self::Passing => write!(f, "passing"),
154            Self::Warning => write!(f, "warning"),
155            Self::Critical => write!(f, "critical"),
156            Self::Maintenance => write!(f, "maintenance"),
157        }
158    }
159}
160
161#[derive(Debug, Copy, Clone, Serialize, Deserialize, Eq, PartialEq)]
162pub enum GatewayServiceKind {
163    #[serde(rename = "")]
164    Unknown,
165    #[serde(rename = "destination")]
166    Destination,
167    #[serde(rename = "service")]
168    Service,
169}
170
171impl Default for GatewayServiceKind {
172    fn default() -> Self {
173        Self::Unknown
174    }
175}
176
177impl ::core::fmt::Display for GatewayServiceKind {
178    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
179        match self {
180            Self::Unknown => write!(f, ""),
181            Self::Destination => write!(f, "destination"),
182            Self::Service => write!(f, "service"),
183        }
184    }
185}
186
187#[derive(Debug, Clone, Serialize, Deserialize)]
188pub struct Base64Payload(pub(crate) String);
189
190impl Base64Payload {
191    pub fn to_vec(&self) -> Vec<u8> {
192        STANDARD.decode(&self.0).unwrap()
193    }
194}
195
196#[derive(Debug, Clone, Default, Serialize, Deserialize)]
197pub struct ACLLink {
198    #[serde(rename = "ID")]
199    pub id: String,
200
201    #[serde(rename = "Name")]
202    pub name: String,
203
204}
205
206/// AgentWeights represent optional weights for a service
207#[derive(Debug, Clone, Default, Serialize, Deserialize)]
208pub struct AgentWeights {
209    #[serde(rename = "Passing")]
210    pub passing: isize,
211
212    #[serde(rename = "Warning")]
213    pub warning: isize,
214
215}
216
217/// AgentService represents a service known to the agent
218#[derive(Debug, Clone, Default, Serialize, Deserialize)]
219pub struct AgentService {
220    #[serde(rename = "ID")]
221    pub id: String,
222
223    #[serde(rename = "Service")]
224    pub service: String,
225
226    #[serde(rename = "Tags")]
227    pub tags: Vec<String>,
228
229    #[serde(rename = "Meta")]
230    pub meta: ::std::collections::HashMap<String, String>,
231
232    #[serde(rename = "Port")]
233    pub port: u16,
234
235    #[serde(rename = "Ports")]
236    #[serde(skip_serializing_if = "Option::is_none")]
237    pub ports: Option<u16>,
238
239    #[serde(rename = "Address")]
240    pub address: String,
241
242    #[serde(rename = "SocketPath")]
243    #[serde(skip_serializing_if = "Option::is_none")]
244    pub socket_path: Option<String>,
245
246    #[serde(rename = "TaggedAddresses")]
247    #[serde(skip_serializing_if = "Option::is_none")]
248    pub tagged_addresses: Option<::std::collections::HashMap<String, ServiceAddress>>,
249
250    #[serde(rename = "Weights")]
251    pub weights: AgentWeights,
252
253    #[serde(rename = "EnableTagOverride")]
254    pub enable_tag_override: bool,
255
256    #[serde(rename = "CreateIndex")]
257    #[serde(skip_serializing_if = "Option::is_none")]
258    pub create_index: Option<u64>,
259
260    #[serde(rename = "ModifyIndex")]
261    #[serde(skip_serializing_if = "Option::is_none")]
262    pub modify_index: Option<u64>,
263
264    #[serde(rename = "ContentHash")]
265    #[serde(skip_serializing_if = "Option::is_none")]
266    pub content_hash: Option<String>,
267
268    #[serde(rename = "Proxy")]
269    #[serde(skip_serializing_if = "Option::is_none")]
270    pub proxy: Option<AgentServiceConnectProxyConfig>,
271
272    #[serde(rename = "Connect")]
273    #[serde(skip_serializing_if = "Option::is_none")]
274    pub connect: Option<AgentServiceConnect>,
275
276    /// NOTE: If we ever set the ContentHash outside of singular service lookup then we may need
277    /// to include the Namespace in the hash. When we do, then we are in for lots of fun with tests.
278    /// For now though, ignoring it works well enough.
279    #[serde(rename = "Namespace")]
280    #[serde(skip_serializing_if = "Option::is_none")]
281    pub namespace: Option<String>,
282
283    #[serde(rename = "Partition")]
284    #[serde(skip_serializing_if = "Option::is_none")]
285    pub partition: Option<String>,
286
287    /// Datacenter is only ever returned and is ignored if presented.
288    #[serde(rename = "Datacenter")]
289    #[serde(skip_serializing_if = "Option::is_none")]
290    pub datacenter: Option<String>,
291
292    #[cfg(feature = "enterprise")]
293    #[serde(rename = "Locality")]
294    #[serde(skip_serializing_if = "Option::is_none")]
295    pub locality: Option<Locality>,
296
297}
298
299/// AgentServiceChecksInfo returns information about a Service and its checks
300#[derive(Debug, Clone, Default, Serialize, Deserialize)]
301pub struct AgentServiceChecksInfo {
302    #[serde(rename = "AggregatedStatus")]
303    pub aggregated_status: Health,
304
305    #[serde(rename = "Service")]
306    pub service: AgentService,
307
308    #[serde(rename = "Checks")]
309    pub checks: HealthChecks,
310
311}
312
313/// AgentServiceConnect represents the Connect configuration of a service.
314#[derive(Debug, Clone, Default, Serialize, Deserialize)]
315pub struct AgentServiceConnect {
316    #[serde(rename = "Native")]
317    #[serde(skip_serializing_if = "Option::is_none")]
318    pub native: Option<bool>,
319
320    #[serde(rename = "SidecarService")]
321    #[serde(skip_serializing_if = "Option::is_none")]
322    pub sidecar_service: Option<Box<AgentServiceRegistration>>,
323
324}
325
326/// AgentServiceConnectProxyConfig is the proxy configuration in a connect-proxy
327/// ServiceDefinition or response.
328#[derive(Debug, Clone, Default, Serialize, Deserialize)]
329pub struct AgentServiceConnectProxyConfig {
330    #[serde(rename = "EnvoyExtensions")]
331    #[serde(skip_serializing_if = "Option::is_none")]
332    pub envoy_extensions: Option<Vec<EnvoyExtension>>,
333
334    #[serde(rename = "DestinationServiceName")]
335    #[serde(skip_serializing_if = "Option::is_none")]
336    pub destination_service_name: Option<String>,
337
338    #[serde(rename = "DestinationServiceID")]
339    #[serde(skip_serializing_if = "Option::is_none")]
340    pub destination_service_id: Option<String>,
341
342    #[serde(rename = "LocalServiceAddress")]
343    #[serde(skip_serializing_if = "Option::is_none")]
344    pub local_service_address: Option<String>,
345
346    #[serde(rename = "LocalServicePort")]
347    #[serde(skip_serializing_if = "Option::is_none")]
348    pub local_service_port: Option<u16>,
349
350    #[serde(rename = "LocalServiceSocketPath")]
351    #[serde(skip_serializing_if = "Option::is_none")]
352    pub local_service_socket_path: Option<String>,
353
354    #[serde(rename = "Mode")]
355    #[serde(skip_serializing_if = "Option::is_none")]
356    pub mode: Option<String>,
357
358    #[serde(rename = "TransparentProxy")]
359    #[serde(skip_serializing_if = "Option::is_none")]
360    pub transparent_proxy: Option<TransparentProxyConfig>,
361
362    #[serde(rename = "Upstreams")]
363    #[serde(skip_serializing_if = "Option::is_none")]
364    pub upstreams: Option<Vec<Upstream>>,
365
366    #[serde(rename = "MeshGateway")]
367    #[serde(skip_serializing_if = "Option::is_none")]
368    pub mesh_gateway: Option<MeshGatewayConfig>,
369
370    #[serde(rename = "Expose")]
371    #[serde(skip_serializing_if = "Option::is_none")]
372    pub expose: Option<ExposeConfig>,
373
374    #[serde(rename = "AccessLogs")]
375    #[serde(skip_serializing_if = "Option::is_none")]
376    pub access_logs: Option<AccessLogsConfig>,
377
378}
379
380/// AgentServiceRegistration is used to register a new service
381#[derive(Debug, Clone, Default, Serialize, Deserialize)]
382pub struct AgentServiceRegistration {
383    #[serde(rename = "Kind")]
384    #[serde(skip_serializing_if = "Option::is_none")]
385    pub kind: Option<String>,
386
387    #[serde(rename = "ID")]
388    #[serde(skip_serializing_if = "Option::is_none")]
389    pub id: Option<String>,
390
391    #[serde(rename = "Name")]
392    #[serde(skip_serializing_if = "Option::is_none")]
393    pub name: Option<String>,
394
395    #[serde(rename = "Tags")]
396    #[serde(skip_serializing_if = "Option::is_none")]
397    pub tags: Option<Vec<String>>,
398
399    #[serde(rename = "Port")]
400    #[serde(skip_serializing_if = "Option::is_none")]
401    pub port: Option<u16>,
402
403    #[serde(rename = "Ports")]
404    #[serde(skip_serializing_if = "Option::is_none")]
405    pub ports: Option<u16>,
406
407    #[serde(rename = "Address")]
408    #[serde(skip_serializing_if = "Option::is_none")]
409    pub address: Option<String>,
410
411    #[serde(rename = "SocketPath")]
412    #[serde(skip_serializing_if = "Option::is_none")]
413    pub socket_path: Option<String>,
414
415    #[serde(rename = "TaggedAddresses")]
416    #[serde(skip_serializing_if = "Option::is_none")]
417    pub tagged_addresses: Option<::std::collections::HashMap<String, ServiceAddress>>,
418
419    #[serde(rename = "EnableTagOverride")]
420    #[serde(skip_serializing_if = "Option::is_none")]
421    pub enable_tag_override: Option<bool>,
422
423    #[serde(rename = "Meta")]
424    #[serde(skip_serializing_if = "Option::is_none")]
425    pub meta: Option<::std::collections::HashMap<String, String>>,
426
427    #[serde(rename = "Weights")]
428    #[serde(skip_serializing_if = "Option::is_none")]
429    pub weights: Option<AgentWeights>,
430
431    #[serde(rename = "Check")]
432    pub check: AgentServiceCheck,
433
434    #[serde(rename = "Checks")]
435    pub checks: AgentServiceChecks,
436
437    #[serde(rename = "Proxy")]
438    #[serde(skip_serializing_if = "Option::is_none")]
439    pub proxy: Option<AgentServiceConnectProxyConfig>,
440
441    #[serde(rename = "Connect")]
442    #[serde(skip_serializing_if = "Option::is_none")]
443    pub connect: Option<AgentServiceConnect>,
444
445    #[serde(rename = "Namespace")]
446    #[serde(skip_serializing_if = "Option::is_none")]
447    pub namespace: Option<String>,
448
449    #[serde(rename = "Partition")]
450    #[serde(skip_serializing_if = "Option::is_none")]
451    pub partition: Option<String>,
452
453    #[cfg(feature = "enterprise")]
454    #[serde(rename = "Locality")]
455    #[serde(skip_serializing_if = "Option::is_none")]
456    pub locality: Option<Locality>,
457
458}
459
460/// AgentServiceCheck is used to define a node or service level check
461#[derive(Debug, Clone, Default, Serialize, Deserialize)]
462pub struct AgentServiceCheck {
463    #[serde(rename = "CheckID")]
464    #[serde(skip_serializing_if = "Option::is_none")]
465    pub check_id: Option<String>,
466
467    #[serde(rename = "Name")]
468    #[serde(skip_serializing_if = "Option::is_none")]
469    pub name: Option<String>,
470
471    #[serde(rename = "Args")]
472    #[serde(skip_serializing_if = "Option::is_none")]
473    pub args: Option<Vec<String>>,
474
475    #[serde(rename = "DockerContainerID")]
476    #[serde(skip_serializing_if = "Option::is_none")]
477    pub docker_container_id: Option<String>,
478
479    #[serde(rename = "Shell")]
480    #[serde(skip_serializing_if = "Option::is_none")]
481    pub shell: Option<String>,
482
483    #[serde(rename = "Interval")]
484    #[serde(skip_serializing_if = "Option::is_none")]
485    pub interval: Option<String>,
486
487    #[serde(rename = "Timeout")]
488    #[serde(skip_serializing_if = "Option::is_none")]
489    pub timeout: Option<String>,
490
491    #[serde(rename = "TTL")]
492    #[serde(skip_serializing_if = "Option::is_none")]
493    pub ttl: Option<String>,
494
495    #[serde(rename = "HTTP")]
496    #[serde(skip_serializing_if = "Option::is_none")]
497    pub http: Option<String>,
498
499    #[serde(rename = "Header")]
500    #[serde(skip_serializing_if = "Option::is_none")]
501    pub header: Option<::std::collections::HashMap<String, Vec<String>>>,
502
503    #[serde(rename = "Method")]
504    #[serde(skip_serializing_if = "Option::is_none")]
505    pub method: Option<String>,
506
507    #[serde(rename = "Body")]
508    #[serde(skip_serializing_if = "Option::is_none")]
509    pub body: Option<String>,
510
511    #[serde(rename = "TCP")]
512    #[serde(skip_serializing_if = "Option::is_none")]
513    pub tcp: Option<String>,
514
515    #[serde(rename = "TCPUseTLS")]
516    #[serde(skip_serializing_if = "Option::is_none")]
517    pub tcp_use_tls: Option<bool>,
518
519    #[serde(rename = "UDP")]
520    #[serde(skip_serializing_if = "Option::is_none")]
521    pub udp: Option<String>,
522
523    #[serde(rename = "Status")]
524    #[serde(skip_serializing_if = "Option::is_none")]
525    pub status: Option<String>,
526
527    #[serde(rename = "Notes")]
528    #[serde(skip_serializing_if = "Option::is_none")]
529    pub notes: Option<String>,
530
531    #[serde(rename = "TLSServerName")]
532    #[serde(skip_serializing_if = "Option::is_none")]
533    pub tls_server_name: Option<String>,
534
535    #[serde(rename = "TLSSkipVerify")]
536    #[serde(skip_serializing_if = "Option::is_none")]
537    pub tls_skip_verify: Option<bool>,
538
539    #[serde(rename = "GRPC")]
540    #[serde(skip_serializing_if = "Option::is_none")]
541    pub grpc: Option<String>,
542
543    #[serde(rename = "GRPCUseTLS")]
544    #[serde(skip_serializing_if = "Option::is_none")]
545    pub grpc_use_tls: Option<bool>,
546
547    #[serde(rename = "H2PING")]
548    #[serde(skip_serializing_if = "Option::is_none")]
549    pub h2_ping: Option<String>,
550
551    #[serde(rename = "H2PingUseTLS")]
552    #[serde(skip_serializing_if = "Option::is_none")]
553    pub h2_ping_use_tls: Option<bool>,
554
555    #[serde(rename = "AliasNode")]
556    #[serde(skip_serializing_if = "Option::is_none")]
557    pub alias_node: Option<String>,
558
559    #[serde(rename = "AliasService")]
560    #[serde(skip_serializing_if = "Option::is_none")]
561    pub alias_service: Option<String>,
562
563    #[serde(rename = "SuccessBeforePassing")]
564    #[serde(skip_serializing_if = "Option::is_none")]
565    pub success_before_passing: Option<isize>,
566
567    #[serde(rename = "FailuresBeforeWarning")]
568    #[serde(skip_serializing_if = "Option::is_none")]
569    pub failures_before_warning: Option<isize>,
570
571    #[serde(rename = "FailuresBeforeCritical")]
572    #[serde(skip_serializing_if = "Option::is_none")]
573    pub failures_before_critical: Option<isize>,
574
575    /// In Consul 0.7 and later, checks that are associated with a service
576    /// may also contain this optional DeregisterCriticalServiceAfter field,
577    /// which is a timeout in the same Go time format as Interval and TTL. If
578    /// a check is in the critical state for more than this configured value,
579    /// then its associated service (and all of its associated checks) will
580    /// automatically be deregistered.
581    #[serde(rename = "DeregisterCriticalServiceAfter")]
582    #[serde(skip_serializing_if = "Option::is_none")]
583    pub deregister_critical_service_after: Option<String>,
584
585}
586
587pub type AgentServiceChecks = Vec<AgentServiceCheck>;
588
589
590/// QueryOptions are used to parameterize a query
591#[derive(Debug, Clone, Default, Serialize, Deserialize)]
592pub struct QueryOptions {
593    /// Namespace overrides the `default` namespace
594    /// Note: Namespaces are available only in Consul Enterprise
595    #[serde(rename = "Namespace")]
596    pub namespace: String,
597
598    /// Partition overrides the `default` partition
599    /// Note: Partitions are available only in Consul Enterprise
600    #[serde(rename = "Partition")]
601    pub partition: String,
602
603    /// SamenessGroup is used find the SamenessGroup in the given
604    /// Partition and will find the failover order for the Service
605    /// from the SamenessGroup Members, with the given Partition being
606    /// the first member.
607    /// Note: SamenessGroups are available only in Consul Enterprise
608    #[serde(rename = "SamenessGroup")]
609    pub sameness_group: String,
610
611    /// Providing a datacenter overwrites the DC provided
612    /// by the Config
613    #[serde(rename = "Datacenter")]
614    pub datacenter: String,
615
616    /// Providing a peer name in the query option
617    #[serde(rename = "Peer")]
618    pub peer: String,
619
620    /// AllowStale allows any Consul server (non-leader) to service
621    /// a read. This allows for lower latency and higher throughput
622    #[serde(rename = "AllowStale")]
623    pub allow_stale: bool,
624
625    /// RequireConsistent forces the read to be fully consistent.
626    /// This is more expensive but prevents ever performing a stale
627    /// read.
628    #[serde(rename = "RequireConsistent")]
629    pub require_consistent: bool,
630
631    /// UseCache requests that the agent cache results locally. See
632    /// https://developer.hashicorp.com/api/features/caching.html for more details on the
633    /// semantics.
634    #[serde(rename = "UseCache")]
635    pub use_cache: bool,
636
637    /// MaxAge limits how old a cached value will be returned if UseCache is true.
638    /// If there is a cached response that is older than the MaxAge, it is treated
639    /// as a cache miss and a new fetch invoked. If the fetch fails, the error is
640    /// returned. Clients that wish to allow for stale results on error can set
641    /// StaleIfError to a longer duration to change this behavior. It is ignored
642    /// if the endpoint supports background refresh caching. See
643    /// https://developer.hashicorp.com/api/features/caching.html for more details.
644    #[serde(rename = "MaxAge")]
645    #[serde(skip_serializing_if = "Option::is_none")]
646    pub max_age: Option<String>,
647
648    /// StaleIfError specifies how stale the client will accept a cached response
649    /// if the servers are unavailable to fetch a fresh one. Only makes sense when
650    /// UseCache is true and MaxAge is set to a lower, non-zero value. It is
651    /// ignored if the endpoint supports background refresh caching. See
652    /// https://developer.hashicorp.com/api/features/caching.html for more details.
653    #[serde(rename = "StaleIfError")]
654    #[serde(skip_serializing_if = "Option::is_none")]
655    pub stale_if_error: Option<String>,
656
657    /// WaitIndex is used to enable a blocking query. Waits
658    /// until the timeout or the next index is reached
659    #[serde(rename = "WaitIndex")]
660    pub wait_index: u64,
661
662    /// WaitHash is used by some endpoints instead of WaitIndex to perform blocking
663    /// on state based on a hash of the response rather than a monotonic index.
664    /// This is required when the state being blocked on is not stored in Raft, for
665    /// example agent-local proxy configuration.
666    #[serde(rename = "WaitHash")]
667    pub wait_hash: String,
668
669    /// WaitTime is used to bound the duration of a wait.
670    /// Defaults to that of the Config, but can be overridden.
671    #[serde(rename = "WaitTime")]
672    #[serde(skip_serializing_if = "Option::is_none")]
673    pub wait_time: Option<String>,
674
675    /// Token is used to provide a per-request ACL token
676    /// which overrides the agent's default token.
677    #[serde(rename = "Token")]
678    pub token: String,
679
680    /// Near is used to provide a node name that will sort the results
681    /// in ascending order based on the estimated round trip time from
682    /// that node. Setting this to "_agent" will use the agent's node
683    /// for the sort.
684    #[serde(rename = "Near")]
685    pub near: String,
686
687    /// NodeMeta is used to filter results by nodes with the given
688    /// metadata key/value pairs. Currently, only one key/value pair can
689    /// be provided for filtering.
690    #[serde(rename = "NodeMeta")]
691    pub node_meta: ::std::collections::HashMap<String, String>,
692
693    /// RelayFactor is used in keyring operations to cause responses to be
694    /// relayed back to the sender through N other random nodes. Must be
695    /// a value from 0 to 5 (inclusive).
696    #[serde(rename = "RelayFactor")]
697    pub relay_factor: u8,
698
699    /// LocalOnly is used in keyring list operation to force the keyring
700    /// query to only hit local servers (no WAN traffic).
701    #[serde(rename = "LocalOnly")]
702    pub local_only: bool,
703
704    /// Connect filters prepared query execution to only include Connect-capable
705    /// services. This currently affects prepared query execution.
706    #[serde(rename = "Connect")]
707    pub connect: bool,
708
709    /// Filter requests filtering data prior to it being returned. The string
710    /// is a go-bexpr compatible expression.
711    #[serde(rename = "Filter")]
712    pub filter: String,
713
714    /// MergeCentralConfig returns a service definition merged with the
715    /// proxy-defaults/global and service-defaults/:service config entries.
716    /// This can be used to ensure a full service definition is returned in the response
717    /// especially when the service might not be written into the catalog that way.
718    #[serde(rename = "MergeCentralConfig")]
719    pub merge_central_config: bool,
720
721    /// Global is used to request information from all datacenters. Currently only
722    /// used for operator usage requests.
723    #[serde(rename = "Global")]
724    pub global: bool,
725
726}
727
728/// HealthCheck is used to represent a single check
729#[derive(Debug, Clone, Default, Serialize, Deserialize)]
730pub struct HealthCheck {
731    #[serde(rename = "Node")]
732    pub node: String,
733
734    #[serde(rename = "CheckID")]
735    pub check_id: String,
736
737    #[serde(rename = "Name")]
738    pub name: String,
739
740    #[serde(rename = "Status")]
741    pub status: String,
742
743    #[serde(rename = "Notes")]
744    pub notes: String,
745
746    #[serde(rename = "Output")]
747    pub output: String,
748
749    #[serde(rename = "ServiceID")]
750    pub service_id: String,
751
752    #[serde(rename = "ServiceName")]
753    pub service_name: String,
754
755    #[serde(rename = "ServiceTags")]
756    pub service_tags: Vec<String>,
757
758    #[serde(rename = "Type")]
759    pub r#type: String,
760
761    #[serde(rename = "Namespace")]
762    #[serde(skip_serializing_if = "Option::is_none")]
763    pub namespace: Option<String>,
764
765    #[serde(rename = "Partition")]
766    #[serde(skip_serializing_if = "Option::is_none")]
767    pub partition: Option<String>,
768
769    #[serde(rename = "ExposedPort")]
770    pub exposed_port: u16,
771
772    #[serde(rename = "Definition")]
773    #[serde(skip_serializing_if = "Option::is_none")]
774    pub definition: Option<HealthCheckDefinition>,
775
776    #[serde(rename = "CreateIndex")]
777    pub create_index: u64,
778
779    #[serde(rename = "ModifyIndex")]
780    pub modify_index: u64,
781
782}
783
784pub type HealthChecks = Vec<HealthCheck>;
785
786
787/// NamespaceACLConfig is the Namespace specific ACL configuration container
788#[derive(Debug, Clone, Default, Serialize, Deserialize)]
789pub struct NamespaceACLConfig {
790    /// PolicyDefaults is the list of policies that should be used for the parent authorizer
791    /// of all tokens in the associated namespace.
792    #[serde(rename = "PolicyDefaults")]
793    pub policy_defaults: Vec<ACLLink>,
794
795    /// RoleDefaults is the list of roles that should be used for the parent authorizer
796    /// of all tokens in the associated namespace.
797    #[serde(rename = "RoleDefaults")]
798    pub role_defaults: Vec<ACLLink>,
799
800}
801
802/// UserEventParam is used to parameterize a user event
803#[derive(Debug, Clone, Default, Serialize, Deserialize)]
804pub struct UserEvent {
805    /// ID of the user event. Automatically generated.
806    #[serde(rename = "ID")]
807    pub id: String,
808
809    /// Name of the event
810    #[serde(rename = "Name")]
811    pub name: String,
812
813    /// Optional payload
814    #[serde(rename = "Payload")]
815    #[serde(skip_serializing_if = "Option::is_none")]
816    pub payload: Option<Base64Payload>,
817
818    /// NodeFilter is a regular expression to filter on nodes
819    #[serde(rename = "NodeFilter")]
820    #[serde(skip_serializing_if = "Option::is_none")]
821    pub node_filter: Option<String>,
822
823    /// ServiceFilter is a regular expression to filter on services
824    #[serde(rename = "ServiceFilter")]
825    #[serde(skip_serializing_if = "Option::is_none")]
826    pub service_filter: Option<String>,
827
828    /// TagFilter is a regular expression to filter on tags of a service,
829    /// must be provided with ServiceFilter
830    #[serde(rename = "TagFilter")]
831    #[serde(skip_serializing_if = "Option::is_none")]
832    pub tag_filter: Option<String>,
833
834    /// Version of the user event. Automatically generated.
835    #[serde(rename = "Version")]
836    pub version: isize,
837
838    /// LTime is the lamport time. Automatically generated.
839    #[serde(rename = "LTime")]
840    pub l_time: u64,
841
842}
843
844/// CheckDefinition is used to JSON decode the Check definitions
845#[derive(Debug, Clone, Default, Serialize, Deserialize)]
846pub struct CheckDefinition {
847    #[serde(rename = "ID")]
848    pub id: String,
849
850    #[serde(rename = "Name")]
851    pub name: String,
852
853    #[serde(rename = "Notes")]
854    pub notes: String,
855
856    #[serde(rename = "ServiceID")]
857    pub service_id: String,
858
859    #[serde(rename = "Token")]
860    pub token: String,
861
862    #[serde(rename = "Status")]
863    pub status: String,
864
865    /// Copied fields from CheckType without the fields
866    /// already present in CheckDefinition:
867    ///
868    ///   ID (CheckID), Name, Status, Notes
869    #[serde(rename = "ScriptArgs")]
870    pub script_args: Vec<String>,
871
872    #[serde(rename = "HTTP")]
873    pub http: String,
874
875    #[serde(rename = "H2PING")]
876    pub h2_ping: String,
877
878    #[serde(rename = "H2PingUseTLS")]
879    pub h2_ping_use_tls: bool,
880
881    #[serde(rename = "Header")]
882    pub header: ::std::collections::HashMap<String, Vec<String>>,
883
884    #[serde(rename = "Method")]
885    pub method: String,
886
887    #[serde(rename = "Body")]
888    pub body: String,
889
890    #[serde(rename = "DisableRedirects")]
891    pub disable_redirects: bool,
892
893    #[serde(rename = "TCP")]
894    pub tcp: String,
895
896    #[serde(rename = "TCPUseTLS")]
897    pub tcp_use_tls: bool,
898
899    #[serde(rename = "UDP")]
900    pub udp: String,
901
902    #[serde(rename = "Interval")]
903    #[serde(skip_serializing_if = "Option::is_none")]
904    pub interval: Option<String>,
905
906    #[serde(rename = "DockerContainerID")]
907    pub docker_container_id: String,
908
909    #[serde(rename = "Shell")]
910    pub shell: String,
911
912    #[serde(rename = "GRPC")]
913    pub grpc: String,
914
915    #[serde(rename = "GRPCUseTLS")]
916    pub grpc_use_tls: bool,
917
918    #[serde(rename = "OSService")]
919    pub os_service: String,
920
921    #[serde(rename = "TLSServerName")]
922    pub tls_server_name: String,
923
924    #[serde(rename = "TLSSkipVerify")]
925    pub tls_skip_verify: bool,
926
927    #[serde(rename = "AliasNode")]
928    pub alias_node: String,
929
930    #[serde(rename = "AliasService")]
931    pub alias_service: String,
932
933    #[serde(rename = "Timeout")]
934    #[serde(skip_serializing_if = "Option::is_none")]
935    pub timeout: Option<String>,
936
937    #[serde(rename = "TTL")]
938    #[serde(skip_serializing_if = "Option::is_none")]
939    pub ttl: Option<String>,
940
941    #[serde(rename = "SuccessBeforePassing")]
942    pub success_before_passing: isize,
943
944    #[serde(rename = "FailuresBeforeWarning")]
945    pub failures_before_warning: isize,
946
947    #[serde(rename = "FailuresBeforeCritical")]
948    pub failures_before_critical: isize,
949
950    #[serde(rename = "DeregisterCriticalServiceAfter")]
951    #[serde(skip_serializing_if = "Option::is_none")]
952    pub deregister_critical_service_after: Option<String>,
953
954    #[serde(rename = "OutputMaxSize")]
955    pub output_max_size: isize,
956
957}
958
959/// CheckType is used to create either the CheckMonitor or the CheckTTL.
960/// The following types are supported: Script, HTTP, TCP, Docker, TTL, GRPC, Alias, H2PING. Script,
961/// HTTP, Docker, TCP, GRPC, and H2PING all require Interval. Only one of the types may
962/// to be provided: TTL or Script/Interval or HTTP/Interval or TCP/Interval or
963/// Docker/Interval or GRPC/Interval or AliasService or H2PING/Interval.
964/// Since types like CheckHTTP and CheckGRPC derive from CheckType, there are
965/// helper conversion methods that do the reverse conversion. ie. checkHTTP.CheckType()
966#[derive(Debug, Clone, Default, Serialize, Deserialize)]
967pub struct CheckType {
968    #[serde(rename = "CheckID")]
969    pub check_id: String,
970
971    #[serde(rename = "Name")]
972    pub name: String,
973
974    #[serde(rename = "Status")]
975    pub status: String,
976
977    #[serde(rename = "Notes")]
978    pub notes: String,
979
980    #[serde(rename = "ScriptArgs")]
981    pub script_args: Vec<String>,
982
983    #[serde(rename = "HTTP")]
984    pub http: String,
985
986    #[serde(rename = "H2PING")]
987    pub h2_ping: String,
988
989    #[serde(rename = "H2PingUseTLS")]
990    pub h2_ping_use_tls: bool,
991
992    #[serde(rename = "Header")]
993    pub header: ::std::collections::HashMap<String, Vec<String>>,
994
995    #[serde(rename = "Method")]
996    pub method: String,
997
998    #[serde(rename = "Body")]
999    pub body: String,
1000
1001    #[serde(rename = "DisableRedirects")]
1002    pub disable_redirects: bool,
1003
1004    #[serde(rename = "TCP")]
1005    pub tcp: String,
1006
1007    #[serde(rename = "TCPUseTLS")]
1008    pub tcp_use_tls: bool,
1009
1010    #[serde(rename = "UDP")]
1011    pub udp: String,
1012
1013    #[serde(rename = "Interval")]
1014    #[serde(skip_serializing_if = "Option::is_none")]
1015    pub interval: Option<String>,
1016
1017    #[serde(rename = "AliasNode")]
1018    pub alias_node: String,
1019
1020    #[serde(rename = "AliasService")]
1021    pub alias_service: String,
1022
1023    #[serde(rename = "DockerContainerID")]
1024    pub docker_container_id: String,
1025
1026    #[serde(rename = "Shell")]
1027    pub shell: String,
1028
1029    #[serde(rename = "GRPC")]
1030    pub grpc: String,
1031
1032    #[serde(rename = "GRPCUseTLS")]
1033    pub grpc_use_tls: bool,
1034
1035    #[serde(rename = "OSService")]
1036    pub os_service: String,
1037
1038    #[serde(rename = "TLSServerName")]
1039    pub tls_server_name: String,
1040
1041    #[serde(rename = "TLSSkipVerify")]
1042    pub tls_skip_verify: bool,
1043
1044    #[serde(rename = "Timeout")]
1045    #[serde(skip_serializing_if = "Option::is_none")]
1046    pub timeout: Option<String>,
1047
1048    #[serde(rename = "TTL")]
1049    #[serde(skip_serializing_if = "Option::is_none")]
1050    pub ttl: Option<String>,
1051
1052    #[serde(rename = "SuccessBeforePassing")]
1053    pub success_before_passing: isize,
1054
1055    #[serde(rename = "FailuresBeforeWarning")]
1056    pub failures_before_warning: isize,
1057
1058    #[serde(rename = "FailuresBeforeCritical")]
1059    pub failures_before_critical: isize,
1060
1061    /// Definition fields used when exposing checks through a proxy
1062    #[serde(rename = "ProxyHTTP")]
1063    pub proxy_http: String,
1064
1065    #[serde(rename = "ProxyGRPC")]
1066    pub proxy_grpc: String,
1067
1068    /// DeregisterCriticalServiceAfter, if >0, will cause the associated
1069    /// service, if any, to be deregistered if this check is critical for
1070    /// longer than this duration.
1071    #[serde(rename = "DeregisterCriticalServiceAfter")]
1072    #[serde(skip_serializing_if = "Option::is_none")]
1073    pub deregister_critical_service_after: Option<String>,
1074
1075    #[serde(rename = "OutputMaxSize")]
1076    pub output_max_size: isize,
1077
1078}
1079
1080pub type CheckTypes = Vec<CheckType>;
1081
1082
1083/// GatewayService is used to associate gateways with their linked services.
1084#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1085pub struct GatewayService {
1086    #[serde(rename = "Gateway")]
1087    pub gateway: ServiceName,
1088
1089    #[serde(rename = "Service")]
1090    pub service: ServiceName,
1091
1092    #[serde(rename = "GatewayKind")]
1093    pub gateway_kind: String,
1094
1095    #[serde(rename = "Port")]
1096    #[serde(skip_serializing_if = "Option::is_none")]
1097    pub port: Option<u16>,
1098
1099    #[serde(rename = "Protocol")]
1100    #[serde(skip_serializing_if = "Option::is_none")]
1101    pub protocol: Option<String>,
1102
1103    #[serde(rename = "Hosts")]
1104    #[serde(skip_serializing_if = "Option::is_none")]
1105    pub hosts: Option<Vec<String>>,
1106
1107    #[serde(rename = "CAFile")]
1108    #[serde(skip_serializing_if = "Option::is_none")]
1109    pub ca_file: Option<String>,
1110
1111    #[serde(rename = "CertFile")]
1112    #[serde(skip_serializing_if = "Option::is_none")]
1113    pub cert_file: Option<String>,
1114
1115    #[serde(rename = "KeyFile")]
1116    #[serde(skip_serializing_if = "Option::is_none")]
1117    pub key_file: Option<String>,
1118
1119    #[serde(rename = "SNI")]
1120    #[serde(skip_serializing_if = "Option::is_none")]
1121    pub sni: Option<String>,
1122
1123    #[serde(rename = "FromWildcard")]
1124    #[serde(skip_serializing_if = "Option::is_none")]
1125    pub from_wildcard: Option<bool>,
1126
1127    #[serde(rename = "ServiceKind")]
1128    #[serde(skip_serializing_if = "Option::is_none")]
1129    pub service_kind: Option<GatewayServiceKind>,
1130
1131    #[serde(rename = "AutoHostRewrite")]
1132    #[serde(skip_serializing_if = "Option::is_none")]
1133    pub auto_host_rewrite: Option<bool>,
1134
1135}
1136
1137/// ConnectAuthorizeRequest is the structure of a request to authorize
1138/// a connection.
1139#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1140pub struct ConnectAuthorizeRequest {
1141    /// Target is the name of the service that is being requested.
1142    #[serde(rename = "Target")]
1143    pub target: String,
1144
1145    /// ClientCertURI is a unique identifier for the requesting client. This
1146    /// is currently the URI SAN from the TLS client certificate.
1147    ///
1148    /// ClientCertSerial is a colon-hex-encoded of the serial number for
1149    /// the requesting client cert. This is used to check against revocation
1150    /// lists.
1151    #[serde(rename = "ClientCertURI")]
1152    pub client_cert_uri: String,
1153
1154    #[serde(rename = "ClientCertSerial")]
1155    pub client_cert_serial: String,
1156
1157}
1158
1159/// MeshGatewayConfig controls how Mesh Gateways are configured and used
1160/// This is a struct to allow for future additions without having more free-hanging
1161/// configuration items all over the place
1162#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1163pub struct MeshGatewayConfig {
1164    /// The Mesh Gateway routing mode
1165    #[serde(rename = "Mode")]
1166    #[serde(skip_serializing_if = "Option::is_none")]
1167    pub mode: Option<MeshGatewayMode>,
1168
1169}
1170
1171#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1172pub struct TransparentProxyConfig {
1173    /// The port of the listener where outbound application traffic is being redirected to.
1174    #[serde(rename = "OutboundListenerPort")]
1175    #[serde(skip_serializing_if = "Option::is_none")]
1176    pub outbound_listener_port: Option<u16>,
1177
1178    /// DialedDirectly indicates whether transparent proxies can dial this proxy instance directly.
1179    /// The discovery chain is not considered when dialing a service instance directly.
1180    /// This setting is useful when addressing stateful services, such as a database cluster with a leader node.
1181    #[serde(rename = "DialedDirectly")]
1182    #[serde(skip_serializing_if = "Option::is_none")]
1183    pub dialed_directly: Option<bool>,
1184
1185}
1186
1187/// AccessLogsConfig contains the associated default settings for all Envoy instances within the datacenter or partition
1188#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1189pub struct AccessLogsConfig {
1190    /// Enabled turns off all access logging
1191    #[serde(rename = "Enabled")]
1192    #[serde(skip_serializing_if = "Option::is_none")]
1193    pub enabled: Option<bool>,
1194
1195    /// DisableListenerLogs turns off just listener logs for connections rejected by Envoy because they don't
1196    /// have a matching listener filter.
1197    #[serde(rename = "DisableListenerLogs")]
1198    #[serde(skip_serializing_if = "Option::is_none")]
1199    pub disable_listener_logs: Option<bool>,
1200
1201    /// Type selects the output for logs: "file", "stderr". "stdout"
1202    #[serde(rename = "Type")]
1203    #[serde(skip_serializing_if = "Option::is_none")]
1204    pub r#type: Option<LogSinkType>,
1205
1206    /// Path is the output file to write logs
1207    #[serde(rename = "Path")]
1208    #[serde(skip_serializing_if = "Option::is_none")]
1209    pub path: Option<String>,
1210
1211    /// The presence of one format string or the other implies the access log string encoding.
1212    /// Defining Both is invalid.
1213    #[serde(rename = "JSONFormat")]
1214    #[serde(skip_serializing_if = "Option::is_none")]
1215    pub json_format: Option<String>,
1216
1217    #[serde(rename = "TextFormat")]
1218    #[serde(skip_serializing_if = "Option::is_none")]
1219    pub text_format: Option<String>,
1220
1221}
1222
1223/// ConnectProxyConfig describes the configuration needed for any proxy managed
1224/// or unmanaged. It describes a single logical service's listener and optionally
1225/// upstreams and sidecar-related config for a single instance. To describe a
1226/// centralized proxy that routed traffic for multiple services, a different one
1227/// of these would be needed for each, sharing the same LogicalProxyID.
1228#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1229pub struct ConnectProxyConfig {
1230    /// EnvoyExtensions are the list of Envoy extensions configured for the local service.
1231    #[serde(rename = "EnvoyExtensions")]
1232    #[serde(skip_serializing_if = "Option::is_none")]
1233    pub envoy_extensions: Option<Vec<EnvoyExtension>>,
1234
1235    /// DestinationServiceName is required and is the name of the service to accept
1236    /// traffic for.
1237    #[serde(rename = "DestinationServiceName")]
1238    #[serde(skip_serializing_if = "Option::is_none")]
1239    pub destination_service_name: Option<String>,
1240
1241    /// DestinationServiceID is optional and should only be specified for
1242    /// "side-car" style proxies where the proxy is in front of just a single
1243    /// instance of the service. It should be set to the service ID of the instance
1244    /// being represented which must be registered to the same agent. It's valid to
1245    /// provide a service ID that does not yet exist to avoid timing issues when
1246    /// bootstrapping a service with a proxy.
1247    #[serde(rename = "DestinationServiceID")]
1248    #[serde(skip_serializing_if = "Option::is_none")]
1249    pub destination_service_id: Option<String>,
1250
1251    /// LocalServiceAddress is the address of the local service instance. It is
1252    /// optional and should only be specified for "side-car" style proxies. It will
1253    /// default to 127.0.0.1 or ::1 if the proxy is a "side-car" (DestinationServiceID is
1254    /// set) but otherwise will be ignored.
1255    #[serde(rename = "LocalServiceAddress")]
1256    #[serde(skip_serializing_if = "Option::is_none")]
1257    pub local_service_address: Option<String>,
1258
1259    /// LocalServicePort is the port of the local service instance. It is optional
1260    /// and should only be specified for "side-car" style proxies. It will default
1261    /// to the registered port for the instance if the proxy is a "side-car"
1262    /// (DestinationServiceID is set) but otherwise will be ignored.
1263    #[serde(rename = "LocalServicePort")]
1264    #[serde(skip_serializing_if = "Option::is_none")]
1265    pub local_service_port: Option<u16>,
1266
1267    /// LocalServiceSocketPath is the socket of the local service instance. It is optional
1268    /// and should only be specified for "side-car" style proxies.
1269    #[serde(rename = "LocalServiceSocketPath")]
1270    #[serde(skip_serializing_if = "Option::is_none")]
1271    pub local_service_socket_path: Option<String>,
1272
1273    /// Mode represents how the proxy's inbound and upstream listeners are dialed.
1274    #[serde(rename = "Mode")]
1275    pub mode: String,
1276
1277    /// Upstreams describes any upstream dependencies the proxy instance should
1278    /// setup.
1279    #[serde(rename = "Upstreams")]
1280    #[serde(skip_serializing_if = "Option::is_none")]
1281    pub upstreams: Option<Upstreams>,
1282
1283    /// MeshGateway defines the mesh gateway configuration for this upstream
1284    #[serde(rename = "MeshGateway")]
1285    #[serde(skip_serializing_if = "Option::is_none")]
1286    pub mesh_gateway: Option<MeshGatewayConfig>,
1287
1288    /// Expose defines whether checks or paths are exposed through the proxy
1289    #[serde(rename = "Expose")]
1290    #[serde(skip_serializing_if = "Option::is_none")]
1291    pub expose: Option<ExposeConfig>,
1292
1293    /// TransparentProxy defines configuration for when the proxy is in
1294    /// transparent mode.
1295    #[serde(rename = "TransparentProxy")]
1296    #[serde(skip_serializing_if = "Option::is_none")]
1297    pub transparent_proxy: Option<TransparentProxyConfig>,
1298
1299    /// AccessLogs configures the output and format of Envoy access logs
1300    #[serde(rename = "AccessLogs")]
1301    #[serde(skip_serializing_if = "Option::is_none")]
1302    pub access_logs: Option<AccessLogsConfig>,
1303
1304}
1305
1306/// Upstream represents a single upstream dependency for a service or proxy. It
1307/// describes the mechanism used to discover instances to communicate with (the
1308/// Target) as well as any potential client configuration that may be useful such
1309/// as load balancer options, timeouts etc.
1310#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1311pub struct Upstream {
1312    /// Destination fields are the required ones for determining what this upstream
1313    /// points to. Depending on DestinationType some other fields below might
1314    /// further restrict the set of instances allowable.
1315    ///
1316    /// DestinationType would be better as an int constant but even with custom
1317    /// JSON marshallers it causes havoc with all the mapstructure mangling we do
1318    /// on service definitions in various places.
1319    #[serde(rename = "DestinationType")]
1320    pub destination_type: String,
1321
1322    #[serde(rename = "DestinationNamespace")]
1323    #[serde(skip_serializing_if = "Option::is_none")]
1324    pub destination_namespace: Option<String>,
1325
1326    #[serde(rename = "DestinationPartition")]
1327    #[serde(skip_serializing_if = "Option::is_none")]
1328    pub destination_partition: Option<String>,
1329
1330    #[serde(rename = "DestinationPeer")]
1331    #[serde(skip_serializing_if = "Option::is_none")]
1332    pub destination_peer: Option<String>,
1333
1334    #[serde(rename = "DestinationName")]
1335    pub destination_name: String,
1336
1337    /// Datacenter that the service discovery request should be run against. Note
1338    /// for prepared queries, the actual results might be from a different
1339    /// datacenter.
1340    #[serde(rename = "Datacenter")]
1341    pub datacenter: String,
1342
1343    /// LocalBindAddress is the ip address a side-car proxy should listen on for
1344    /// traffic destined for this upstream service. Default if empty is 127.0.0.1 for IPv4
1345    /// or ::1 if IPv6 agent bind address.
1346    #[serde(rename = "LocalBindAddress")]
1347    #[serde(skip_serializing_if = "Option::is_none")]
1348    pub local_bind_address: Option<String>,
1349
1350    /// LocalBindPort is the ip address a side-car proxy should listen on for traffic
1351    /// destined for this upstream service. Required.
1352    #[serde(rename = "LocalBindPort")]
1353    #[serde(skip_serializing_if = "Option::is_none")]
1354    pub local_bind_port: Option<u16>,
1355
1356    /// These are exclusive with LocalBindAddress/LocalBindPort
1357    #[serde(rename = "LocalBindSocketPath")]
1358    #[serde(skip_serializing_if = "Option::is_none")]
1359    pub local_bind_socket_path: Option<String>,
1360
1361    /// This might be represented as an int, but because it's octal outputs can be a bit strange.
1362    #[serde(rename = "LocalBindSocketMode")]
1363    #[serde(skip_serializing_if = "Option::is_none")]
1364    pub local_bind_socket_mode: Option<String>,
1365
1366    /// MeshGateway is the configuration for mesh gateway usage of this upstream
1367    #[serde(rename = "MeshGateway")]
1368    #[serde(skip_serializing_if = "Option::is_none")]
1369    pub mesh_gateway: Option<MeshGatewayConfig>,
1370
1371    /// CentrallyConfigured indicates whether the upstream was defined in a proxy
1372    /// instance registration or whether it was generated from a config entry.
1373    #[serde(rename = "CentrallyConfigured")]
1374    #[serde(skip_serializing_if = "Option::is_none")]
1375    pub centrally_configured: Option<bool>,
1376
1377}
1378
1379pub type Upstreams = Vec<Upstream>;
1380
1381
1382/// ExposeConfig describes HTTP paths to expose through Envoy outside of Connect.
1383/// Users can expose individual paths and/or all HTTP/GRPC paths for checks.
1384#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1385pub struct ExposeConfig {
1386    /// Checks defines whether paths associated with Consul checks will be exposed.
1387    /// This flag triggers exposing all HTTP and GRPC check paths registered for the service.
1388    #[serde(rename = "Checks")]
1389    #[serde(skip_serializing_if = "Option::is_none")]
1390    pub checks: Option<bool>,
1391
1392    /// Paths is the list of paths exposed through the proxy.
1393    #[serde(rename = "Paths")]
1394    #[serde(skip_serializing_if = "Option::is_none")]
1395    pub paths: Option<Vec<ExposePath>>,
1396
1397}
1398
1399#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1400pub struct ExposePath {
1401    /// ListenerPort defines the port of the proxy's listener for exposed paths.
1402    #[serde(rename = "ListenerPort")]
1403    #[serde(skip_serializing_if = "Option::is_none")]
1404    pub listener_port: Option<u16>,
1405
1406    /// Path is the path to expose through the proxy, ie. "/metrics."
1407    #[serde(rename = "Path")]
1408    #[serde(skip_serializing_if = "Option::is_none")]
1409    pub path: Option<String>,
1410
1411    /// LocalPathPort is the port that the service is listening on for the given path.
1412    #[serde(rename = "LocalPathPort")]
1413    #[serde(skip_serializing_if = "Option::is_none")]
1414    pub local_path_port: Option<u16>,
1415
1416    /// Protocol describes the upstream's service protocol.
1417    /// Valid values are "http" and "http2", defaults to "http"
1418    #[serde(rename = "Protocol")]
1419    #[serde(skip_serializing_if = "Option::is_none")]
1420    pub protocol: Option<String>,
1421
1422    /// ParsedFromCheck is set if this path was parsed from a registered check
1423    #[serde(rename = "ParsedFromCheck")]
1424    #[serde(skip_serializing_if = "Option::is_none")]
1425    pub parsed_from_check: Option<bool>,
1426
1427}
1428
1429/// EnvoyExtension has configuration for an extension that patches Envoy resources.
1430#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1431pub struct EnvoyExtension {
1432    #[serde(rename = "Name")]
1433    pub name: String,
1434
1435    #[serde(rename = "Required")]
1436    pub required: bool,
1437
1438    #[serde(rename = "ConsulVersion")]
1439    pub consul_version: String,
1440
1441    #[serde(rename = "EnvoyVersion")]
1442    pub envoy_version: String,
1443
1444}
1445
1446/// ServiceDefinition is used to JSON decode the Service definitions. For
1447/// documentation on specific fields see NodeService which is better documented.
1448#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1449pub struct ServiceDefinition {
1450    #[serde(rename = "ID")]
1451    pub id: String,
1452
1453    #[serde(rename = "Name")]
1454    pub name: String,
1455
1456    #[serde(rename = "Tags")]
1457    pub tags: Vec<String>,
1458
1459    #[serde(rename = "Address")]
1460    pub address: String,
1461
1462    #[serde(rename = "TaggedAddresses")]
1463    pub tagged_addresses: ::std::collections::HashMap<String, ServiceAddress>,
1464
1465    #[serde(rename = "Meta")]
1466    pub meta: ::std::collections::HashMap<String, String>,
1467
1468    #[serde(rename = "Port")]
1469    pub port: u16,
1470
1471    #[serde(rename = "Ports")]
1472    pub ports: u16,
1473
1474    #[serde(rename = "SocketPath")]
1475    pub socket_path: String,
1476
1477    #[serde(rename = "Check")]
1478    pub check: CheckType,
1479
1480    #[serde(rename = "Checks")]
1481    pub checks: CheckTypes,
1482
1483    #[serde(rename = "Weights")]
1484    pub weights: Weights,
1485
1486    #[serde(rename = "Token")]
1487    pub token: String,
1488
1489    #[serde(rename = "EnableTagOverride")]
1490    pub enable_tag_override: bool,
1491
1492    #[cfg(feature = "enterprise")]
1493    #[serde(rename = "Locality")]
1494    #[serde(skip_serializing_if = "Option::is_none")]
1495    pub locality: Option<Locality>,
1496
1497    /// Proxy is the configuration set for Kind = connect-proxy. It is mandatory in
1498    /// that case and an error to be set for any other kind. This config is part of
1499    /// a proxy service definition. ProxyConfig may be a more natural name here, but
1500    /// it's confusing for the UX because one of the fields in ConnectProxyConfig is
1501    /// also called just "Config"
1502    #[serde(rename = "Proxy")]
1503    pub proxy: ConnectProxyConfig,
1504
1505    #[serde(rename = "Connect")]
1506    pub connect: Box<ServiceConnect>,
1507
1508}
1509
1510#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1511pub struct WriteRequest {
1512    /// Token is the ACL token ID. If not provided, the 'anonymous'
1513    /// token is assumed for backwards compatibility.
1514    #[serde(rename = "Token")]
1515    #[serde(skip_serializing_if = "Option::is_none")]
1516    pub token: Option<String>,
1517
1518}
1519
1520/// RegisterRequest is used for the Catalog.Register endpoint
1521/// to register a node as providing a service. If no service
1522/// is provided, the node is registered.
1523#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1524pub struct RegisterRequest {
1525    #[serde(rename = "Datacenter")]
1526    pub datacenter: String,
1527
1528    #[serde(rename = "ID")]
1529    pub id: String,
1530
1531    #[serde(rename = "Node")]
1532    pub node: String,
1533
1534    #[serde(rename = "Address")]
1535    pub address: String,
1536
1537    #[serde(rename = "TaggedAddresses")]
1538    #[serde(skip_serializing_if = "Option::is_none")]
1539    pub tagged_addresses: Option<::std::collections::HashMap<String, String>>,
1540
1541    #[serde(rename = "NodeMeta")]
1542    #[serde(skip_serializing_if = "Option::is_none")]
1543    pub node_meta: Option<::std::collections::HashMap<String, String>>,
1544
1545    #[serde(rename = "Service")]
1546    #[serde(skip_serializing_if = "Option::is_none")]
1547    pub service: Option<NodeService>,
1548
1549    #[serde(rename = "Check")]
1550    #[serde(skip_serializing_if = "Option::is_none")]
1551    pub check: Option<HealthCheck>,
1552
1553    #[serde(rename = "Checks")]
1554    #[serde(skip_serializing_if = "Option::is_none")]
1555    pub checks: Option<HealthChecks>,
1556
1557    #[cfg(feature = "enterprise")]
1558    #[serde(rename = "Locality")]
1559    #[serde(skip_serializing_if = "Option::is_none")]
1560    pub locality: Option<Locality>,
1561
1562    /// SkipNodeUpdate can be used when a register request is intended for
1563    /// updating a service and/or checks, but doesn't want to overwrite any
1564    /// node information if the node is already registered. If the node
1565    /// doesn't exist, it will still be created, but if the node exists, any
1566    /// node portion of this update will not apply.
1567    #[serde(rename = "SkipNodeUpdate")]
1568    pub skip_node_update: bool,
1569
1570    /// Token is the ACL token ID. If not provided, the 'anonymous'
1571    /// token is assumed for backwards compatibility.
1572    #[serde(rename = "Token")]
1573    #[serde(skip_serializing_if = "Option::is_none")]
1574    pub token: Option<String>,
1575
1576
1577}
1578
1579/// DeregisterRequest is used for the Catalog.Deregister endpoint to
1580/// deregister a service, check, or node (only one should be provided).
1581/// If ServiceID or CheckID are not provided, the entire node is deregistered.
1582/// If a ServiceID is provided, any associated Checks with that service
1583/// are also deregistered.
1584#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1585pub struct DeregisterRequest {
1586    #[serde(rename = "Datacenter")]
1587    pub datacenter: String,
1588
1589    #[serde(rename = "Node")]
1590    pub node: String,
1591
1592    #[serde(rename = "ServiceID")]
1593    pub service_id: String,
1594
1595    #[serde(rename = "CheckID")]
1596    pub check_id: String,
1597
1598    /// Token is the ACL token ID. If not provided, the 'anonymous'
1599    /// token is assumed for backwards compatibility.
1600    #[serde(rename = "Token")]
1601    #[serde(skip_serializing_if = "Option::is_none")]
1602    pub token: Option<String>,
1603
1604
1605}
1606
1607/// Used to return information about a node
1608#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1609pub struct Node {
1610    #[serde(rename = "ID")]
1611    pub id: String,
1612
1613    #[serde(rename = "Node")]
1614    pub node: String,
1615
1616    #[serde(rename = "Address")]
1617    pub address: String,
1618
1619    #[serde(rename = "Datacenter")]
1620    pub datacenter: String,
1621
1622    #[serde(rename = "Partition")]
1623    #[serde(skip_serializing_if = "Option::is_none")]
1624    pub partition: Option<String>,
1625
1626    #[serde(rename = "TaggedAddresses")]
1627    pub tagged_addresses: ::std::collections::HashMap<String, String>,
1628
1629    #[serde(rename = "Meta")]
1630    pub meta: ::std::collections::HashMap<String, String>,
1631
1632    #[cfg(feature = "enterprise")]
1633    #[serde(rename = "Locality")]
1634    #[serde(skip_serializing_if = "Option::is_none")]
1635    pub locality: Option<Locality>,
1636
1637}
1638
1639/// ServiceNode represents a node that is part of a service. ID, Address,
1640/// TaggedAddresses, and NodeMeta are node-related fields that are always empty
1641/// in the state store and are filled in on the way out by parseServiceNodes().
1642/// This is also why PartialClone() skips them, because we know they are blank
1643/// already so it would be a waste of time to copy them.
1644/// This is somewhat complicated when the address is really a unix domain socket; technically that
1645/// will override the address field, but in practice the two use cases should not overlap.
1646#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1647pub struct ServiceNode {
1648    #[serde(rename = "ID")]
1649    pub id: String,
1650
1651    #[serde(rename = "Node")]
1652    pub node: String,
1653
1654    #[serde(rename = "Address")]
1655    pub address: String,
1656
1657    #[serde(rename = "Datacenter")]
1658    pub datacenter: String,
1659
1660    #[serde(rename = "TaggedAddresses")]
1661    pub tagged_addresses: ::std::collections::HashMap<String, String>,
1662
1663    #[serde(rename = "NodeMeta")]
1664    pub node_meta: ::std::collections::HashMap<String, String>,
1665
1666    #[serde(rename = "ServiceKind")]
1667    pub service_kind: String,
1668
1669    #[serde(rename = "ServiceID")]
1670    pub service_id: String,
1671
1672    #[serde(rename = "ServiceName")]
1673    pub service_name: String,
1674
1675    #[serde(rename = "ServiceTags")]
1676    pub service_tags: Vec<String>,
1677
1678    #[serde(rename = "ServiceAddress")]
1679    pub service_address: String,
1680
1681    #[serde(rename = "ServiceTaggedAddresses")]
1682    #[serde(skip_serializing_if = "Option::is_none")]
1683    pub service_tagged_addresses: Option<::std::collections::HashMap<String, ServiceAddress>>,
1684
1685    #[serde(rename = "ServiceWeights")]
1686    pub service_weights: Weights,
1687
1688    #[serde(rename = "ServiceMeta")]
1689    pub service_meta: ::std::collections::HashMap<String, String>,
1690
1691    #[serde(rename = "ServicePort")]
1692    pub service_port: u16,
1693
1694    #[serde(rename = "ServicePorts")]
1695    pub service_ports: u16,
1696
1697    #[serde(rename = "ServiceSocketPath")]
1698    pub service_socket_path: String,
1699
1700    #[serde(rename = "ServiceEnableTagOverride")]
1701    pub service_enable_tag_override: bool,
1702
1703    #[serde(rename = "ServiceProxy")]
1704    pub service_proxy: ConnectProxyConfig,
1705
1706    #[serde(rename = "ServiceConnect")]
1707    pub service_connect: Box<ServiceConnect>,
1708
1709    #[cfg(feature = "enterprise")]
1710    #[serde(rename = "ServiceLocality")]
1711    #[serde(skip_serializing_if = "Option::is_none")]
1712    pub service_locality: Option<Locality>,
1713
1714}
1715
1716/// Weights represent the weight used by DNS for a given status
1717#[derive(Debug, Clone, Serialize, Deserialize)]
1718pub struct Weights {
1719    #[serde(rename = "Passing")]
1720    pub passing: isize,
1721
1722    #[serde(rename = "Warning")]
1723    pub warning: isize,
1724
1725}
1726
1727/// Specifies weights for the service.
1728/// Default is {"Passing": 1, "Warning": 1}.
1729/// Learn more: https://developer.hashicorp.com/consul/api-docs/agent/service#weights
1730impl Default for Weights {
1731    fn default() -> Self {
1732        Self {
1733            passing: 1,
1734            warning: 1,
1735        }
1736    }
1737}
1738
1739
1740/// Type to hold a address and port of a service
1741#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1742pub struct ServiceAddress {
1743    #[serde(rename = "Address")]
1744    pub address: String,
1745
1746    #[serde(rename = "Port")]
1747    pub port: u16,
1748
1749}
1750
1751/// NodeService is a service provided by a node
1752#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1753pub struct NodeService {
1754    #[serde(rename = "ID")]
1755    pub id: String,
1756
1757    #[serde(rename = "Service")]
1758    pub service: String,
1759
1760    #[serde(rename = "Tags")]
1761    pub tags: Vec<String>,
1762
1763    #[serde(rename = "Address")]
1764    pub address: String,
1765
1766    #[serde(rename = "TaggedAddresses")]
1767    #[serde(skip_serializing_if = "Option::is_none")]
1768    pub tagged_addresses: Option<::std::collections::HashMap<String, ServiceAddress>>,
1769
1770    #[serde(rename = "Meta")]
1771    pub meta: ::std::collections::HashMap<String, String>,
1772
1773    #[serde(rename = "Port")]
1774    #[serde(skip_serializing_if = "Option::is_none")]
1775    pub port: Option<u16>,
1776
1777    #[serde(rename = "Ports")]
1778    #[serde(skip_serializing_if = "Option::is_none")]
1779    pub ports: Option<u16>,
1780
1781    #[serde(rename = "SocketPath")]
1782    #[serde(skip_serializing_if = "Option::is_none")]
1783    pub socket_path: Option<String>,
1784
1785    #[serde(rename = "Weights")]
1786    pub weights: Weights,
1787
1788    #[serde(rename = "EnableTagOverride")]
1789    pub enable_tag_override: bool,
1790
1791    #[cfg(feature = "enterprise")]
1792    #[serde(rename = "Locality")]
1793    #[serde(skip_serializing_if = "Option::is_none")]
1794    pub locality: Option<Locality>,
1795
1796    /// Proxy is the configuration set for Kind = connect-proxy. It is mandatory in
1797    /// that case and an error to be set for any other kind. This config is part of
1798    /// a proxy service definition. ProxyConfig may be a more natural name here, but
1799    /// it's confusing for the UX because one of the fields in ConnectProxyConfig is
1800    /// also called just "Config"
1801    #[serde(rename = "Proxy")]
1802    #[serde(skip_serializing_if = "Option::is_none")]
1803    pub proxy: Option<ConnectProxyConfig>,
1804
1805    /// Connect are the Connect settings for a service. This is purposely NOT
1806    /// a pointer so that we never have to nil-check this.
1807    #[serde(rename = "Connect")]
1808    #[serde(skip_serializing_if = "Option::is_none")]
1809    pub connect: Option<Box<ServiceConnect>>,
1810
1811}
1812
1813/// PeeringServiceMeta is read-only information provided from an exported peer.
1814#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1815pub struct PeeringServiceMeta {
1816    #[serde(rename = "SNI")]
1817    #[serde(skip_serializing_if = "Option::is_none")]
1818    pub sni: Option<Vec<String>>,
1819
1820    #[serde(rename = "SpiffeID")]
1821    #[serde(skip_serializing_if = "Option::is_none")]
1822    pub spiffe_id: Option<Vec<String>>,
1823
1824    #[serde(rename = "Protocol")]
1825    #[serde(skip_serializing_if = "Option::is_none")]
1826    pub protocol: Option<String>,
1827
1828}
1829
1830/// ServiceConnect are the shared Connect settings between all service
1831/// definitions from the agent to the state store.
1832#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1833pub struct ServiceConnect {
1834    /// Native is true when this service can natively understand Connect.
1835    #[serde(rename = "Native")]
1836    #[serde(skip_serializing_if = "Option::is_none")]
1837    pub native: Option<bool>,
1838
1839    /// SidecarService is a nested Service Definition to register at the same time.
1840    /// It's purely a convenience mechanism to allow specifying a sidecar service
1841    /// along with the application service definition. It's nested nature allows
1842    /// all of the fields to be defaulted which can reduce the amount of
1843    /// boilerplate needed to register a sidecar service separately, but the end
1844    /// result is identical to just making a second service registration via any
1845    /// other means.
1846    #[serde(rename = "SidecarService")]
1847    #[serde(skip_serializing_if = "Option::is_none")]
1848    pub sidecar_service: Option<Box<ServiceDefinition>>,
1849
1850    #[serde(rename = "PeerMeta")]
1851    #[serde(skip_serializing_if = "Option::is_none")]
1852    pub peer_meta: Option<PeeringServiceMeta>,
1853
1854}
1855
1856/// NodeServices represents services provided by Node.
1857/// Services is a map of service IDs to services.
1858#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1859pub struct NodeServices {
1860    #[serde(rename = "Node")]
1861    pub node: Node,
1862
1863    #[serde(rename = "Services")]
1864    pub services: ::std::collections::HashMap<String, NodeService>,
1865
1866}
1867
1868#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1869pub struct HealthCheckDefinition {
1870    #[serde(rename = "HTTP")]
1871    #[serde(skip_serializing_if = "Option::is_none")]
1872    pub http: Option<String>,
1873
1874    #[serde(rename = "TLSServerName")]
1875    #[serde(skip_serializing_if = "Option::is_none")]
1876    pub tls_server_name: Option<String>,
1877
1878    #[serde(rename = "TLSSkipVerify")]
1879    #[serde(skip_serializing_if = "Option::is_none")]
1880    pub tls_skip_verify: Option<bool>,
1881
1882    #[serde(rename = "Header")]
1883    #[serde(skip_serializing_if = "Option::is_none")]
1884    pub header: Option<::std::collections::HashMap<String, Vec<String>>>,
1885
1886    #[serde(rename = "Method")]
1887    #[serde(skip_serializing_if = "Option::is_none")]
1888    pub method: Option<String>,
1889
1890    #[serde(rename = "Body")]
1891    #[serde(skip_serializing_if = "Option::is_none")]
1892    pub body: Option<String>,
1893
1894    #[serde(rename = "DisableRedirects")]
1895    #[serde(skip_serializing_if = "Option::is_none")]
1896    pub disable_redirects: Option<bool>,
1897
1898    #[serde(rename = "TCP")]
1899    #[serde(skip_serializing_if = "Option::is_none")]
1900    pub tcp: Option<String>,
1901
1902    #[serde(rename = "TCPUseTLS")]
1903    #[serde(skip_serializing_if = "Option::is_none")]
1904    pub tcp_use_tls: Option<bool>,
1905
1906    #[serde(rename = "UDP")]
1907    #[serde(skip_serializing_if = "Option::is_none")]
1908    pub udp: Option<String>,
1909
1910    #[serde(rename = "H2PING")]
1911    #[serde(skip_serializing_if = "Option::is_none")]
1912    pub h2_ping: Option<String>,
1913
1914    #[serde(rename = "OSService")]
1915    #[serde(skip_serializing_if = "Option::is_none")]
1916    pub os_service: Option<String>,
1917
1918    #[serde(rename = "H2PingUseTLS")]
1919    #[serde(skip_serializing_if = "Option::is_none")]
1920    pub h2_ping_use_tls: Option<bool>,
1921
1922    #[serde(rename = "Interval")]
1923    #[serde(skip_serializing_if = "Option::is_none")]
1924    pub interval: Option<String>,
1925
1926    #[serde(rename = "OutputMaxSize")]
1927    #[serde(skip_serializing_if = "Option::is_none")]
1928    pub output_max_size: Option<usize>,
1929
1930    #[serde(rename = "Timeout")]
1931    #[serde(skip_serializing_if = "Option::is_none")]
1932    pub timeout: Option<String>,
1933
1934    #[serde(rename = "DeregisterCriticalServiceAfter")]
1935    #[serde(skip_serializing_if = "Option::is_none")]
1936    pub deregister_critical_service_after: Option<String>,
1937
1938    #[serde(rename = "ScriptArgs")]
1939    #[serde(skip_serializing_if = "Option::is_none")]
1940    pub script_args: Option<Vec<String>>,
1941
1942    #[serde(rename = "DockerContainerID")]
1943    #[serde(skip_serializing_if = "Option::is_none")]
1944    pub docker_container_id: Option<String>,
1945
1946    #[serde(rename = "Shell")]
1947    #[serde(skip_serializing_if = "Option::is_none")]
1948    pub shell: Option<String>,
1949
1950    #[serde(rename = "GRPC")]
1951    #[serde(skip_serializing_if = "Option::is_none")]
1952    pub grpc: Option<String>,
1953
1954    #[serde(rename = "GRPCUseTLS")]
1955    #[serde(skip_serializing_if = "Option::is_none")]
1956    pub grpc_use_tls: Option<bool>,
1957
1958    #[serde(rename = "AliasNode")]
1959    #[serde(skip_serializing_if = "Option::is_none")]
1960    pub alias_node: Option<String>,
1961
1962    #[serde(rename = "AliasService")]
1963    #[serde(skip_serializing_if = "Option::is_none")]
1964    pub alias_service: Option<String>,
1965
1966    #[serde(rename = "SessionName")]
1967    #[serde(skip_serializing_if = "Option::is_none")]
1968    pub session_name: Option<String>,
1969
1970    #[serde(rename = "TTL")]
1971    #[serde(skip_serializing_if = "Option::is_none")]
1972    pub ttl: Option<String>,
1973
1974}
1975
1976/// CheckServiceNode is used to provide the node, its service
1977/// definition, as well as a HealthCheck that is associated.
1978#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1979pub struct CheckServiceNode {
1980    #[serde(rename = "Node")]
1981    pub node: Node,
1982
1983    #[serde(rename = "Service")]
1984    pub service: NodeService,
1985
1986    #[serde(rename = "Checks")]
1987    pub checks: HealthChecks,
1988
1989}
1990
1991#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1992pub struct ServiceName {
1993    #[serde(rename = "Name")]
1994    pub name: String,
1995
1996}
1997
1998/// Locality identifies where a given entity is running.
1999#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2000pub struct Locality {
2001    /// Region is region the zone belongs to.
2002    #[serde(rename = "Region")]
2003    #[serde(skip_serializing_if = "Option::is_none")]
2004    pub region: Option<String>,
2005
2006    /// Zone is the zone the entity is running in.
2007    #[serde(rename = "Zone")]
2008    #[serde(skip_serializing_if = "Option::is_none")]
2009    pub zone: Option<String>,
2010
2011}
2012