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