bollard_stubs/
models.rs

1#![allow(unused_imports, unused_qualifications, unused_extern_crates)]
2
3use serde::{Deserialize, Serialize};
4use serde::ser::Serializer;
5use serde::de::{DeserializeOwned, Deserializer};
6
7use std::cmp::Eq;
8use std::collections::HashMap;
9use std::default::Default;
10use std::hash::Hash;
11
12use chrono::DateTime;
13use chrono::Utc;
14
15fn deserialize_nonoptional_vec<'de, D: Deserializer<'de>, T: DeserializeOwned>(
16    d: D,
17) -> Result<Vec<T>, D::Error> {
18    serde::Deserialize::deserialize(d).map(|x: Option<_>| x.unwrap_or(Vec::new()))
19}
20
21fn deserialize_nonoptional_map<'de, D: Deserializer<'de>, T: DeserializeOwned>(
22    d: D,
23) -> Result<HashMap<String, T>, D::Error> {
24    serde::Deserialize::deserialize(d).map(|x: Option<_>| x.unwrap_or(HashMap::new()))
25}
26
27
28/// Address represents an IPv4 or IPv6 IP address.
29#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
30pub struct Address {
31    /// IP address.
32    #[serde(rename = "Addr")]
33    #[serde(skip_serializing_if="Option::is_none")]
34    pub addr: Option<String>,
35
36    /// Mask length of the IP address.
37    #[serde(rename = "PrefixLen")]
38    #[serde(skip_serializing_if="Option::is_none")]
39    pub prefix_len: Option<i64>,
40
41}
42
43#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
44pub struct AuthConfig {
45    #[serde(rename = "username")]
46    #[serde(skip_serializing_if="Option::is_none")]
47    pub username: Option<String>,
48
49    #[serde(rename = "password")]
50    #[serde(skip_serializing_if="Option::is_none")]
51    pub password: Option<String>,
52
53    #[serde(rename = "email")]
54    #[serde(skip_serializing_if="Option::is_none")]
55    pub email: Option<String>,
56
57    #[serde(rename = "serveraddress")]
58    #[serde(skip_serializing_if="Option::is_none")]
59    pub serveraddress: Option<String>,
60
61}
62
63/// Describes a permission accepted by the user upon installing the plugin. 
64#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
65pub struct Body {
66    #[serde(rename = "Name")]
67    #[serde(skip_serializing_if="Option::is_none")]
68    pub name: Option<String>,
69
70    #[serde(rename = "Description")]
71    #[serde(skip_serializing_if="Option::is_none")]
72    pub description: Option<String>,
73
74    #[serde(rename = "Value")]
75    #[serde(skip_serializing_if="Option::is_none")]
76    pub value: Option<Vec<String>>,
77
78}
79
80#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
81pub struct Body1 {
82    /// Listen address used for inter-manager communication, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP). This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the default swarm listening port is used. 
83    #[serde(rename = "ListenAddr")]
84    #[serde(skip_serializing_if="Option::is_none")]
85    pub listen_addr: Option<String>,
86
87    /// Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible. 
88    #[serde(rename = "AdvertiseAddr")]
89    #[serde(skip_serializing_if="Option::is_none")]
90    pub advertise_addr: Option<String>,
91
92    /// Address or interface to use for data path traffic (format: `<ip|interface>`), for example,  `192.168.1.1`, or an interface, like `eth0`. If `DataPathAddr` is unspecified, the same address as `AdvertiseAddr` is used.  The `DataPathAddr` specifies the address that global scope network drivers will publish towards other  nodes in order to reach the containers running on this node. Using this parameter it is possible to separate the container data traffic from the management traffic of the cluster. 
93    #[serde(rename = "DataPathAddr")]
94    #[serde(skip_serializing_if="Option::is_none")]
95    pub data_path_addr: Option<String>,
96
97    /// DataPathPort specifies the data path port number for data traffic. Acceptable port range is 1024 to 49151. if no port is set or is set to 0, default port 4789 will be used. 
98    #[serde(rename = "DataPathPort")]
99    #[serde(skip_serializing_if="Option::is_none")]
100    pub data_path_port: Option<u32>,
101
102    /// Default Address Pool specifies default subnet pools for global scope networks. 
103    #[serde(rename = "DefaultAddrPool")]
104    #[serde(skip_serializing_if="Option::is_none")]
105    pub default_addr_pool: Option<Vec<String>>,
106
107    /// Force creation of a new swarm.
108    #[serde(rename = "ForceNewCluster")]
109    #[serde(skip_serializing_if="Option::is_none")]
110    pub force_new_cluster: Option<bool>,
111
112    /// SubnetSize specifies the subnet size of the networks created from the default subnet pool. 
113    #[serde(rename = "SubnetSize")]
114    #[serde(skip_serializing_if="Option::is_none")]
115    pub subnet_size: Option<u32>,
116
117    #[serde(rename = "Spec")]
118    #[serde(skip_serializing_if="Option::is_none")]
119    pub spec: Option<SwarmSpec>,
120
121}
122
123#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
124pub struct Body2 {
125    /// Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP). 
126    #[serde(rename = "ListenAddr")]
127    #[serde(skip_serializing_if="Option::is_none")]
128    pub listen_addr: Option<String>,
129
130    /// Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible. 
131    #[serde(rename = "AdvertiseAddr")]
132    #[serde(skip_serializing_if="Option::is_none")]
133    pub advertise_addr: Option<String>,
134
135    /// Address or interface to use for data path traffic (format: `<ip|interface>`), for example,  `192.168.1.1`, or an interface, like `eth0`. If `DataPathAddr` is unspecified, the same addres as `AdvertiseAddr` is used.  The `DataPathAddr` specifies the address that global scope network drivers will publish towards other nodes in order to reach the containers running on this node. Using this parameter it is possible to separate the container data traffic from the management traffic of the cluster. 
136    #[serde(rename = "DataPathAddr")]
137    #[serde(skip_serializing_if="Option::is_none")]
138    pub data_path_addr: Option<String>,
139
140    /// Addresses of manager nodes already participating in the swarm. 
141    #[serde(rename = "RemoteAddrs")]
142    #[serde(skip_serializing_if="Option::is_none")]
143    pub remote_addrs: Option<Vec<String>>,
144
145    /// Secret token for joining this swarm.
146    #[serde(rename = "JoinToken")]
147    #[serde(skip_serializing_if="Option::is_none")]
148    pub join_token: Option<String>,
149
150}
151
152#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
153pub struct Body3 {
154    /// The swarm's unlock key.
155    #[serde(rename = "UnlockKey")]
156    #[serde(skip_serializing_if="Option::is_none")]
157    pub unlock_key: Option<String>,
158
159}
160
161#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
162pub struct BuildCache {
163    #[serde(rename = "ID")]
164    #[serde(skip_serializing_if="Option::is_none")]
165    pub id: Option<String>,
166
167    #[serde(rename = "Parent")]
168    #[serde(skip_serializing_if="Option::is_none")]
169    pub parent: Option<String>,
170
171    #[serde(rename = "Type")]
172    #[serde(skip_serializing_if="Option::is_none")]
173    pub typ: Option<String>,
174
175    #[serde(rename = "Description")]
176    #[serde(skip_serializing_if="Option::is_none")]
177    pub description: Option<String>,
178
179    #[serde(rename = "InUse")]
180    #[serde(skip_serializing_if="Option::is_none")]
181    pub in_use: Option<bool>,
182
183    #[serde(rename = "Shared")]
184    #[serde(skip_serializing_if="Option::is_none")]
185    pub shared: Option<bool>,
186
187    /// Amount of disk space used by the build cache (in bytes). 
188    #[serde(rename = "Size")]
189    #[serde(skip_serializing_if="Option::is_none")]
190    pub size: Option<i64>,
191
192    /// Date and time at which the build cache was created in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
193    #[serde(rename = "CreatedAt")]
194    #[serde(skip_serializing_if="Option::is_none")]
195    pub created_at: Option<DateTime<Utc>>,
196
197    /// Date and time at which the build cache was last used in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
198    #[serde(rename = "LastUsedAt")]
199    #[serde(skip_serializing_if="Option::is_none")]
200    pub last_used_at: Option<DateTime<Utc>>,
201
202    #[serde(rename = "UsageCount")]
203    #[serde(skip_serializing_if="Option::is_none")]
204    pub usage_count: Option<i64>,
205
206}
207
208#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
209pub struct BuildInfo {
210    #[serde(rename = "id")]
211    #[serde(skip_serializing_if="Option::is_none")]
212    pub id: Option<String>,
213
214    #[serde(rename = "stream")]
215    #[serde(skip_serializing_if="Option::is_none")]
216    pub stream: Option<String>,
217
218    #[serde(rename = "error")]
219    #[serde(skip_serializing_if="Option::is_none")]
220    pub error: Option<String>,
221
222    #[serde(rename = "errorDetail")]
223    #[serde(skip_serializing_if="Option::is_none")]
224    pub error_detail: Option<ErrorDetail>,
225
226    #[serde(rename = "status")]
227    #[serde(skip_serializing_if="Option::is_none")]
228    pub status: Option<String>,
229
230    #[serde(rename = "progress")]
231    #[serde(skip_serializing_if="Option::is_none")]
232    pub progress: Option<String>,
233
234    #[serde(rename = "progressDetail")]
235    #[serde(skip_serializing_if="Option::is_none")]
236    pub progress_detail: Option<ProgressDetail>,
237
238    #[serde(rename = "aux")]
239    #[serde(skip_serializing_if="Option::is_none")]
240    pub aux: Option<ImageId>,
241
242}
243
244#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
245pub struct BuildPruneResponse {
246    #[serde(rename = "CachesDeleted")]
247    #[serde(skip_serializing_if="Option::is_none")]
248    pub caches_deleted: Option<Vec<String>>,
249
250    /// Disk space reclaimed in bytes
251    #[serde(rename = "SpaceReclaimed")]
252    #[serde(skip_serializing_if="Option::is_none")]
253    pub space_reclaimed: Option<i64>,
254
255}
256
257/// ClusterInfo represents information about the swarm as is returned by the \"/info\" endpoint. Join-tokens are not included. 
258#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
259pub struct ClusterInfo {
260    /// The ID of the swarm.
261    #[serde(rename = "ID")]
262    #[serde(skip_serializing_if="Option::is_none")]
263    pub id: Option<String>,
264
265    #[serde(rename = "Version")]
266    #[serde(skip_serializing_if="Option::is_none")]
267    pub version: Option<ObjectVersion>,
268
269    /// Date and time at which the swarm was initialised in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
270    #[serde(rename = "CreatedAt")]
271    #[serde(skip_serializing_if="Option::is_none")]
272    pub created_at: Option<DateTime<Utc>>,
273
274    /// Date and time at which the swarm was last updated in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
275    #[serde(rename = "UpdatedAt")]
276    #[serde(skip_serializing_if="Option::is_none")]
277    pub updated_at: Option<DateTime<Utc>>,
278
279    #[serde(rename = "Spec")]
280    #[serde(skip_serializing_if="Option::is_none")]
281    pub spec: Option<SwarmSpec>,
282
283    #[serde(rename = "TLSInfo")]
284    #[serde(skip_serializing_if="Option::is_none")]
285    pub tls_info: Option<TlsInfo>,
286
287    /// Whether there is currently a root CA rotation in progress for the swarm 
288    #[serde(rename = "RootRotationInProgress")]
289    #[serde(skip_serializing_if="Option::is_none")]
290    pub root_rotation_in_progress: Option<bool>,
291
292    /// DataPathPort specifies the data path port number for data traffic. Acceptable port range is 1024 to 49151. If no port is set or is set to 0, the default port (4789) is used. 
293    #[serde(rename = "DataPathPort")]
294    #[serde(skip_serializing_if="Option::is_none")]
295    pub data_path_port: Option<u32>,
296
297    /// Default Address Pool specifies default subnet pools for global scope networks. 
298    #[serde(rename = "DefaultAddrPool")]
299    #[serde(skip_serializing_if="Option::is_none")]
300    pub default_addr_pool: Option<Vec<String>>,
301
302    /// SubnetSize specifies the subnet size of the networks created from the default subnet pool. 
303    #[serde(rename = "SubnetSize")]
304    #[serde(skip_serializing_if="Option::is_none")]
305    pub subnet_size: Option<u32>,
306
307}
308
309/// Commit holds the Git-commit (SHA1) that a binary was built from, as reported in the version-string of external tools, such as `containerd`, or `runC`. 
310#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
311pub struct Commit {
312    /// Actual commit ID of external tool.
313    #[serde(rename = "ID")]
314    #[serde(skip_serializing_if="Option::is_none")]
315    pub id: Option<String>,
316
317    /// Commit ID of external tool expected by dockerd as set at build time. 
318    #[serde(rename = "Expected")]
319    #[serde(skip_serializing_if="Option::is_none")]
320    pub expected: Option<String>,
321
322}
323
324#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
325pub struct Config {
326    #[serde(rename = "ID")]
327    #[serde(skip_serializing_if="Option::is_none")]
328    pub id: Option<String>,
329
330    #[serde(rename = "Version")]
331    #[serde(skip_serializing_if="Option::is_none")]
332    pub version: Option<ObjectVersion>,
333
334    #[serde(rename = "CreatedAt")]
335    #[serde(skip_serializing_if="Option::is_none")]
336    pub created_at: Option<DateTime<Utc>>,
337
338    #[serde(rename = "UpdatedAt")]
339    #[serde(skip_serializing_if="Option::is_none")]
340    pub updated_at: Option<DateTime<Utc>>,
341
342    #[serde(rename = "Spec")]
343    #[serde(skip_serializing_if="Option::is_none")]
344    pub spec: Option<ConfigSpec>,
345
346}
347
348#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
349pub struct ConfigSpec {
350    /// User-defined name of the config.
351    #[serde(rename = "Name")]
352    #[serde(skip_serializing_if="Option::is_none")]
353    pub name: Option<String>,
354
355    /// User-defined key/value metadata.
356    #[serde(rename = "Labels")]
357    #[serde(skip_serializing_if="Option::is_none")]
358    pub labels: Option<HashMap<String, String>>,
359
360    /// Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) config data. 
361    #[serde(rename = "Data")]
362    #[serde(skip_serializing_if="Option::is_none")]
363    pub data: Option<String>,
364
365    /// Templating driver, if applicable  Templating controls whether and how to evaluate the config payload as a template. If no driver is set, no templating is used. 
366    #[serde(rename = "Templating")]
367    #[serde(skip_serializing_if="Option::is_none")]
368    pub templating: Option<Driver>,
369
370}
371
372#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
373pub struct Container {
374    /// The ID or name of the container to connect to the network.
375    #[serde(rename = "Container")]
376    #[serde(skip_serializing_if="Option::is_none")]
377    pub container: Option<String>,
378
379    #[serde(rename = "EndpointConfig")]
380    #[serde(skip_serializing_if="Option::is_none")]
381    pub endpoint_config: Option<EndpointSettings>,
382
383}
384
385#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
386pub struct Container1 {
387    /// The ID or name of the container to disconnect from the network. 
388    #[serde(rename = "Container")]
389    #[serde(skip_serializing_if="Option::is_none")]
390    pub container: Option<String>,
391
392    /// Force the container to disconnect from the network. 
393    #[serde(rename = "Force")]
394    #[serde(skip_serializing_if="Option::is_none")]
395    pub force: Option<bool>,
396
397}
398
399/// change item in response to ContainerChanges operation
400#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
401pub struct ContainerChangeResponseItem {
402    /// Path to file that has changed
403    #[serde(rename = "Path")]
404    pub path: String,
405
406    /// Kind of change
407    #[serde(rename = "Kind")]
408    pub kind: i64,
409
410}
411
412/// Configuration for a container that is portable between hosts
413#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
414pub struct ContainerConfig {
415    /// The hostname to use for the container, as a valid RFC 1123 hostname.
416    #[serde(rename = "Hostname")]
417    #[serde(skip_serializing_if="Option::is_none")]
418    pub hostname: Option<String>,
419
420    /// The domain name to use for the container.
421    #[serde(rename = "Domainname")]
422    #[serde(skip_serializing_if="Option::is_none")]
423    pub domainname: Option<String>,
424
425    /// The user that commands are run as inside the container.
426    #[serde(rename = "User")]
427    #[serde(skip_serializing_if="Option::is_none")]
428    pub user: Option<String>,
429
430    /// Whether to attach to `stdin`.
431    #[serde(rename = "AttachStdin")]
432    #[serde(skip_serializing_if="Option::is_none")]
433    pub attach_stdin: Option<bool>,
434
435    /// Whether to attach to `stdout`.
436    #[serde(rename = "AttachStdout")]
437    #[serde(skip_serializing_if="Option::is_none")]
438    pub attach_stdout: Option<bool>,
439
440    /// Whether to attach to `stderr`.
441    #[serde(rename = "AttachStderr")]
442    #[serde(skip_serializing_if="Option::is_none")]
443    pub attach_stderr: Option<bool>,
444
445    /// An object mapping ports to an empty object in the form:  `{\"<port>/<tcp|udp|sctp>\": {}}` 
446    #[serde(rename = "ExposedPorts")]
447    #[serde(skip_serializing_if="Option::is_none")]
448    pub exposed_ports: Option<HashMap<String, HashMap<(), ()>>>,
449
450    /// Attach standard streams to a TTY, including `stdin` if it is not closed. 
451    #[serde(rename = "Tty")]
452    #[serde(skip_serializing_if="Option::is_none")]
453    pub tty: Option<bool>,
454
455    /// Open `stdin`
456    #[serde(rename = "OpenStdin")]
457    #[serde(skip_serializing_if="Option::is_none")]
458    pub open_stdin: Option<bool>,
459
460    /// Close `stdin` after one attached client disconnects
461    #[serde(rename = "StdinOnce")]
462    #[serde(skip_serializing_if="Option::is_none")]
463    pub stdin_once: Option<bool>,
464
465    /// A list of environment variables to set inside the container in the form `[\"VAR=value\", ...]`. A variable without `=` is removed from the environment, rather than to have an empty value. 
466    #[serde(rename = "Env")]
467    #[serde(skip_serializing_if="Option::is_none")]
468    pub env: Option<Vec<String>>,
469
470    /// Command to run specified as a string or an array of strings. 
471    #[serde(rename = "Cmd")]
472    #[serde(skip_serializing_if="Option::is_none")]
473    pub cmd: Option<Vec<String>>,
474
475    #[serde(rename = "Healthcheck")]
476    #[serde(skip_serializing_if="Option::is_none")]
477    pub healthcheck: Option<HealthConfig>,
478
479    /// Command is already escaped (Windows only)
480    #[serde(rename = "ArgsEscaped")]
481    #[serde(skip_serializing_if="Option::is_none")]
482    pub args_escaped: Option<bool>,
483
484    /// The name of the image to use when creating the container/ 
485    #[serde(rename = "Image")]
486    #[serde(skip_serializing_if="Option::is_none")]
487    pub image: Option<String>,
488
489    /// An object mapping mount point paths inside the container to empty objects. 
490    #[serde(rename = "Volumes")]
491    #[serde(skip_serializing_if="Option::is_none")]
492    pub volumes: Option<HashMap<String, HashMap<(), ()>>>,
493
494    /// The working directory for commands to run in.
495    #[serde(rename = "WorkingDir")]
496    #[serde(skip_serializing_if="Option::is_none")]
497    pub working_dir: Option<String>,
498
499    /// The entry point for the container as a string or an array of strings.  If the array consists of exactly one empty string (`[\"\"]`) then the entry point is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). 
500    #[serde(rename = "Entrypoint")]
501    #[serde(skip_serializing_if="Option::is_none")]
502    pub entrypoint: Option<Vec<String>>,
503
504    /// Disable networking for the container.
505    #[serde(rename = "NetworkDisabled")]
506    #[serde(skip_serializing_if="Option::is_none")]
507    pub network_disabled: Option<bool>,
508
509    /// MAC address of the container.
510    #[serde(rename = "MacAddress")]
511    #[serde(skip_serializing_if="Option::is_none")]
512    pub mac_address: Option<String>,
513
514    /// `ONBUILD` metadata that were defined in the image's `Dockerfile`. 
515    #[serde(rename = "OnBuild")]
516    #[serde(skip_serializing_if="Option::is_none")]
517    pub on_build: Option<Vec<String>>,
518
519    /// User-defined key/value metadata.
520    #[serde(rename = "Labels")]
521    #[serde(skip_serializing_if="Option::is_none")]
522    pub labels: Option<HashMap<String, String>>,
523
524    /// Signal to stop a container as a string or unsigned integer. 
525    #[serde(rename = "StopSignal")]
526    #[serde(skip_serializing_if="Option::is_none")]
527    pub stop_signal: Option<String>,
528
529    /// Timeout to stop a container in seconds.
530    #[serde(rename = "StopTimeout")]
531    #[serde(skip_serializing_if="Option::is_none")]
532    pub stop_timeout: Option<i64>,
533
534    /// Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. 
535    #[serde(rename = "Shell")]
536    #[serde(skip_serializing_if="Option::is_none")]
537    pub shell: Option<Vec<String>>,
538
539}
540
541/// OK response to ContainerCreate operation
542#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
543pub struct ContainerCreateResponse {
544    /// The ID of the created container
545    #[serde(rename = "Id")]
546    pub id: String,
547
548    /// Warnings encountered when creating the container
549    #[serde(rename = "Warnings")]
550    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
551    pub warnings: Vec<String>,
552
553}
554
555#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
556pub struct ContainerInspectResponse {
557    /// The ID of the container
558    #[serde(rename = "Id")]
559    #[serde(skip_serializing_if="Option::is_none")]
560    pub id: Option<String>,
561
562    /// The time the container was created
563    #[serde(rename = "Created")]
564    #[serde(skip_serializing_if="Option::is_none")]
565    pub created: Option<String>,
566
567    /// The path to the command being run
568    #[serde(rename = "Path")]
569    #[serde(skip_serializing_if="Option::is_none")]
570    pub path: Option<String>,
571
572    /// The arguments to the command being run
573    #[serde(rename = "Args")]
574    #[serde(skip_serializing_if="Option::is_none")]
575    pub args: Option<Vec<String>>,
576
577    #[serde(rename = "State")]
578    #[serde(skip_serializing_if="Option::is_none")]
579    pub state: Option<ContainerState>,
580
581    /// The container's image ID
582    #[serde(rename = "Image")]
583    #[serde(skip_serializing_if="Option::is_none")]
584    pub image: Option<String>,
585
586    #[serde(rename = "ResolvConfPath")]
587    #[serde(skip_serializing_if="Option::is_none")]
588    pub resolv_conf_path: Option<String>,
589
590    #[serde(rename = "HostnamePath")]
591    #[serde(skip_serializing_if="Option::is_none")]
592    pub hostname_path: Option<String>,
593
594    #[serde(rename = "HostsPath")]
595    #[serde(skip_serializing_if="Option::is_none")]
596    pub hosts_path: Option<String>,
597
598    #[serde(rename = "LogPath")]
599    #[serde(skip_serializing_if="Option::is_none")]
600    pub log_path: Option<String>,
601
602    #[serde(rename = "Name")]
603    #[serde(skip_serializing_if="Option::is_none")]
604    pub name: Option<String>,
605
606    #[serde(rename = "RestartCount")]
607    #[serde(skip_serializing_if="Option::is_none")]
608    pub restart_count: Option<i64>,
609
610    #[serde(rename = "Driver")]
611    #[serde(skip_serializing_if="Option::is_none")]
612    pub driver: Option<String>,
613
614    #[serde(rename = "Platform")]
615    #[serde(skip_serializing_if="Option::is_none")]
616    pub platform: Option<String>,
617
618    #[serde(rename = "MountLabel")]
619    #[serde(skip_serializing_if="Option::is_none")]
620    pub mount_label: Option<String>,
621
622    #[serde(rename = "ProcessLabel")]
623    #[serde(skip_serializing_if="Option::is_none")]
624    pub process_label: Option<String>,
625
626    #[serde(rename = "AppArmorProfile")]
627    #[serde(skip_serializing_if="Option::is_none")]
628    pub app_armor_profile: Option<String>,
629
630    /// IDs of exec instances that are running in the container.
631    #[serde(rename = "ExecIDs")]
632    #[serde(skip_serializing_if="Option::is_none")]
633    pub exec_ids: Option<Vec<String>>,
634
635    #[serde(rename = "HostConfig")]
636    #[serde(skip_serializing_if="Option::is_none")]
637    pub host_config: Option<HostConfig>,
638
639    #[serde(rename = "GraphDriver")]
640    #[serde(skip_serializing_if="Option::is_none")]
641    pub graph_driver: Option<GraphDriverData>,
642
643    /// The size of files that have been created or changed by this container. 
644    #[serde(rename = "SizeRw")]
645    #[serde(skip_serializing_if="Option::is_none")]
646    pub size_rw: Option<i64>,
647
648    /// The total size of all the files in this container.
649    #[serde(rename = "SizeRootFs")]
650    #[serde(skip_serializing_if="Option::is_none")]
651    pub size_root_fs: Option<i64>,
652
653    #[serde(rename = "Mounts")]
654    #[serde(skip_serializing_if="Option::is_none")]
655    pub mounts: Option<Vec<MountPoint>>,
656
657    #[serde(rename = "Config")]
658    #[serde(skip_serializing_if="Option::is_none")]
659    pub config: Option<ContainerConfig>,
660
661    #[serde(rename = "NetworkSettings")]
662    #[serde(skip_serializing_if="Option::is_none")]
663    pub network_settings: Option<NetworkSettings>,
664
665}
666
667#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
668pub struct ContainerPruneResponse {
669    /// Container IDs that were deleted
670    #[serde(rename = "ContainersDeleted")]
671    #[serde(skip_serializing_if="Option::is_none")]
672    pub containers_deleted: Option<Vec<String>>,
673
674    /// Disk space reclaimed in bytes
675    #[serde(rename = "SpaceReclaimed")]
676    #[serde(skip_serializing_if="Option::is_none")]
677    pub space_reclaimed: Option<i64>,
678
679}
680
681/// ContainerState stores container's running state. It's part of ContainerJSONBase and will be returned by the \"inspect\" command. 
682#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
683pub struct ContainerState {
684    /// String representation of the container state. Can be one of \"created\", \"running\", \"paused\", \"restarting\", \"removing\", \"exited\", or \"dead\". 
685    #[serde(rename = "Status")]
686    #[serde(skip_serializing_if="Option::is_none")]
687    pub status: Option<ContainerStateStatusEnum>,
688
689    /// Whether this container is running.  Note that a running container can be _paused_. The `Running` and `Paused` booleans are not mutually exclusive:  When pausing a container (on Linux), the freezer cgroup is used to suspend all processes in the container. Freezing the process requires the process to be running. As a result, paused containers are both `Running` _and_ `Paused`.  Use the `Status` field instead to determine if a container's state is \"running\". 
690    #[serde(rename = "Running")]
691    #[serde(skip_serializing_if="Option::is_none")]
692    pub running: Option<bool>,
693
694    /// Whether this container is paused.
695    #[serde(rename = "Paused")]
696    #[serde(skip_serializing_if="Option::is_none")]
697    pub paused: Option<bool>,
698
699    /// Whether this container is restarting.
700    #[serde(rename = "Restarting")]
701    #[serde(skip_serializing_if="Option::is_none")]
702    pub restarting: Option<bool>,
703
704    /// Whether this container has been killed because it ran out of memory. 
705    #[serde(rename = "OOMKilled")]
706    #[serde(skip_serializing_if="Option::is_none")]
707    pub oom_killed: Option<bool>,
708
709    #[serde(rename = "Dead")]
710    #[serde(skip_serializing_if="Option::is_none")]
711    pub dead: Option<bool>,
712
713    /// The process ID of this container
714    #[serde(rename = "Pid")]
715    #[serde(skip_serializing_if="Option::is_none")]
716    pub pid: Option<i64>,
717
718    /// The last exit code of this container
719    #[serde(rename = "ExitCode")]
720    #[serde(skip_serializing_if="Option::is_none")]
721    pub exit_code: Option<i64>,
722
723    #[serde(rename = "Error")]
724    #[serde(skip_serializing_if="Option::is_none")]
725    pub error: Option<String>,
726
727    /// The time when this container was last started.
728    #[serde(rename = "StartedAt")]
729    #[serde(skip_serializing_if="Option::is_none")]
730    pub started_at: Option<String>,
731
732    /// The time when this container last exited.
733    #[serde(rename = "FinishedAt")]
734    #[serde(skip_serializing_if="Option::is_none")]
735    pub finished_at: Option<String>,
736
737    #[serde(rename = "Health")]
738    #[serde(skip_serializing_if="Option::is_none")]
739    pub health: Option<Health>,
740
741}
742
743#[allow(non_camel_case_types)]
744#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
745pub enum ContainerStateStatusEnum { 
746    #[serde(rename = "")]
747    EMPTY,
748    #[serde(rename = "created")]
749    CREATED,
750    #[serde(rename = "running")]
751    RUNNING,
752    #[serde(rename = "paused")]
753    PAUSED,
754    #[serde(rename = "restarting")]
755    RESTARTING,
756    #[serde(rename = "removing")]
757    REMOVING,
758    #[serde(rename = "exited")]
759    EXITED,
760    #[serde(rename = "dead")]
761    DEAD,
762}
763
764impl ::std::fmt::Display for ContainerStateStatusEnum {
765    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
766        match *self { 
767            ContainerStateStatusEnum::EMPTY => write!(f, ""),
768            ContainerStateStatusEnum::CREATED => write!(f, "{}", "created"),
769            ContainerStateStatusEnum::RUNNING => write!(f, "{}", "running"),
770            ContainerStateStatusEnum::PAUSED => write!(f, "{}", "paused"),
771            ContainerStateStatusEnum::RESTARTING => write!(f, "{}", "restarting"),
772            ContainerStateStatusEnum::REMOVING => write!(f, "{}", "removing"),
773            ContainerStateStatusEnum::EXITED => write!(f, "{}", "exited"),
774            ContainerStateStatusEnum::DEAD => write!(f, "{}", "dead"),
775
776        }
777    }
778}
779
780impl ::std::str::FromStr for ContainerStateStatusEnum {
781    type Err = String;
782    fn from_str(s: &str) -> Result<Self, Self::Err> {
783        match s { 
784            "" => Ok(ContainerStateStatusEnum::EMPTY),
785            "created" => Ok(ContainerStateStatusEnum::CREATED),
786            "running" => Ok(ContainerStateStatusEnum::RUNNING),
787            "paused" => Ok(ContainerStateStatusEnum::PAUSED),
788            "restarting" => Ok(ContainerStateStatusEnum::RESTARTING),
789            "removing" => Ok(ContainerStateStatusEnum::REMOVING),
790            "exited" => Ok(ContainerStateStatusEnum::EXITED),
791            "dead" => Ok(ContainerStateStatusEnum::DEAD),
792            x => Err(format!("Invalid enum type: {}", x)),
793        }
794    }
795}
796
797impl ::std::convert::AsRef<str> for ContainerStateStatusEnum {
798    fn as_ref(&self) -> &str {
799        match self { 
800            ContainerStateStatusEnum::EMPTY => "",
801            ContainerStateStatusEnum::CREATED => "created",
802            ContainerStateStatusEnum::RUNNING => "running",
803            ContainerStateStatusEnum::PAUSED => "paused",
804            ContainerStateStatusEnum::RESTARTING => "restarting",
805            ContainerStateStatusEnum::REMOVING => "removing",
806            ContainerStateStatusEnum::EXITED => "exited",
807            ContainerStateStatusEnum::DEAD => "dead",
808        }
809    }
810}
811
812
813pub type ContainerSummary = ContainerSummaryInner;
814
815#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
816pub struct ContainerSummaryInner {
817    /// The ID of this container
818    #[serde(rename = "Id")]
819    #[serde(skip_serializing_if="Option::is_none")]
820    pub id: Option<String>,
821
822    /// The names that this container has been given
823    #[serde(rename = "Names")]
824    #[serde(skip_serializing_if="Option::is_none")]
825    pub names: Option<Vec<String>>,
826
827    /// The name of the image used when creating this container
828    #[serde(rename = "Image")]
829    #[serde(skip_serializing_if="Option::is_none")]
830    pub image: Option<String>,
831
832    /// The ID of the image that this container was created from
833    #[serde(rename = "ImageID")]
834    #[serde(skip_serializing_if="Option::is_none")]
835    pub image_id: Option<String>,
836
837    /// Command to run when starting the container
838    #[serde(rename = "Command")]
839    #[serde(skip_serializing_if="Option::is_none")]
840    pub command: Option<String>,
841
842    /// When the container was created
843    #[serde(rename = "Created")]
844    #[serde(skip_serializing_if="Option::is_none")]
845    pub created: Option<i64>,
846
847    /// The ports exposed by this container
848    #[serde(rename = "Ports")]
849    #[serde(skip_serializing_if="Option::is_none")]
850    pub ports: Option<Vec<Port>>,
851
852    /// The size of files that have been created or changed by this container
853    #[serde(rename = "SizeRw")]
854    #[serde(skip_serializing_if="Option::is_none")]
855    pub size_rw: Option<i64>,
856
857    /// The total size of all the files in this container
858    #[serde(rename = "SizeRootFs")]
859    #[serde(skip_serializing_if="Option::is_none")]
860    pub size_root_fs: Option<i64>,
861
862    /// User-defined key/value metadata.
863    #[serde(rename = "Labels")]
864    #[serde(skip_serializing_if="Option::is_none")]
865    pub labels: Option<HashMap<String, String>>,
866
867    /// The state of this container (e.g. `Exited`)
868    #[serde(rename = "State")]
869    #[serde(skip_serializing_if="Option::is_none")]
870    pub state: Option<String>,
871
872    /// Additional human-readable status of this container (e.g. `Exit 0`)
873    #[serde(rename = "Status")]
874    #[serde(skip_serializing_if="Option::is_none")]
875    pub status: Option<String>,
876
877    #[serde(rename = "HostConfig")]
878    #[serde(skip_serializing_if="Option::is_none")]
879    pub host_config: Option<ContainerSummaryInnerHostConfig>,
880
881    #[serde(rename = "NetworkSettings")]
882    #[serde(skip_serializing_if="Option::is_none")]
883    pub network_settings: Option<ContainerSummaryInnerNetworkSettings>,
884
885    #[serde(rename = "Mounts")]
886    #[serde(skip_serializing_if="Option::is_none")]
887    pub mounts: Option<Vec<Mount>>,
888
889}
890
891#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
892pub struct ContainerSummaryInnerHostConfig {
893    #[serde(rename = "NetworkMode")]
894    #[serde(skip_serializing_if="Option::is_none")]
895    pub network_mode: Option<String>,
896
897}
898
899/// A summary of the container's network settings
900#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
901pub struct ContainerSummaryInnerNetworkSettings {
902    #[serde(rename = "Networks")]
903    #[serde(skip_serializing_if="Option::is_none")]
904    pub networks: Option<HashMap<String, EndpointSettings>>,
905
906}
907
908/// OK response to ContainerTop operation
909#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
910pub struct ContainerTopResponse {
911    /// The ps column titles
912    #[serde(rename = "Titles")]
913    #[serde(skip_serializing_if="Option::is_none")]
914    pub titles: Option<Vec<String>>,
915
916    /// Each process running in the container, where each is process is an array of values corresponding to the titles. 
917    #[serde(rename = "Processes")]
918    #[serde(skip_serializing_if="Option::is_none")]
919    pub processes: Option<Vec<Vec<String>>>,
920
921}
922
923/// OK response to ContainerUpdate operation
924#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
925pub struct ContainerUpdateResponse {
926    #[serde(rename = "Warnings")]
927    #[serde(skip_serializing_if="Option::is_none")]
928    pub warnings: Option<Vec<String>>,
929
930}
931
932/// OK response to ContainerWait operation
933#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
934pub struct ContainerWaitResponse {
935    /// Exit code of the container
936    #[serde(rename = "StatusCode")]
937    pub status_code: i64,
938
939    #[serde(rename = "Error")]
940    #[serde(skip_serializing_if="Option::is_none")]
941    pub error: Option<ContainerWaitResponseError>,
942
943}
944
945/// container waiting error, if any
946#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
947pub struct ContainerWaitResponseError {
948    /// Details of an error
949    #[serde(rename = "Message")]
950    #[serde(skip_serializing_if="Option::is_none")]
951    pub message: Option<String>,
952
953}
954
955#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
956pub struct CreateImageInfo {
957    #[serde(rename = "id")]
958    #[serde(skip_serializing_if="Option::is_none")]
959    pub id: Option<String>,
960
961    #[serde(rename = "error")]
962    #[serde(skip_serializing_if="Option::is_none")]
963    pub error: Option<String>,
964
965    #[serde(rename = "status")]
966    #[serde(skip_serializing_if="Option::is_none")]
967    pub status: Option<String>,
968
969    #[serde(rename = "progress")]
970    #[serde(skip_serializing_if="Option::is_none")]
971    pub progress: Option<String>,
972
973    #[serde(rename = "progressDetail")]
974    #[serde(skip_serializing_if="Option::is_none")]
975    pub progress_detail: Option<ProgressDetail>,
976
977}
978
979/// A device mapping between the host and container
980#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
981pub struct DeviceMapping {
982    #[serde(rename = "PathOnHost")]
983    #[serde(skip_serializing_if="Option::is_none")]
984    pub path_on_host: Option<String>,
985
986    #[serde(rename = "PathInContainer")]
987    #[serde(skip_serializing_if="Option::is_none")]
988    pub path_in_container: Option<String>,
989
990    #[serde(rename = "CgroupPermissions")]
991    #[serde(skip_serializing_if="Option::is_none")]
992    pub cgroup_permissions: Option<String>,
993
994}
995
996/// A request for devices to be sent to device drivers
997#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
998pub struct DeviceRequest {
999    #[serde(rename = "Driver")]
1000    #[serde(skip_serializing_if="Option::is_none")]
1001    pub driver: Option<String>,
1002
1003    #[serde(rename = "Count")]
1004    #[serde(skip_serializing_if="Option::is_none")]
1005    pub count: Option<i64>,
1006
1007    #[serde(rename = "DeviceIDs")]
1008    #[serde(skip_serializing_if="Option::is_none")]
1009    pub device_ids: Option<Vec<String>>,
1010
1011    /// A list of capabilities; an OR list of AND lists of capabilities. 
1012    #[serde(rename = "Capabilities")]
1013    #[serde(skip_serializing_if="Option::is_none")]
1014    pub capabilities: Option<Vec<Vec<String>>>,
1015
1016    /// Driver-specific options, specified as a key/value pairs. These options are passed directly to the driver. 
1017    #[serde(rename = "Options")]
1018    #[serde(skip_serializing_if="Option::is_none")]
1019    pub options: Option<HashMap<String, String>>,
1020
1021}
1022
1023#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1024pub struct DistributionInspectResponse {
1025    #[serde(rename = "Descriptor")]
1026    pub descriptor: DistributionInspectResponseDescriptor,
1027
1028    /// An array containing all platforms supported by the image. 
1029    #[serde(rename = "Platforms")]
1030    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
1031    pub platforms: Vec<DistributionInspectResponsePlatforms>,
1032
1033}
1034
1035/// A descriptor struct containing digest, media type, and size. 
1036#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1037pub struct DistributionInspectResponseDescriptor {
1038    #[serde(rename = "MediaType")]
1039    #[serde(skip_serializing_if="Option::is_none")]
1040    pub media_type: Option<String>,
1041
1042    #[serde(rename = "Size")]
1043    #[serde(skip_serializing_if="Option::is_none")]
1044    pub size: Option<i64>,
1045
1046    #[serde(rename = "Digest")]
1047    #[serde(skip_serializing_if="Option::is_none")]
1048    pub digest: Option<String>,
1049
1050    #[serde(rename = "URLs")]
1051    #[serde(skip_serializing_if="Option::is_none")]
1052    pub ur_ls: Option<Vec<String>>,
1053
1054}
1055
1056#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1057pub struct DistributionInspectResponsePlatforms {
1058    #[serde(rename = "Architecture")]
1059    #[serde(skip_serializing_if="Option::is_none")]
1060    pub architecture: Option<String>,
1061
1062    #[serde(rename = "OS")]
1063    #[serde(skip_serializing_if="Option::is_none")]
1064    pub os: Option<String>,
1065
1066    #[serde(rename = "OSVersion")]
1067    #[serde(skip_serializing_if="Option::is_none")]
1068    pub os_version: Option<String>,
1069
1070    #[serde(rename = "OSFeatures")]
1071    #[serde(skip_serializing_if="Option::is_none")]
1072    pub os_features: Option<Vec<String>>,
1073
1074    #[serde(rename = "Variant")]
1075    #[serde(skip_serializing_if="Option::is_none")]
1076    pub variant: Option<String>,
1077
1078    #[serde(rename = "Features")]
1079    #[serde(skip_serializing_if="Option::is_none")]
1080    pub features: Option<Vec<String>>,
1081
1082}
1083
1084/// Driver represents a driver (network, logging, secrets).
1085#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1086pub struct Driver {
1087    /// Name of the driver.
1088    #[serde(rename = "Name")]
1089    pub name: String,
1090
1091    /// Key/value map of driver-specific options.
1092    #[serde(rename = "Options")]
1093    #[serde(skip_serializing_if="Option::is_none")]
1094    pub options: Option<HashMap<String, String>>,
1095
1096}
1097
1098/// EndpointIPAMConfig represents an endpoint's IPAM configuration. 
1099#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1100pub struct EndpointIpamConfig {
1101    #[serde(rename = "IPv4Address")]
1102    #[serde(skip_serializing_if="Option::is_none")]
1103    pub ipv4_address: Option<String>,
1104
1105    #[serde(rename = "IPv6Address")]
1106    #[serde(skip_serializing_if="Option::is_none")]
1107    pub ipv6_address: Option<String>,
1108
1109    #[serde(rename = "LinkLocalIPs")]
1110    #[serde(skip_serializing_if="Option::is_none")]
1111    pub link_local_i_ps: Option<Vec<String>>,
1112
1113}
1114
1115#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1116pub struct EndpointPortConfig {
1117    #[serde(rename = "Name")]
1118    #[serde(skip_serializing_if="Option::is_none")]
1119    pub name: Option<String>,
1120
1121    #[serde(rename = "Protocol")]
1122    #[serde(skip_serializing_if="Option::is_none")]
1123    pub protocol: Option<EndpointPortConfigProtocolEnum>,
1124
1125    /// The port inside the container.
1126    #[serde(rename = "TargetPort")]
1127    #[serde(skip_serializing_if="Option::is_none")]
1128    pub target_port: Option<i64>,
1129
1130    /// The port on the swarm hosts.
1131    #[serde(rename = "PublishedPort")]
1132    #[serde(skip_serializing_if="Option::is_none")]
1133    pub published_port: Option<i64>,
1134
1135    /// The mode in which port is published.  <p><br /></p>  - \"ingress\" makes the target port accessible on every node,   regardless of whether there is a task for the service running on   that node or not. - \"host\" bypasses the routing mesh and publish the port directly on   the swarm node where that service is running. 
1136    #[serde(rename = "PublishMode")]
1137    #[serde(skip_serializing_if="Option::is_none")]
1138    pub publish_mode: Option<EndpointPortConfigPublishModeEnum>,
1139
1140}
1141
1142#[allow(non_camel_case_types)]
1143#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
1144pub enum EndpointPortConfigProtocolEnum { 
1145    #[serde(rename = "")]
1146    EMPTY,
1147    #[serde(rename = "tcp")]
1148    TCP,
1149    #[serde(rename = "udp")]
1150    UDP,
1151    #[serde(rename = "sctp")]
1152    SCTP,
1153}
1154
1155impl ::std::fmt::Display for EndpointPortConfigProtocolEnum {
1156    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
1157        match *self { 
1158            EndpointPortConfigProtocolEnum::EMPTY => write!(f, ""),
1159            EndpointPortConfigProtocolEnum::TCP => write!(f, "{}", "tcp"),
1160            EndpointPortConfigProtocolEnum::UDP => write!(f, "{}", "udp"),
1161            EndpointPortConfigProtocolEnum::SCTP => write!(f, "{}", "sctp"),
1162
1163        }
1164    }
1165}
1166
1167impl ::std::str::FromStr for EndpointPortConfigProtocolEnum {
1168    type Err = String;
1169    fn from_str(s: &str) -> Result<Self, Self::Err> {
1170        match s { 
1171            "" => Ok(EndpointPortConfigProtocolEnum::EMPTY),
1172            "tcp" => Ok(EndpointPortConfigProtocolEnum::TCP),
1173            "udp" => Ok(EndpointPortConfigProtocolEnum::UDP),
1174            "sctp" => Ok(EndpointPortConfigProtocolEnum::SCTP),
1175            x => Err(format!("Invalid enum type: {}", x)),
1176        }
1177    }
1178}
1179
1180impl ::std::convert::AsRef<str> for EndpointPortConfigProtocolEnum {
1181    fn as_ref(&self) -> &str {
1182        match self { 
1183            EndpointPortConfigProtocolEnum::EMPTY => "",
1184            EndpointPortConfigProtocolEnum::TCP => "tcp",
1185            EndpointPortConfigProtocolEnum::UDP => "udp",
1186            EndpointPortConfigProtocolEnum::SCTP => "sctp",
1187        }
1188    }
1189}
1190
1191#[allow(non_camel_case_types)]
1192#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
1193pub enum EndpointPortConfigPublishModeEnum { 
1194    #[serde(rename = "")]
1195    EMPTY,
1196    #[serde(rename = "ingress")]
1197    INGRESS,
1198    #[serde(rename = "host")]
1199    HOST,
1200}
1201
1202impl ::std::fmt::Display for EndpointPortConfigPublishModeEnum {
1203    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
1204        match *self { 
1205            EndpointPortConfigPublishModeEnum::EMPTY => write!(f, ""),
1206            EndpointPortConfigPublishModeEnum::INGRESS => write!(f, "{}", "ingress"),
1207            EndpointPortConfigPublishModeEnum::HOST => write!(f, "{}", "host"),
1208
1209        }
1210    }
1211}
1212
1213impl ::std::str::FromStr for EndpointPortConfigPublishModeEnum {
1214    type Err = String;
1215    fn from_str(s: &str) -> Result<Self, Self::Err> {
1216        match s { 
1217            "" => Ok(EndpointPortConfigPublishModeEnum::EMPTY),
1218            "ingress" => Ok(EndpointPortConfigPublishModeEnum::INGRESS),
1219            "host" => Ok(EndpointPortConfigPublishModeEnum::HOST),
1220            x => Err(format!("Invalid enum type: {}", x)),
1221        }
1222    }
1223}
1224
1225impl ::std::convert::AsRef<str> for EndpointPortConfigPublishModeEnum {
1226    fn as_ref(&self) -> &str {
1227        match self { 
1228            EndpointPortConfigPublishModeEnum::EMPTY => "",
1229            EndpointPortConfigPublishModeEnum::INGRESS => "ingress",
1230            EndpointPortConfigPublishModeEnum::HOST => "host",
1231        }
1232    }
1233}
1234
1235/// Configuration for a network endpoint.
1236#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1237pub struct EndpointSettings {
1238    #[serde(rename = "IPAMConfig")]
1239    #[serde(skip_serializing_if="Option::is_none")]
1240    pub ipam_config: Option<EndpointIpamConfig>,
1241
1242    #[serde(rename = "Links")]
1243    #[serde(skip_serializing_if="Option::is_none")]
1244    pub links: Option<Vec<String>>,
1245
1246    #[serde(rename = "Aliases")]
1247    #[serde(skip_serializing_if="Option::is_none")]
1248    pub aliases: Option<Vec<String>>,
1249
1250    /// Unique ID of the network. 
1251    #[serde(rename = "NetworkID")]
1252    #[serde(skip_serializing_if="Option::is_none")]
1253    pub network_id: Option<String>,
1254
1255    /// Unique ID for the service endpoint in a Sandbox. 
1256    #[serde(rename = "EndpointID")]
1257    #[serde(skip_serializing_if="Option::is_none")]
1258    pub endpoint_id: Option<String>,
1259
1260    /// Gateway address for this network. 
1261    #[serde(rename = "Gateway")]
1262    #[serde(skip_serializing_if="Option::is_none")]
1263    pub gateway: Option<String>,
1264
1265    /// IPv4 address. 
1266    #[serde(rename = "IPAddress")]
1267    #[serde(skip_serializing_if="Option::is_none")]
1268    pub ip_address: Option<String>,
1269
1270    /// Mask length of the IPv4 address. 
1271    #[serde(rename = "IPPrefixLen")]
1272    #[serde(skip_serializing_if="Option::is_none")]
1273    pub ip_prefix_len: Option<i64>,
1274
1275    /// IPv6 gateway address. 
1276    #[serde(rename = "IPv6Gateway")]
1277    #[serde(skip_serializing_if="Option::is_none")]
1278    pub ipv6_gateway: Option<String>,
1279
1280    /// Global IPv6 address. 
1281    #[serde(rename = "GlobalIPv6Address")]
1282    #[serde(skip_serializing_if="Option::is_none")]
1283    pub global_ipv6_address: Option<String>,
1284
1285    /// Mask length of the global IPv6 address. 
1286    #[serde(rename = "GlobalIPv6PrefixLen")]
1287    #[serde(skip_serializing_if="Option::is_none")]
1288    pub global_ipv6_prefix_len: Option<i64>,
1289
1290    /// MAC address for the endpoint on this network. 
1291    #[serde(rename = "MacAddress")]
1292    #[serde(skip_serializing_if="Option::is_none")]
1293    pub mac_address: Option<String>,
1294
1295    /// DriverOpts is a mapping of driver options and values. These options are passed directly to the driver and are driver specific. 
1296    #[serde(rename = "DriverOpts")]
1297    #[serde(skip_serializing_if="Option::is_none")]
1298    pub driver_opts: Option<HashMap<String, String>>,
1299
1300}
1301
1302/// Properties that can be configured to access and load balance a service.
1303#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1304pub struct EndpointSpec {
1305    /// The mode of resolution to use for internal load balancing between tasks. 
1306    #[serde(rename = "Mode")]
1307    #[serde(skip_serializing_if="Option::is_none")]
1308    pub mode: Option<EndpointSpecModeEnum>,
1309
1310    /// List of exposed ports that this service is accessible on from the outside. Ports can only be provided if `vip` resolution mode is used. 
1311    #[serde(rename = "Ports")]
1312    #[serde(skip_serializing_if="Option::is_none")]
1313    pub ports: Option<Vec<EndpointPortConfig>>,
1314
1315}
1316
1317#[allow(non_camel_case_types)]
1318#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
1319pub enum EndpointSpecModeEnum { 
1320    #[serde(rename = "")]
1321    EMPTY,
1322    #[serde(rename = "vip")]
1323    VIP,
1324    #[serde(rename = "dnsrr")]
1325    DNSRR,
1326}
1327
1328impl ::std::fmt::Display for EndpointSpecModeEnum {
1329    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
1330        match *self { 
1331            EndpointSpecModeEnum::EMPTY => write!(f, ""),
1332            EndpointSpecModeEnum::VIP => write!(f, "{}", "vip"),
1333            EndpointSpecModeEnum::DNSRR => write!(f, "{}", "dnsrr"),
1334
1335        }
1336    }
1337}
1338
1339impl ::std::str::FromStr for EndpointSpecModeEnum {
1340    type Err = String;
1341    fn from_str(s: &str) -> Result<Self, Self::Err> {
1342        match s { 
1343            "" => Ok(EndpointSpecModeEnum::EMPTY),
1344            "vip" => Ok(EndpointSpecModeEnum::VIP),
1345            "dnsrr" => Ok(EndpointSpecModeEnum::DNSRR),
1346            x => Err(format!("Invalid enum type: {}", x)),
1347        }
1348    }
1349}
1350
1351impl ::std::convert::AsRef<str> for EndpointSpecModeEnum {
1352    fn as_ref(&self) -> &str {
1353        match self { 
1354            EndpointSpecModeEnum::EMPTY => "",
1355            EndpointSpecModeEnum::VIP => "vip",
1356            EndpointSpecModeEnum::DNSRR => "dnsrr",
1357        }
1358    }
1359}
1360
1361/// EngineDescription provides information about an engine.
1362#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1363pub struct EngineDescription {
1364    #[serde(rename = "EngineVersion")]
1365    #[serde(skip_serializing_if="Option::is_none")]
1366    pub engine_version: Option<String>,
1367
1368    #[serde(rename = "Labels")]
1369    #[serde(skip_serializing_if="Option::is_none")]
1370    pub labels: Option<HashMap<String, String>>,
1371
1372    #[serde(rename = "Plugins")]
1373    #[serde(skip_serializing_if="Option::is_none")]
1374    pub plugins: Option<Vec<EngineDescriptionPlugins>>,
1375
1376}
1377
1378#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1379pub struct EngineDescriptionPlugins {
1380    #[serde(rename = "Type")]
1381    #[serde(skip_serializing_if="Option::is_none")]
1382    pub typ: Option<String>,
1383
1384    #[serde(rename = "Name")]
1385    #[serde(skip_serializing_if="Option::is_none")]
1386    pub name: Option<String>,
1387
1388}
1389
1390#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1391pub struct ErrorDetail {
1392    #[serde(rename = "code")]
1393    #[serde(skip_serializing_if="Option::is_none")]
1394    pub code: Option<i64>,
1395
1396    #[serde(rename = "message")]
1397    #[serde(skip_serializing_if="Option::is_none")]
1398    pub message: Option<String>,
1399
1400}
1401
1402/// Represents an error.
1403#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1404pub struct ErrorResponse {
1405    /// The error message.
1406    #[serde(rename = "message")]
1407    pub message: String,
1408
1409}
1410
1411#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1412pub struct ExecConfig {
1413    /// Attach to `stdin` of the exec command.
1414    #[serde(rename = "AttachStdin")]
1415    #[serde(skip_serializing_if="Option::is_none")]
1416    pub attach_stdin: Option<bool>,
1417
1418    /// Attach to `stdout` of the exec command.
1419    #[serde(rename = "AttachStdout")]
1420    #[serde(skip_serializing_if="Option::is_none")]
1421    pub attach_stdout: Option<bool>,
1422
1423    /// Attach to `stderr` of the exec command.
1424    #[serde(rename = "AttachStderr")]
1425    #[serde(skip_serializing_if="Option::is_none")]
1426    pub attach_stderr: Option<bool>,
1427
1428    /// Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. 
1429    #[serde(rename = "DetachKeys")]
1430    #[serde(skip_serializing_if="Option::is_none")]
1431    pub detach_keys: Option<String>,
1432
1433    /// Allocate a pseudo-TTY.
1434    #[serde(rename = "Tty")]
1435    #[serde(skip_serializing_if="Option::is_none")]
1436    pub tty: Option<bool>,
1437
1438    /// A list of environment variables in the form `[\"VAR=value\", ...]`. 
1439    #[serde(rename = "Env")]
1440    #[serde(skip_serializing_if="Option::is_none")]
1441    pub env: Option<Vec<String>>,
1442
1443    /// Command to run, as a string or array of strings.
1444    #[serde(rename = "Cmd")]
1445    #[serde(skip_serializing_if="Option::is_none")]
1446    pub cmd: Option<Vec<String>>,
1447
1448    /// Runs the exec process with extended privileges.
1449    #[serde(rename = "Privileged")]
1450    #[serde(skip_serializing_if="Option::is_none")]
1451    pub privileged: Option<bool>,
1452
1453    /// The user, and optionally, group to run the exec process inside the container. Format is one of: `user`, `user:group`, `uid`, or `uid:gid`. 
1454    #[serde(rename = "User")]
1455    #[serde(skip_serializing_if="Option::is_none")]
1456    pub user: Option<String>,
1457
1458    /// The working directory for the exec process inside the container. 
1459    #[serde(rename = "WorkingDir")]
1460    #[serde(skip_serializing_if="Option::is_none")]
1461    pub working_dir: Option<String>,
1462
1463}
1464
1465#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1466pub struct ExecInspectResponse {
1467    #[serde(rename = "CanRemove")]
1468    #[serde(skip_serializing_if="Option::is_none")]
1469    pub can_remove: Option<bool>,
1470
1471    #[serde(rename = "DetachKeys")]
1472    #[serde(skip_serializing_if="Option::is_none")]
1473    pub detach_keys: Option<String>,
1474
1475    #[serde(rename = "ID")]
1476    #[serde(skip_serializing_if="Option::is_none")]
1477    pub id: Option<String>,
1478
1479    #[serde(rename = "Running")]
1480    #[serde(skip_serializing_if="Option::is_none")]
1481    pub running: Option<bool>,
1482
1483    #[serde(rename = "ExitCode")]
1484    #[serde(skip_serializing_if="Option::is_none")]
1485    pub exit_code: Option<i64>,
1486
1487    #[serde(rename = "ProcessConfig")]
1488    #[serde(skip_serializing_if="Option::is_none")]
1489    pub process_config: Option<ProcessConfig>,
1490
1491    #[serde(rename = "OpenStdin")]
1492    #[serde(skip_serializing_if="Option::is_none")]
1493    pub open_stdin: Option<bool>,
1494
1495    #[serde(rename = "OpenStderr")]
1496    #[serde(skip_serializing_if="Option::is_none")]
1497    pub open_stderr: Option<bool>,
1498
1499    #[serde(rename = "OpenStdout")]
1500    #[serde(skip_serializing_if="Option::is_none")]
1501    pub open_stdout: Option<bool>,
1502
1503    #[serde(rename = "ContainerID")]
1504    #[serde(skip_serializing_if="Option::is_none")]
1505    pub container_id: Option<String>,
1506
1507    /// The system process ID for the exec process.
1508    #[serde(rename = "Pid")]
1509    #[serde(skip_serializing_if="Option::is_none")]
1510    pub pid: Option<i64>,
1511
1512}
1513
1514#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1515pub struct ExecStartConfig {
1516    /// Detach from the command.
1517    #[serde(rename = "Detach")]
1518    #[serde(skip_serializing_if="Option::is_none")]
1519    pub detach: Option<bool>,
1520
1521    /// Allocate a pseudo-TTY.
1522    #[serde(rename = "Tty")]
1523    #[serde(skip_serializing_if="Option::is_none")]
1524    pub tty: Option<bool>,
1525
1526}
1527
1528/// User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`). 
1529
1530pub type GenericResources = GenericResourcesInner;
1531
1532#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1533pub struct GenericResourcesInner {
1534    #[serde(rename = "NamedResourceSpec")]
1535    #[serde(skip_serializing_if="Option::is_none")]
1536    pub named_resource_spec: Option<GenericResourcesInnerNamedResourceSpec>,
1537
1538    #[serde(rename = "DiscreteResourceSpec")]
1539    #[serde(skip_serializing_if="Option::is_none")]
1540    pub discrete_resource_spec: Option<GenericResourcesInnerDiscreteResourceSpec>,
1541
1542}
1543
1544#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1545pub struct GenericResourcesInnerDiscreteResourceSpec {
1546    #[serde(rename = "Kind")]
1547    #[serde(skip_serializing_if="Option::is_none")]
1548    pub kind: Option<String>,
1549
1550    #[serde(rename = "Value")]
1551    #[serde(skip_serializing_if="Option::is_none")]
1552    pub value: Option<i64>,
1553
1554}
1555
1556#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1557pub struct GenericResourcesInnerNamedResourceSpec {
1558    #[serde(rename = "Kind")]
1559    #[serde(skip_serializing_if="Option::is_none")]
1560    pub kind: Option<String>,
1561
1562    #[serde(rename = "Value")]
1563    #[serde(skip_serializing_if="Option::is_none")]
1564    pub value: Option<String>,
1565
1566}
1567
1568/// Information about a container's graph driver.
1569#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1570pub struct GraphDriverData {
1571    #[serde(rename = "Name")]
1572    pub name: String,
1573
1574    #[serde(rename = "Data")]
1575    #[serde(deserialize_with = "deserialize_nonoptional_map")]
1576    pub data: HashMap<String, String>,
1577
1578}
1579
1580/// Health stores information about the container's healthcheck results. 
1581#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1582pub struct Health {
1583    /// Status is one of `none`, `starting`, `healthy` or `unhealthy`  - \"none\"      Indicates there is no healthcheck - \"starting\"  Starting indicates that the container is not yet ready - \"healthy\"   Healthy indicates that the container is running correctly - \"unhealthy\" Unhealthy indicates that the container has a problem 
1584    #[serde(rename = "Status")]
1585    #[serde(skip_serializing_if="Option::is_none")]
1586    pub status: Option<HealthStatusEnum>,
1587
1588    /// FailingStreak is the number of consecutive failures
1589    #[serde(rename = "FailingStreak")]
1590    #[serde(skip_serializing_if="Option::is_none")]
1591    pub failing_streak: Option<i64>,
1592
1593    /// Log contains the last few results (oldest first) 
1594    #[serde(rename = "Log")]
1595    #[serde(skip_serializing_if="Option::is_none")]
1596    pub log: Option<Vec<HealthcheckResult>>,
1597
1598}
1599
1600#[allow(non_camel_case_types)]
1601#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
1602pub enum HealthStatusEnum { 
1603    #[serde(rename = "")]
1604    EMPTY,
1605    #[serde(rename = "none")]
1606    NONE,
1607    #[serde(rename = "starting")]
1608    STARTING,
1609    #[serde(rename = "healthy")]
1610    HEALTHY,
1611    #[serde(rename = "unhealthy")]
1612    UNHEALTHY,
1613}
1614
1615impl ::std::fmt::Display for HealthStatusEnum {
1616    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
1617        match *self { 
1618            HealthStatusEnum::EMPTY => write!(f, ""),
1619            HealthStatusEnum::NONE => write!(f, "{}", "none"),
1620            HealthStatusEnum::STARTING => write!(f, "{}", "starting"),
1621            HealthStatusEnum::HEALTHY => write!(f, "{}", "healthy"),
1622            HealthStatusEnum::UNHEALTHY => write!(f, "{}", "unhealthy"),
1623
1624        }
1625    }
1626}
1627
1628impl ::std::str::FromStr for HealthStatusEnum {
1629    type Err = String;
1630    fn from_str(s: &str) -> Result<Self, Self::Err> {
1631        match s { 
1632            "" => Ok(HealthStatusEnum::EMPTY),
1633            "none" => Ok(HealthStatusEnum::NONE),
1634            "starting" => Ok(HealthStatusEnum::STARTING),
1635            "healthy" => Ok(HealthStatusEnum::HEALTHY),
1636            "unhealthy" => Ok(HealthStatusEnum::UNHEALTHY),
1637            x => Err(format!("Invalid enum type: {}", x)),
1638        }
1639    }
1640}
1641
1642impl ::std::convert::AsRef<str> for HealthStatusEnum {
1643    fn as_ref(&self) -> &str {
1644        match self { 
1645            HealthStatusEnum::EMPTY => "",
1646            HealthStatusEnum::NONE => "none",
1647            HealthStatusEnum::STARTING => "starting",
1648            HealthStatusEnum::HEALTHY => "healthy",
1649            HealthStatusEnum::UNHEALTHY => "unhealthy",
1650        }
1651    }
1652}
1653
1654/// A test to perform to check that the container is healthy.
1655#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1656pub struct HealthConfig {
1657    /// The test to perform. Possible values are:  - `[]` inherit healthcheck from image or parent image - `[\"NONE\"]` disable healthcheck - `[\"CMD\", args...]` exec arguments directly - `[\"CMD-SHELL\", command]` run command with system's default shell 
1658    #[serde(rename = "Test")]
1659    #[serde(skip_serializing_if="Option::is_none")]
1660    pub test: Option<Vec<String>>,
1661
1662    /// The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. 
1663    #[serde(rename = "Interval")]
1664    #[serde(skip_serializing_if="Option::is_none")]
1665    pub interval: Option<i64>,
1666
1667    /// The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. 
1668    #[serde(rename = "Timeout")]
1669    #[serde(skip_serializing_if="Option::is_none")]
1670    pub timeout: Option<i64>,
1671
1672    /// The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit. 
1673    #[serde(rename = "Retries")]
1674    #[serde(skip_serializing_if="Option::is_none")]
1675    pub retries: Option<i64>,
1676
1677    /// Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. 
1678    #[serde(rename = "StartPeriod")]
1679    #[serde(skip_serializing_if="Option::is_none")]
1680    pub start_period: Option<i64>,
1681
1682}
1683
1684/// HealthcheckResult stores information about a single run of a healthcheck probe 
1685#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1686pub struct HealthcheckResult {
1687    /// Date and time at which this check started in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
1688    #[serde(rename = "Start")]
1689    #[serde(skip_serializing_if="Option::is_none")]
1690    pub start: Option<chrono::DateTime<chrono::Utc>>,
1691
1692    /// Date and time at which this check ended in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
1693    #[serde(rename = "End")]
1694    #[serde(skip_serializing_if="Option::is_none")]
1695    pub end: Option<DateTime<Utc>>,
1696
1697    /// ExitCode meanings:  - `0` healthy - `1` unhealthy - `2` reserved (considered unhealthy) - other values: error running probe 
1698    #[serde(rename = "ExitCode")]
1699    #[serde(skip_serializing_if="Option::is_none")]
1700    pub exit_code: Option<i64>,
1701
1702    /// Output from last check
1703    #[serde(rename = "Output")]
1704    #[serde(skip_serializing_if="Option::is_none")]
1705    pub output: Option<String>,
1706
1707}
1708
1709/// individual image layer information in response to ImageHistory operation
1710#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1711pub struct HistoryResponseItem {
1712    #[serde(rename = "Id")]
1713    pub id: String,
1714
1715    #[serde(rename = "Created")]
1716    pub created: i64,
1717
1718    #[serde(rename = "CreatedBy")]
1719    pub created_by: String,
1720
1721    #[serde(rename = "Tags")]
1722    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
1723    pub tags: Vec<String>,
1724
1725    #[serde(rename = "Size")]
1726    pub size: i64,
1727
1728    #[serde(rename = "Comment")]
1729    pub comment: String,
1730
1731}
1732
1733/// The logging configuration for this container
1734#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1735pub struct HostConfigLogConfig {
1736    #[serde(rename = "Type")]
1737    #[serde(skip_serializing_if="Option::is_none")]
1738    pub typ: Option<String>,
1739
1740    #[serde(rename = "Config")]
1741    #[serde(skip_serializing_if="Option::is_none")]
1742    pub config: Option<HashMap<String, String>>,
1743
1744}
1745
1746/// Response to an API call that returns just an Id
1747#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1748pub struct IdResponse {
1749    /// The id of the newly created object.
1750    #[serde(rename = "Id")]
1751    pub id: String,
1752
1753}
1754
1755#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1756pub struct Image {
1757    #[serde(rename = "Id")]
1758    pub id: String,
1759
1760    #[serde(rename = "RepoTags")]
1761    #[serde(skip_serializing_if="Option::is_none")]
1762    pub repo_tags: Option<Vec<String>>,
1763
1764    #[serde(rename = "RepoDigests")]
1765    #[serde(skip_serializing_if="Option::is_none")]
1766    pub repo_digests: Option<Vec<String>>,
1767
1768    #[serde(rename = "Parent")]
1769    pub parent: String,
1770
1771    #[serde(rename = "Comment")]
1772    pub comment: String,
1773
1774    #[serde(rename = "Created")]
1775    pub created: String,
1776
1777    #[serde(rename = "Container")]
1778    pub container: String,
1779
1780    #[serde(rename = "ContainerConfig")]
1781    #[serde(skip_serializing_if="Option::is_none")]
1782    pub container_config: Option<ContainerConfig>,
1783
1784    #[serde(rename = "DockerVersion")]
1785    pub docker_version: String,
1786
1787    #[serde(rename = "Author")]
1788    pub author: String,
1789
1790    #[serde(rename = "Config")]
1791    #[serde(skip_serializing_if="Option::is_none")]
1792    pub config: Option<ContainerConfig>,
1793
1794    #[serde(rename = "Architecture")]
1795    pub architecture: String,
1796
1797    #[serde(rename = "Os")]
1798    pub os: String,
1799
1800    #[serde(rename = "OsVersion")]
1801    #[serde(skip_serializing_if="Option::is_none")]
1802    pub os_version: Option<String>,
1803
1804    #[serde(rename = "Size")]
1805    pub size: i64,
1806
1807    #[serde(rename = "VirtualSize")]
1808    pub virtual_size: i64,
1809
1810    #[serde(rename = "GraphDriver")]
1811    pub graph_driver: GraphDriverData,
1812
1813    #[serde(rename = "RootFS")]
1814    pub root_fs: ImageRootFs,
1815
1816    #[serde(rename = "Metadata")]
1817    #[serde(skip_serializing_if="Option::is_none")]
1818    pub metadata: Option<ImageMetadata>,
1819
1820}
1821
1822#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1823pub struct ImageDeleteResponseItem {
1824    /// The image ID of an image that was untagged
1825    #[serde(rename = "Untagged")]
1826    #[serde(skip_serializing_if="Option::is_none")]
1827    pub untagged: Option<String>,
1828
1829    /// The image ID of an image that was deleted
1830    #[serde(rename = "Deleted")]
1831    #[serde(skip_serializing_if="Option::is_none")]
1832    pub deleted: Option<String>,
1833
1834}
1835
1836/// Image ID or Digest
1837#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1838pub struct ImageId {
1839    #[serde(rename = "ID")]
1840    #[serde(skip_serializing_if="Option::is_none")]
1841    pub id: Option<String>,
1842
1843}
1844
1845#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1846pub struct ImageMetadata {
1847    #[serde(rename = "LastTagTime")]
1848    #[serde(skip_serializing_if="Option::is_none")]
1849    pub last_tag_time: Option<DateTime<Utc>>,
1850
1851}
1852
1853#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1854pub struct ImagePruneResponse {
1855    /// Images that were deleted
1856    #[serde(rename = "ImagesDeleted")]
1857    #[serde(skip_serializing_if="Option::is_none")]
1858    pub images_deleted: Option<Vec<ImageDeleteResponseItem>>,
1859
1860    /// Disk space reclaimed in bytes
1861    #[serde(rename = "SpaceReclaimed")]
1862    #[serde(skip_serializing_if="Option::is_none")]
1863    pub space_reclaimed: Option<i64>,
1864
1865}
1866
1867#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1868pub struct ImageRootFs {
1869    #[serde(rename = "Type")]
1870    pub typ: String,
1871
1872    #[serde(rename = "Layers")]
1873    #[serde(skip_serializing_if="Option::is_none")]
1874    pub layers: Option<Vec<String>>,
1875
1876    #[serde(rename = "BaseLayer")]
1877    #[serde(skip_serializing_if="Option::is_none")]
1878    pub base_layer: Option<String>,
1879
1880}
1881
1882#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1883pub struct ImageSearchResponseItem {
1884    #[serde(rename = "description")]
1885    #[serde(skip_serializing_if="Option::is_none")]
1886    pub description: Option<String>,
1887
1888    #[serde(rename = "is_official")]
1889    #[serde(skip_serializing_if="Option::is_none")]
1890    pub is_official: Option<bool>,
1891
1892    #[serde(rename = "is_automated")]
1893    #[serde(skip_serializing_if="Option::is_none")]
1894    pub is_automated: Option<bool>,
1895
1896    #[serde(rename = "name")]
1897    #[serde(skip_serializing_if="Option::is_none")]
1898    pub name: Option<String>,
1899
1900    #[serde(rename = "star_count")]
1901    #[serde(skip_serializing_if="Option::is_none")]
1902    pub star_count: Option<i64>,
1903
1904}
1905
1906#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1907pub struct ImageSummary {
1908    #[serde(rename = "Id")]
1909    pub id: String,
1910
1911    #[serde(rename = "ParentId")]
1912    pub parent_id: String,
1913
1914    #[serde(rename = "RepoTags")]
1915    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
1916    pub repo_tags: Vec<String>,
1917
1918    #[serde(rename = "RepoDigests")]
1919    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
1920    pub repo_digests: Vec<String>,
1921
1922    #[serde(rename = "Created")]
1923    pub created: i64,
1924
1925    #[serde(rename = "Size")]
1926    pub size: i64,
1927
1928    #[serde(rename = "SharedSize")]
1929    pub shared_size: i64,
1930
1931    #[serde(rename = "VirtualSize")]
1932    pub virtual_size: i64,
1933
1934    #[serde(rename = "Labels")]
1935    #[serde(deserialize_with = "deserialize_nonoptional_map")]
1936    pub labels: HashMap<String, String>,
1937
1938    #[serde(rename = "Containers")]
1939    pub containers: i64,
1940
1941}
1942
1943/// IndexInfo contains information about a registry.
1944#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1945pub struct IndexInfo {
1946    /// Name of the registry, such as \"docker.io\". 
1947    #[serde(rename = "Name")]
1948    #[serde(skip_serializing_if="Option::is_none")]
1949    pub name: Option<String>,
1950
1951    /// List of mirrors, expressed as URIs. 
1952    #[serde(rename = "Mirrors")]
1953    #[serde(skip_serializing_if="Option::is_none")]
1954    pub mirrors: Option<Vec<String>>,
1955
1956    /// Indicates if the registry is part of the list of insecure registries.  If `false`, the registry is insecure. Insecure registries accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from unknown CAs) communication.  > **Warning**: Insecure registries can be useful when running a local > registry. However, because its use creates security vulnerabilities > it should ONLY be enabled for testing purposes. For increased > security, users should add their CA to their system's list of > trusted CAs instead of enabling this option. 
1957    #[serde(rename = "Secure")]
1958    #[serde(skip_serializing_if="Option::is_none")]
1959    pub secure: Option<bool>,
1960
1961    /// Indicates whether this is an official registry (i.e., Docker Hub / docker.io) 
1962    #[serde(rename = "Official")]
1963    #[serde(skip_serializing_if="Option::is_none")]
1964    pub official: Option<bool>,
1965
1966}
1967
1968#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1969pub struct InlineResponse400 {
1970    #[serde(rename = "ErrorResponse")]
1971    #[serde(skip_serializing_if="Option::is_none")]
1972    pub error_response: Option<ErrorResponse>,
1973
1974    /// The error message. Either \"must specify path parameter\" (path cannot be empty) or \"not a directory\" (path was asserted to be a directory but exists as a file). 
1975    #[serde(rename = "message")]
1976    #[serde(skip_serializing_if="Option::is_none")]
1977    pub message: Option<String>,
1978
1979}
1980
1981#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1982pub struct Ipam {
1983    /// Name of the IPAM driver to use.
1984    #[serde(rename = "Driver")]
1985    #[serde(skip_serializing_if="Option::is_none")]
1986    pub driver: Option<String>,
1987
1988    /// List of IPAM configuration options, specified as a map:  ``` {\"Subnet\": <CIDR>, \"IPRange\": <CIDR>, \"Gateway\": <IP address>, \"AuxAddress\": <device_name:IP address>} ``` 
1989    #[serde(rename = "Config")]
1990    #[serde(skip_serializing_if="Option::is_none")]
1991    pub config: Option<Vec<HashMap<String, String>>>,
1992
1993    /// Driver-specific options, specified as a map.
1994    #[serde(rename = "Options")]
1995    #[serde(skip_serializing_if="Option::is_none")]
1996    pub options: Option<HashMap<String, String>>,
1997
1998}
1999
2000/// JoinTokens contains the tokens workers and managers need to join the swarm. 
2001#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2002pub struct JoinTokens {
2003    /// The token workers can use to join the swarm. 
2004    #[serde(rename = "Worker")]
2005    #[serde(skip_serializing_if="Option::is_none")]
2006    pub worker: Option<String>,
2007
2008    /// The token managers can use to join the swarm. 
2009    #[serde(rename = "Manager")]
2010    #[serde(skip_serializing_if="Option::is_none")]
2011    pub manager: Option<String>,
2012
2013}
2014
2015/// An object describing a limit on resources which can be requested by a task. 
2016#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2017pub struct Limit {
2018    #[serde(rename = "NanoCPUs")]
2019    #[serde(skip_serializing_if="Option::is_none")]
2020    pub nano_cp_us: Option<i64>,
2021
2022    #[serde(rename = "MemoryBytes")]
2023    #[serde(skip_serializing_if="Option::is_none")]
2024    pub memory_bytes: Option<i64>,
2025
2026    /// Limits the maximum number of PIDs in the container. Set `0` for unlimited. 
2027    #[serde(rename = "Pids")]
2028    #[serde(skip_serializing_if="Option::is_none")]
2029    pub pids: Option<i64>,
2030
2031}
2032
2033/// Current local status of this node.
2034/// Enumeration of values.
2035/// Since this enum's variants do not hold data, we can easily define them them as `#[repr(C)]`
2036/// which helps with FFI.
2037#[allow(non_camel_case_types)]
2038#[repr(C)]
2039#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
2040pub enum LocalNodeState { 
2041    #[serde(rename = "")]
2042    EMPTY,
2043    #[serde(rename = "inactive")]
2044    INACTIVE,
2045    #[serde(rename = "pending")]
2046    PENDING,
2047    #[serde(rename = "active")]
2048    ACTIVE,
2049    #[serde(rename = "error")]
2050    ERROR,
2051    #[serde(rename = "locked")]
2052    LOCKED,
2053}
2054
2055impl ::std::fmt::Display for LocalNodeState {
2056    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
2057        match *self { 
2058            LocalNodeState::EMPTY => write!(f, "{}", ""),
2059            LocalNodeState::INACTIVE => write!(f, "{}", "inactive"),
2060            LocalNodeState::PENDING => write!(f, "{}", "pending"),
2061            LocalNodeState::ACTIVE => write!(f, "{}", "active"),
2062            LocalNodeState::ERROR => write!(f, "{}", "error"),
2063            LocalNodeState::LOCKED => write!(f, "{}", "locked"),
2064        }
2065    }
2066}
2067
2068impl ::std::str::FromStr for LocalNodeState {
2069    type Err = ();
2070    fn from_str(s: &str) -> Result<Self, Self::Err> {
2071        match s {
2072            "" => Ok(LocalNodeState::EMPTY),
2073            "inactive" => Ok(LocalNodeState::INACTIVE),
2074            "pending" => Ok(LocalNodeState::PENDING),
2075            "active" => Ok(LocalNodeState::ACTIVE),
2076            "error" => Ok(LocalNodeState::ERROR),
2077            "locked" => Ok(LocalNodeState::LOCKED),
2078            _ => Err(()),
2079        }
2080    }
2081}
2082
2083/// ManagerStatus represents the status of a manager.  It provides the current status of a node's manager component, if the node is a manager. 
2084#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2085pub struct ManagerStatus {
2086    #[serde(rename = "Leader")]
2087    #[serde(skip_serializing_if="Option::is_none")]
2088    pub leader: Option<bool>,
2089
2090    #[serde(rename = "Reachability")]
2091    #[serde(skip_serializing_if="Option::is_none")]
2092    pub reachability: Option<Reachability>,
2093
2094    /// The IP address and port at which the manager is reachable. 
2095    #[serde(rename = "Addr")]
2096    #[serde(skip_serializing_if="Option::is_none")]
2097    pub addr: Option<String>,
2098
2099}
2100
2101#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2102pub struct Mount {
2103    /// Container path.
2104    #[serde(rename = "Target")]
2105    #[serde(skip_serializing_if="Option::is_none")]
2106    pub target: Option<String>,
2107
2108    /// Mount source (e.g. a volume name, a host path).
2109    #[serde(rename = "Source")]
2110    #[serde(skip_serializing_if="Option::is_none")]
2111    pub source: Option<String>,
2112
2113    /// The mount type. Available types:  - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. 
2114    #[serde(rename = "Type")]
2115    #[serde(skip_serializing_if="Option::is_none")]
2116    pub typ: Option<MountTypeEnum>,
2117
2118    /// Whether the mount should be read-only.
2119    #[serde(rename = "ReadOnly")]
2120    #[serde(skip_serializing_if="Option::is_none")]
2121    pub read_only: Option<bool>,
2122
2123    /// The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`.
2124    #[serde(rename = "Consistency")]
2125    #[serde(skip_serializing_if="Option::is_none")]
2126    pub consistency: Option<String>,
2127
2128    #[serde(rename = "BindOptions")]
2129    #[serde(skip_serializing_if="Option::is_none")]
2130    pub bind_options: Option<MountBindOptions>,
2131
2132    #[serde(rename = "VolumeOptions")]
2133    #[serde(skip_serializing_if="Option::is_none")]
2134    pub volume_options: Option<MountVolumeOptions>,
2135
2136    #[serde(rename = "TmpfsOptions")]
2137    #[serde(skip_serializing_if="Option::is_none")]
2138    pub tmpfs_options: Option<MountTmpfsOptions>,
2139
2140}
2141
2142#[allow(non_camel_case_types)]
2143#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
2144pub enum MountTypeEnum { 
2145    #[serde(rename = "")]
2146    EMPTY,
2147    #[serde(rename = "bind")]
2148    BIND,
2149    #[serde(rename = "volume")]
2150    VOLUME,
2151    #[serde(rename = "tmpfs")]
2152    TMPFS,
2153    #[serde(rename = "npipe")]
2154    NPIPE,
2155}
2156
2157impl ::std::fmt::Display for MountTypeEnum {
2158    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
2159        match *self { 
2160            MountTypeEnum::EMPTY => write!(f, ""),
2161            MountTypeEnum::BIND => write!(f, "{}", "bind"),
2162            MountTypeEnum::VOLUME => write!(f, "{}", "volume"),
2163            MountTypeEnum::TMPFS => write!(f, "{}", "tmpfs"),
2164            MountTypeEnum::NPIPE => write!(f, "{}", "npipe"),
2165
2166        }
2167    }
2168}
2169
2170impl ::std::str::FromStr for MountTypeEnum {
2171    type Err = String;
2172    fn from_str(s: &str) -> Result<Self, Self::Err> {
2173        match s { 
2174            "" => Ok(MountTypeEnum::EMPTY),
2175            "bind" => Ok(MountTypeEnum::BIND),
2176            "volume" => Ok(MountTypeEnum::VOLUME),
2177            "tmpfs" => Ok(MountTypeEnum::TMPFS),
2178            "npipe" => Ok(MountTypeEnum::NPIPE),
2179            x => Err(format!("Invalid enum type: {}", x)),
2180        }
2181    }
2182}
2183
2184impl ::std::convert::AsRef<str> for MountTypeEnum {
2185    fn as_ref(&self) -> &str {
2186        match self { 
2187            MountTypeEnum::EMPTY => "",
2188            MountTypeEnum::BIND => "bind",
2189            MountTypeEnum::VOLUME => "volume",
2190            MountTypeEnum::TMPFS => "tmpfs",
2191            MountTypeEnum::NPIPE => "npipe",
2192        }
2193    }
2194}
2195
2196/// Optional configuration for the `bind` type.
2197#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2198pub struct MountBindOptions {
2199    /// A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.
2200    #[serde(rename = "Propagation")]
2201    #[serde(skip_serializing_if="Option::is_none")]
2202    pub propagation: Option<MountBindOptionsPropagationEnum>,
2203
2204    /// Disable recursive bind mount.
2205    #[serde(rename = "NonRecursive")]
2206    #[serde(skip_serializing_if="Option::is_none")]
2207    pub non_recursive: Option<bool>,
2208
2209}
2210
2211#[allow(non_camel_case_types)]
2212#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
2213pub enum MountBindOptionsPropagationEnum { 
2214    #[serde(rename = "")]
2215    EMPTY,
2216    #[serde(rename = "private")]
2217    PRIVATE,
2218    #[serde(rename = "rprivate")]
2219    RPRIVATE,
2220    #[serde(rename = "shared")]
2221    SHARED,
2222    #[serde(rename = "rshared")]
2223    RSHARED,
2224    #[serde(rename = "slave")]
2225    SLAVE,
2226    #[serde(rename = "rslave")]
2227    RSLAVE,
2228}
2229
2230impl ::std::fmt::Display for MountBindOptionsPropagationEnum {
2231    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
2232        match *self { 
2233            MountBindOptionsPropagationEnum::EMPTY => write!(f, ""),
2234            MountBindOptionsPropagationEnum::PRIVATE => write!(f, "{}", "private"),
2235            MountBindOptionsPropagationEnum::RPRIVATE => write!(f, "{}", "rprivate"),
2236            MountBindOptionsPropagationEnum::SHARED => write!(f, "{}", "shared"),
2237            MountBindOptionsPropagationEnum::RSHARED => write!(f, "{}", "rshared"),
2238            MountBindOptionsPropagationEnum::SLAVE => write!(f, "{}", "slave"),
2239            MountBindOptionsPropagationEnum::RSLAVE => write!(f, "{}", "rslave"),
2240
2241        }
2242    }
2243}
2244
2245impl ::std::str::FromStr for MountBindOptionsPropagationEnum {
2246    type Err = String;
2247    fn from_str(s: &str) -> Result<Self, Self::Err> {
2248        match s { 
2249            "" => Ok(MountBindOptionsPropagationEnum::EMPTY),
2250            "private" => Ok(MountBindOptionsPropagationEnum::PRIVATE),
2251            "rprivate" => Ok(MountBindOptionsPropagationEnum::RPRIVATE),
2252            "shared" => Ok(MountBindOptionsPropagationEnum::SHARED),
2253            "rshared" => Ok(MountBindOptionsPropagationEnum::RSHARED),
2254            "slave" => Ok(MountBindOptionsPropagationEnum::SLAVE),
2255            "rslave" => Ok(MountBindOptionsPropagationEnum::RSLAVE),
2256            x => Err(format!("Invalid enum type: {}", x)),
2257        }
2258    }
2259}
2260
2261impl ::std::convert::AsRef<str> for MountBindOptionsPropagationEnum {
2262    fn as_ref(&self) -> &str {
2263        match self { 
2264            MountBindOptionsPropagationEnum::EMPTY => "",
2265            MountBindOptionsPropagationEnum::PRIVATE => "private",
2266            MountBindOptionsPropagationEnum::RPRIVATE => "rprivate",
2267            MountBindOptionsPropagationEnum::SHARED => "shared",
2268            MountBindOptionsPropagationEnum::RSHARED => "rshared",
2269            MountBindOptionsPropagationEnum::SLAVE => "slave",
2270            MountBindOptionsPropagationEnum::RSLAVE => "rslave",
2271        }
2272    }
2273}
2274
2275/// A mount point inside a container
2276#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2277pub struct MountPoint {
2278    #[serde(rename = "Type")]
2279    #[serde(skip_serializing_if="Option::is_none")]
2280    pub typ: Option<String>,
2281
2282    #[serde(rename = "Name")]
2283    #[serde(skip_serializing_if="Option::is_none")]
2284    pub name: Option<String>,
2285
2286    #[serde(rename = "Source")]
2287    #[serde(skip_serializing_if="Option::is_none")]
2288    pub source: Option<String>,
2289
2290    #[serde(rename = "Destination")]
2291    #[serde(skip_serializing_if="Option::is_none")]
2292    pub destination: Option<String>,
2293
2294    #[serde(rename = "Driver")]
2295    #[serde(skip_serializing_if="Option::is_none")]
2296    pub driver: Option<String>,
2297
2298    #[serde(rename = "Mode")]
2299    #[serde(skip_serializing_if="Option::is_none")]
2300    pub mode: Option<String>,
2301
2302    #[serde(rename = "RW")]
2303    #[serde(skip_serializing_if="Option::is_none")]
2304    pub rw: Option<bool>,
2305
2306    #[serde(rename = "Propagation")]
2307    #[serde(skip_serializing_if="Option::is_none")]
2308    pub propagation: Option<String>,
2309
2310}
2311
2312/// Optional configuration for the `tmpfs` type.
2313#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2314pub struct MountTmpfsOptions {
2315    /// The size for the tmpfs mount in bytes.
2316    #[serde(rename = "SizeBytes")]
2317    #[serde(skip_serializing_if="Option::is_none")]
2318    pub size_bytes: Option<i64>,
2319
2320    /// The permission mode for the tmpfs mount in an integer.
2321    #[serde(rename = "Mode")]
2322    #[serde(skip_serializing_if="Option::is_none")]
2323    pub mode: Option<i64>,
2324
2325}
2326
2327/// Optional configuration for the `volume` type.
2328#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2329pub struct MountVolumeOptions {
2330    /// Populate volume with data from the target.
2331    #[serde(rename = "NoCopy")]
2332    #[serde(skip_serializing_if="Option::is_none")]
2333    pub no_copy: Option<bool>,
2334
2335    /// User-defined key/value metadata.
2336    #[serde(rename = "Labels")]
2337    #[serde(skip_serializing_if="Option::is_none")]
2338    pub labels: Option<HashMap<String, String>>,
2339
2340    #[serde(rename = "DriverConfig")]
2341    #[serde(skip_serializing_if="Option::is_none")]
2342    pub driver_config: Option<MountVolumeOptionsDriverConfig>,
2343
2344}
2345
2346/// Map of driver specific options
2347#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2348pub struct MountVolumeOptionsDriverConfig {
2349    /// Name of the driver to use to create the volume.
2350    #[serde(rename = "Name")]
2351    #[serde(skip_serializing_if="Option::is_none")]
2352    pub name: Option<String>,
2353
2354    /// key/value map of driver specific options.
2355    #[serde(rename = "Options")]
2356    #[serde(skip_serializing_if="Option::is_none")]
2357    pub options: Option<HashMap<String, String>>,
2358
2359}
2360
2361#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2362pub struct Network {
2363    #[serde(rename = "Name")]
2364    #[serde(skip_serializing_if="Option::is_none")]
2365    pub name: Option<String>,
2366
2367    #[serde(rename = "Id")]
2368    #[serde(skip_serializing_if="Option::is_none")]
2369    pub id: Option<String>,
2370
2371    #[serde(rename = "Created")]
2372    #[serde(skip_serializing_if="Option::is_none")]
2373    pub created: Option<DateTime<Utc>>,
2374
2375    #[serde(rename = "Scope")]
2376    #[serde(skip_serializing_if="Option::is_none")]
2377    pub scope: Option<String>,
2378
2379    #[serde(rename = "Driver")]
2380    #[serde(skip_serializing_if="Option::is_none")]
2381    pub driver: Option<String>,
2382
2383    #[serde(rename = "EnableIPv6")]
2384    #[serde(skip_serializing_if="Option::is_none")]
2385    pub enable_ipv6: Option<bool>,
2386
2387    #[serde(rename = "IPAM")]
2388    #[serde(skip_serializing_if="Option::is_none")]
2389    pub ipam: Option<Ipam>,
2390
2391    #[serde(rename = "Internal")]
2392    #[serde(skip_serializing_if="Option::is_none")]
2393    pub internal: Option<bool>,
2394
2395    #[serde(rename = "Attachable")]
2396    #[serde(skip_serializing_if="Option::is_none")]
2397    pub attachable: Option<bool>,
2398
2399    #[serde(rename = "Ingress")]
2400    #[serde(skip_serializing_if="Option::is_none")]
2401    pub ingress: Option<bool>,
2402
2403    #[serde(rename = "Containers")]
2404    #[serde(skip_serializing_if="Option::is_none")]
2405    pub containers: Option<HashMap<String, NetworkContainer>>,
2406
2407    #[serde(rename = "Options")]
2408    #[serde(skip_serializing_if="Option::is_none")]
2409    pub options: Option<HashMap<String, String>>,
2410
2411    #[serde(rename = "Labels")]
2412    #[serde(skip_serializing_if="Option::is_none")]
2413    pub labels: Option<HashMap<String, String>>,
2414
2415}
2416
2417/// Specifies how a service should be attached to a particular network. 
2418#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2419pub struct NetworkAttachmentConfig {
2420    /// The target network for attachment. Must be a network name or ID. 
2421    #[serde(rename = "Target")]
2422    #[serde(skip_serializing_if="Option::is_none")]
2423    pub target: Option<String>,
2424
2425    /// Discoverable alternate names for the service on this network. 
2426    #[serde(rename = "Aliases")]
2427    #[serde(skip_serializing_if="Option::is_none")]
2428    pub aliases: Option<Vec<String>>,
2429
2430    /// Driver attachment options for the network target. 
2431    #[serde(rename = "DriverOpts")]
2432    #[serde(skip_serializing_if="Option::is_none")]
2433    pub driver_opts: Option<HashMap<String, String>>,
2434
2435}
2436
2437#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2438pub struct NetworkConfig {
2439    /// The network's name.
2440    #[serde(rename = "Name")]
2441    pub name: String,
2442
2443    /// Check for networks with duplicate names. Since Network is primarily keyed based on a random ID and not on the name, and network name is strictly a user-friendly alias to the network which is uniquely identified using ID, there is no guaranteed way to check for duplicates. CheckDuplicate is there to provide a best effort checking of any networks which has the same name but it is not guaranteed to catch all name collisions. 
2444    #[serde(rename = "CheckDuplicate")]
2445    #[serde(skip_serializing_if="Option::is_none")]
2446    pub check_duplicate: Option<bool>,
2447
2448    /// Name of the network driver plugin to use.
2449    #[serde(rename = "Driver")]
2450    #[serde(skip_serializing_if="Option::is_none")]
2451    pub driver: Option<String>,
2452
2453    /// Restrict external access to the network.
2454    #[serde(rename = "Internal")]
2455    #[serde(skip_serializing_if="Option::is_none")]
2456    pub internal: Option<bool>,
2457
2458    /// Globally scoped network is manually attachable by regular containers from workers in swarm mode. 
2459    #[serde(rename = "Attachable")]
2460    #[serde(skip_serializing_if="Option::is_none")]
2461    pub attachable: Option<bool>,
2462
2463    /// Ingress network is the network which provides the routing-mesh in swarm mode. 
2464    #[serde(rename = "Ingress")]
2465    #[serde(skip_serializing_if="Option::is_none")]
2466    pub ingress: Option<bool>,
2467
2468    /// Optional custom IP scheme for the network.
2469    #[serde(rename = "IPAM")]
2470    #[serde(skip_serializing_if="Option::is_none")]
2471    pub ipam: Option<Ipam>,
2472
2473    /// Enable IPv6 on the network.
2474    #[serde(rename = "EnableIPv6")]
2475    #[serde(skip_serializing_if="Option::is_none")]
2476    pub enable_ipv6: Option<bool>,
2477
2478    /// Network specific options to be used by the drivers.
2479    #[serde(rename = "Options")]
2480    #[serde(skip_serializing_if="Option::is_none")]
2481    pub options: Option<HashMap<String, String>>,
2482
2483    /// User-defined key/value metadata.
2484    #[serde(rename = "Labels")]
2485    #[serde(skip_serializing_if="Option::is_none")]
2486    pub labels: Option<HashMap<String, String>>,
2487
2488}
2489
2490#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2491pub struct NetworkContainer {
2492    #[serde(rename = "Name")]
2493    #[serde(skip_serializing_if="Option::is_none")]
2494    pub name: Option<String>,
2495
2496    #[serde(rename = "EndpointID")]
2497    #[serde(skip_serializing_if="Option::is_none")]
2498    pub endpoint_id: Option<String>,
2499
2500    #[serde(rename = "MacAddress")]
2501    #[serde(skip_serializing_if="Option::is_none")]
2502    pub mac_address: Option<String>,
2503
2504    #[serde(rename = "IPv4Address")]
2505    #[serde(skip_serializing_if="Option::is_none")]
2506    pub ipv4_address: Option<String>,
2507
2508    #[serde(rename = "IPv6Address")]
2509    #[serde(skip_serializing_if="Option::is_none")]
2510    pub ipv6_address: Option<String>,
2511
2512}
2513
2514#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2515pub struct NetworkCreateResponse {
2516    /// The ID of the created network.
2517    #[serde(rename = "Id")]
2518    #[serde(skip_serializing_if="Option::is_none")]
2519    pub id: Option<String>,
2520
2521    #[serde(rename = "Warning")]
2522    #[serde(skip_serializing_if="Option::is_none")]
2523    pub warning: Option<String>,
2524
2525}
2526
2527#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2528pub struct NetworkPruneResponse {
2529    /// Networks that were deleted
2530    #[serde(rename = "NetworksDeleted")]
2531    #[serde(skip_serializing_if="Option::is_none")]
2532    pub networks_deleted: Option<Vec<String>>,
2533
2534}
2535
2536/// NetworkSettings exposes the network settings in the API
2537#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2538pub struct NetworkSettings {
2539    /// Name of the network'a bridge (for example, `docker0`).
2540    #[serde(rename = "Bridge")]
2541    #[serde(skip_serializing_if="Option::is_none")]
2542    pub bridge: Option<String>,
2543
2544    /// SandboxID uniquely represents a container's network stack.
2545    #[serde(rename = "SandboxID")]
2546    #[serde(skip_serializing_if="Option::is_none")]
2547    pub sandbox_id: Option<String>,
2548
2549    /// Indicates if hairpin NAT should be enabled on the virtual interface. 
2550    #[serde(rename = "HairpinMode")]
2551    #[serde(skip_serializing_if="Option::is_none")]
2552    pub hairpin_mode: Option<bool>,
2553
2554    /// IPv6 unicast address using the link-local prefix.
2555    #[serde(rename = "LinkLocalIPv6Address")]
2556    #[serde(skip_serializing_if="Option::is_none")]
2557    pub link_local_ipv6_address: Option<String>,
2558
2559    /// Prefix length of the IPv6 unicast address.
2560    #[serde(rename = "LinkLocalIPv6PrefixLen")]
2561    #[serde(skip_serializing_if="Option::is_none")]
2562    pub link_local_ipv6_prefix_len: Option<i64>,
2563
2564    #[serde(rename = "Ports")]
2565    #[serde(skip_serializing_if="Option::is_none")]
2566    pub ports: Option<PortMap>,
2567
2568    /// SandboxKey identifies the sandbox
2569    #[serde(rename = "SandboxKey")]
2570    #[serde(skip_serializing_if="Option::is_none")]
2571    pub sandbox_key: Option<String>,
2572
2573    /// 
2574    #[serde(rename = "SecondaryIPAddresses")]
2575    #[serde(skip_serializing_if="Option::is_none")]
2576    pub secondary_ip_addresses: Option<Vec<Address>>,
2577
2578    /// 
2579    #[serde(rename = "SecondaryIPv6Addresses")]
2580    #[serde(skip_serializing_if="Option::is_none")]
2581    pub secondary_ipv6_addresses: Option<Vec<Address>>,
2582
2583    /// EndpointID uniquely represents a service endpoint in a Sandbox.  <p><br /></p>  > **Deprecated**: This field is only propagated when attached to the > default \"bridge\" network. Use the information from the \"bridge\" > network inside the `Networks` map instead, which contains the same > information. This field was deprecated in Docker 1.9 and is scheduled > to be removed in Docker 17.12.0 
2584    #[serde(rename = "EndpointID")]
2585    #[serde(skip_serializing_if="Option::is_none")]
2586    pub endpoint_id: Option<String>,
2587
2588    /// Gateway address for the default \"bridge\" network.  <p><br /></p>  > **Deprecated**: This field is only propagated when attached to the > default \"bridge\" network. Use the information from the \"bridge\" > network inside the `Networks` map instead, which contains the same > information. This field was deprecated in Docker 1.9 and is scheduled > to be removed in Docker 17.12.0 
2589    #[serde(rename = "Gateway")]
2590    #[serde(skip_serializing_if="Option::is_none")]
2591    pub gateway: Option<String>,
2592
2593    /// Global IPv6 address for the default \"bridge\" network.  <p><br /></p>  > **Deprecated**: This field is only propagated when attached to the > default \"bridge\" network. Use the information from the \"bridge\" > network inside the `Networks` map instead, which contains the same > information. This field was deprecated in Docker 1.9 and is scheduled > to be removed in Docker 17.12.0 
2594    #[serde(rename = "GlobalIPv6Address")]
2595    #[serde(skip_serializing_if="Option::is_none")]
2596    pub global_ipv6_address: Option<String>,
2597
2598    /// Mask length of the global IPv6 address.  <p><br /></p>  > **Deprecated**: This field is only propagated when attached to the > default \"bridge\" network. Use the information from the \"bridge\" > network inside the `Networks` map instead, which contains the same > information. This field was deprecated in Docker 1.9 and is scheduled > to be removed in Docker 17.12.0 
2599    #[serde(rename = "GlobalIPv6PrefixLen")]
2600    #[serde(skip_serializing_if="Option::is_none")]
2601    pub global_ipv6_prefix_len: Option<i64>,
2602
2603    /// IPv4 address for the default \"bridge\" network.  <p><br /></p>  > **Deprecated**: This field is only propagated when attached to the > default \"bridge\" network. Use the information from the \"bridge\" > network inside the `Networks` map instead, which contains the same > information. This field was deprecated in Docker 1.9 and is scheduled > to be removed in Docker 17.12.0 
2604    #[serde(rename = "IPAddress")]
2605    #[serde(skip_serializing_if="Option::is_none")]
2606    pub ip_address: Option<String>,
2607
2608    /// Mask length of the IPv4 address.  <p><br /></p>  > **Deprecated**: This field is only propagated when attached to the > default \"bridge\" network. Use the information from the \"bridge\" > network inside the `Networks` map instead, which contains the same > information. This field was deprecated in Docker 1.9 and is scheduled > to be removed in Docker 17.12.0 
2609    #[serde(rename = "IPPrefixLen")]
2610    #[serde(skip_serializing_if="Option::is_none")]
2611    pub ip_prefix_len: Option<i64>,
2612
2613    /// IPv6 gateway address for this network.  <p><br /></p>  > **Deprecated**: This field is only propagated when attached to the > default \"bridge\" network. Use the information from the \"bridge\" > network inside the `Networks` map instead, which contains the same > information. This field was deprecated in Docker 1.9 and is scheduled > to be removed in Docker 17.12.0 
2614    #[serde(rename = "IPv6Gateway")]
2615    #[serde(skip_serializing_if="Option::is_none")]
2616    pub ipv6_gateway: Option<String>,
2617
2618    /// MAC address for the container on the default \"bridge\" network.  <p><br /></p>  > **Deprecated**: This field is only propagated when attached to the > default \"bridge\" network. Use the information from the \"bridge\" > network inside the `Networks` map instead, which contains the same > information. This field was deprecated in Docker 1.9 and is scheduled > to be removed in Docker 17.12.0 
2619    #[serde(rename = "MacAddress")]
2620    #[serde(skip_serializing_if="Option::is_none")]
2621    pub mac_address: Option<String>,
2622
2623    /// Information about all networks that the container is connected to. 
2624    #[serde(rename = "Networks")]
2625    #[serde(skip_serializing_if="Option::is_none")]
2626    pub networks: Option<HashMap<String, EndpointSettings>>,
2627
2628}
2629
2630/// NetworkingConfig represents the container's networking configuration for each of its interfaces. It is used for the networking configs specified in the `docker create` and `docker network connect` commands. 
2631#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2632pub struct NetworkingConfig {
2633    /// A mapping of network name to endpoint configuration for that network. 
2634    #[serde(rename = "EndpointsConfig")]
2635    #[serde(skip_serializing_if="Option::is_none")]
2636    pub endpoints_config: Option<HashMap<String, EndpointSettings>>,
2637
2638}
2639
2640#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2641pub struct Node {
2642    #[serde(rename = "ID")]
2643    #[serde(skip_serializing_if="Option::is_none")]
2644    pub id: Option<String>,
2645
2646    #[serde(rename = "Version")]
2647    #[serde(skip_serializing_if="Option::is_none")]
2648    pub version: Option<ObjectVersion>,
2649
2650    /// Date and time at which the node was added to the swarm in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
2651    #[serde(rename = "CreatedAt")]
2652    #[serde(skip_serializing_if="Option::is_none")]
2653    pub created_at: Option<DateTime<Utc>>,
2654
2655    /// Date and time at which the node was last updated in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
2656    #[serde(rename = "UpdatedAt")]
2657    #[serde(skip_serializing_if="Option::is_none")]
2658    pub updated_at: Option<DateTime<Utc>>,
2659
2660    #[serde(rename = "Spec")]
2661    #[serde(skip_serializing_if="Option::is_none")]
2662    pub spec: Option<NodeSpec>,
2663
2664    #[serde(rename = "Description")]
2665    #[serde(skip_serializing_if="Option::is_none")]
2666    pub description: Option<NodeDescription>,
2667
2668    #[serde(rename = "Status")]
2669    #[serde(skip_serializing_if="Option::is_none")]
2670    pub status: Option<NodeStatus>,
2671
2672    #[serde(rename = "ManagerStatus")]
2673    #[serde(skip_serializing_if="Option::is_none")]
2674    pub manager_status: Option<ManagerStatus>,
2675
2676}
2677
2678/// NodeDescription encapsulates the properties of the Node as reported by the agent. 
2679#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2680pub struct NodeDescription {
2681    #[serde(rename = "Hostname")]
2682    #[serde(skip_serializing_if="Option::is_none")]
2683    pub hostname: Option<String>,
2684
2685    #[serde(rename = "Platform")]
2686    #[serde(skip_serializing_if="Option::is_none")]
2687    pub platform: Option<Platform>,
2688
2689    #[serde(rename = "Resources")]
2690    #[serde(skip_serializing_if="Option::is_none")]
2691    pub resources: Option<ResourceObject>,
2692
2693    #[serde(rename = "Engine")]
2694    #[serde(skip_serializing_if="Option::is_none")]
2695    pub engine: Option<EngineDescription>,
2696
2697    #[serde(rename = "TLSInfo")]
2698    #[serde(skip_serializing_if="Option::is_none")]
2699    pub tls_info: Option<TlsInfo>,
2700
2701}
2702
2703#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2704pub struct NodeSpec {
2705    /// Name for the node.
2706    #[serde(rename = "Name")]
2707    #[serde(skip_serializing_if="Option::is_none")]
2708    pub name: Option<String>,
2709
2710    /// User-defined key/value metadata.
2711    #[serde(rename = "Labels")]
2712    #[serde(skip_serializing_if="Option::is_none")]
2713    pub labels: Option<HashMap<String, String>>,
2714
2715    /// Role of the node.
2716    #[serde(rename = "Role")]
2717    #[serde(skip_serializing_if="Option::is_none")]
2718    pub role: Option<NodeSpecRoleEnum>,
2719
2720    /// Availability of the node.
2721    #[serde(rename = "Availability")]
2722    #[serde(skip_serializing_if="Option::is_none")]
2723    pub availability: Option<NodeSpecAvailabilityEnum>,
2724
2725}
2726
2727#[allow(non_camel_case_types)]
2728#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
2729pub enum NodeSpecRoleEnum { 
2730    #[serde(rename = "")]
2731    EMPTY,
2732    #[serde(rename = "worker")]
2733    WORKER,
2734    #[serde(rename = "manager")]
2735    MANAGER,
2736}
2737
2738impl ::std::fmt::Display for NodeSpecRoleEnum {
2739    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
2740        match *self { 
2741            NodeSpecRoleEnum::EMPTY => write!(f, ""),
2742            NodeSpecRoleEnum::WORKER => write!(f, "{}", "worker"),
2743            NodeSpecRoleEnum::MANAGER => write!(f, "{}", "manager"),
2744
2745        }
2746    }
2747}
2748
2749impl ::std::str::FromStr for NodeSpecRoleEnum {
2750    type Err = String;
2751    fn from_str(s: &str) -> Result<Self, Self::Err> {
2752        match s { 
2753            "" => Ok(NodeSpecRoleEnum::EMPTY),
2754            "worker" => Ok(NodeSpecRoleEnum::WORKER),
2755            "manager" => Ok(NodeSpecRoleEnum::MANAGER),
2756            x => Err(format!("Invalid enum type: {}", x)),
2757        }
2758    }
2759}
2760
2761impl ::std::convert::AsRef<str> for NodeSpecRoleEnum {
2762    fn as_ref(&self) -> &str {
2763        match self { 
2764            NodeSpecRoleEnum::EMPTY => "",
2765            NodeSpecRoleEnum::WORKER => "worker",
2766            NodeSpecRoleEnum::MANAGER => "manager",
2767        }
2768    }
2769}
2770
2771#[allow(non_camel_case_types)]
2772#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
2773pub enum NodeSpecAvailabilityEnum { 
2774    #[serde(rename = "")]
2775    EMPTY,
2776    #[serde(rename = "active")]
2777    ACTIVE,
2778    #[serde(rename = "pause")]
2779    PAUSE,
2780    #[serde(rename = "drain")]
2781    DRAIN,
2782}
2783
2784impl ::std::fmt::Display for NodeSpecAvailabilityEnum {
2785    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
2786        match *self { 
2787            NodeSpecAvailabilityEnum::EMPTY => write!(f, ""),
2788            NodeSpecAvailabilityEnum::ACTIVE => write!(f, "{}", "active"),
2789            NodeSpecAvailabilityEnum::PAUSE => write!(f, "{}", "pause"),
2790            NodeSpecAvailabilityEnum::DRAIN => write!(f, "{}", "drain"),
2791
2792        }
2793    }
2794}
2795
2796impl ::std::str::FromStr for NodeSpecAvailabilityEnum {
2797    type Err = String;
2798    fn from_str(s: &str) -> Result<Self, Self::Err> {
2799        match s { 
2800            "" => Ok(NodeSpecAvailabilityEnum::EMPTY),
2801            "active" => Ok(NodeSpecAvailabilityEnum::ACTIVE),
2802            "pause" => Ok(NodeSpecAvailabilityEnum::PAUSE),
2803            "drain" => Ok(NodeSpecAvailabilityEnum::DRAIN),
2804            x => Err(format!("Invalid enum type: {}", x)),
2805        }
2806    }
2807}
2808
2809impl ::std::convert::AsRef<str> for NodeSpecAvailabilityEnum {
2810    fn as_ref(&self) -> &str {
2811        match self { 
2812            NodeSpecAvailabilityEnum::EMPTY => "",
2813            NodeSpecAvailabilityEnum::ACTIVE => "active",
2814            NodeSpecAvailabilityEnum::PAUSE => "pause",
2815            NodeSpecAvailabilityEnum::DRAIN => "drain",
2816        }
2817    }
2818}
2819
2820/// NodeState represents the state of a node.
2821/// Enumeration of values.
2822/// Since this enum's variants do not hold data, we can easily define them them as `#[repr(C)]`
2823/// which helps with FFI.
2824#[allow(non_camel_case_types)]
2825#[repr(C)]
2826#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
2827pub enum NodeState { 
2828    #[serde(rename = "unknown")]
2829    UNKNOWN,
2830    #[serde(rename = "down")]
2831    DOWN,
2832    #[serde(rename = "ready")]
2833    READY,
2834    #[serde(rename = "disconnected")]
2835    DISCONNECTED,
2836}
2837
2838impl ::std::fmt::Display for NodeState {
2839    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
2840        match *self { 
2841            NodeState::UNKNOWN => write!(f, "{}", "unknown"),
2842            NodeState::DOWN => write!(f, "{}", "down"),
2843            NodeState::READY => write!(f, "{}", "ready"),
2844            NodeState::DISCONNECTED => write!(f, "{}", "disconnected"),
2845        }
2846    }
2847}
2848
2849impl ::std::str::FromStr for NodeState {
2850    type Err = ();
2851    fn from_str(s: &str) -> Result<Self, Self::Err> {
2852        match s {
2853            "unknown" => Ok(NodeState::UNKNOWN),
2854            "down" => Ok(NodeState::DOWN),
2855            "ready" => Ok(NodeState::READY),
2856            "disconnected" => Ok(NodeState::DISCONNECTED),
2857            _ => Err(()),
2858        }
2859    }
2860}
2861
2862/// NodeStatus represents the status of a node.  It provides the current status of the node, as seen by the manager. 
2863#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2864pub struct NodeStatus {
2865    #[serde(rename = "State")]
2866    #[serde(skip_serializing_if="Option::is_none")]
2867    pub state: Option<NodeState>,
2868
2869    #[serde(rename = "Message")]
2870    #[serde(skip_serializing_if="Option::is_none")]
2871    pub message: Option<String>,
2872
2873    /// IP address of the node.
2874    #[serde(rename = "Addr")]
2875    #[serde(skip_serializing_if="Option::is_none")]
2876    pub addr: Option<String>,
2877
2878}
2879
2880/// The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. The client must send the version number along with the modified specification when updating these objects.  This approach ensures safe concurrency and determinism in that the change on the object may not be applied if the version number has changed from the last read. In other words, if two update requests specify the same base version, only one of the requests can succeed. As a result, two separate update requests that happen at the same time will not unintentionally overwrite each other. 
2881#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2882pub struct ObjectVersion {
2883    #[serde(rename = "Index")]
2884    #[serde(skip_serializing_if="Option::is_none")]
2885    pub index: Option<u64>,
2886
2887}
2888
2889/// Represents a peer-node in the swarm
2890#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2891pub struct PeerNode {
2892    /// Unique identifier of for this node in the swarm.
2893    #[serde(rename = "NodeID")]
2894    #[serde(skip_serializing_if="Option::is_none")]
2895    pub node_id: Option<String>,
2896
2897    /// IP address and ports at which this node can be reached. 
2898    #[serde(rename = "Addr")]
2899    #[serde(skip_serializing_if="Option::is_none")]
2900    pub addr: Option<String>,
2901
2902}
2903
2904/// Platform represents the platform (Arch/OS). 
2905#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2906pub struct Platform {
2907    /// Architecture represents the hardware architecture (for example, `x86_64`). 
2908    #[serde(rename = "Architecture")]
2909    #[serde(skip_serializing_if="Option::is_none")]
2910    pub architecture: Option<String>,
2911
2912    /// OS represents the Operating System (for example, `linux` or `windows`). 
2913    #[serde(rename = "OS")]
2914    #[serde(skip_serializing_if="Option::is_none")]
2915    pub os: Option<String>,
2916
2917}
2918
2919/// A plugin for the Engine API
2920#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2921pub struct Plugin {
2922    #[serde(rename = "Id")]
2923    #[serde(skip_serializing_if="Option::is_none")]
2924    pub id: Option<String>,
2925
2926    #[serde(rename = "Name")]
2927    pub name: String,
2928
2929    /// True if the plugin is running. False if the plugin is not running, only installed.
2930    #[serde(rename = "Enabled")]
2931    pub enabled: bool,
2932
2933    #[serde(rename = "Settings")]
2934    pub settings: PluginSettings,
2935
2936    /// plugin remote reference used to push/pull the plugin
2937    #[serde(rename = "PluginReference")]
2938    #[serde(skip_serializing_if="Option::is_none")]
2939    pub plugin_reference: Option<String>,
2940
2941    #[serde(rename = "Config")]
2942    pub config: PluginConfig,
2943
2944}
2945
2946/// The config of a plugin.
2947#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2948pub struct PluginConfig {
2949    /// Docker Version used to create the plugin
2950    #[serde(rename = "DockerVersion")]
2951    #[serde(skip_serializing_if="Option::is_none")]
2952    pub docker_version: Option<String>,
2953
2954    #[serde(rename = "Description")]
2955    pub description: String,
2956
2957    #[serde(rename = "Documentation")]
2958    pub documentation: String,
2959
2960    #[serde(rename = "Interface")]
2961    pub interface: PluginConfigInterface,
2962
2963    #[serde(rename = "Entrypoint")]
2964    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
2965    pub entrypoint: Vec<String>,
2966
2967    #[serde(rename = "WorkDir")]
2968    pub work_dir: String,
2969
2970    #[serde(rename = "User")]
2971    #[serde(skip_serializing_if="Option::is_none")]
2972    pub user: Option<PluginConfigUser>,
2973
2974    #[serde(rename = "Network")]
2975    pub network: PluginConfigNetwork,
2976
2977    #[serde(rename = "Linux")]
2978    pub linux: PluginConfigLinux,
2979
2980    #[serde(rename = "PropagatedMount")]
2981    pub propagated_mount: String,
2982
2983    #[serde(rename = "IpcHost")]
2984    pub ipc_host: bool,
2985
2986    #[serde(rename = "PidHost")]
2987    pub pid_host: bool,
2988
2989    #[serde(rename = "Mounts")]
2990    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
2991    pub mounts: Vec<PluginMount>,
2992
2993    #[serde(rename = "Env")]
2994    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
2995    pub env: Vec<PluginEnv>,
2996
2997    #[serde(rename = "Args")]
2998    pub args: PluginConfigArgs,
2999
3000    #[serde(rename = "rootfs")]
3001    #[serde(skip_serializing_if="Option::is_none")]
3002    pub rootfs: Option<PluginConfigRootfs>,
3003
3004}
3005
3006#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3007pub struct PluginConfigArgs {
3008    #[serde(rename = "Name")]
3009    pub name: String,
3010
3011    #[serde(rename = "Description")]
3012    pub description: String,
3013
3014    #[serde(rename = "Settable")]
3015    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
3016    pub settable: Vec<String>,
3017
3018    #[serde(rename = "Value")]
3019    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
3020    pub value: Vec<String>,
3021
3022}
3023
3024/// The interface between Docker and the plugin
3025#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3026pub struct PluginConfigInterface {
3027    #[serde(rename = "Types")]
3028    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
3029    pub types: Vec<PluginInterfaceType>,
3030
3031    #[serde(rename = "Socket")]
3032    pub socket: String,
3033
3034    /// Protocol to use for clients connecting to the plugin.
3035    #[serde(rename = "ProtocolScheme")]
3036    #[serde(skip_serializing_if="Option::is_none")]
3037    pub protocol_scheme: Option<PluginConfigInterfaceProtocolSchemeEnum>,
3038
3039}
3040
3041#[allow(non_camel_case_types)]
3042#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
3043pub enum PluginConfigInterfaceProtocolSchemeEnum { 
3044    #[serde(rename = "")]
3045    EMPTY,
3046    #[serde(rename = "moby.plugins.http/v1")]
3047    MOBY_PLUGINS_HTTP_V1,
3048}
3049
3050impl ::std::fmt::Display for PluginConfigInterfaceProtocolSchemeEnum {
3051    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
3052        match *self { 
3053            PluginConfigInterfaceProtocolSchemeEnum::EMPTY => write!(f, "{}", ""),
3054            PluginConfigInterfaceProtocolSchemeEnum::MOBY_PLUGINS_HTTP_V1 => write!(f, "{}", "moby.plugins.http/v1"),
3055
3056        }
3057    }
3058}
3059
3060impl ::std::str::FromStr for PluginConfigInterfaceProtocolSchemeEnum {
3061    type Err = String;
3062    fn from_str(s: &str) -> Result<Self, Self::Err> {
3063        match s { 
3064            "" => Ok(PluginConfigInterfaceProtocolSchemeEnum::EMPTY),
3065            "moby.plugins.http/v1" => Ok(PluginConfigInterfaceProtocolSchemeEnum::MOBY_PLUGINS_HTTP_V1),
3066            x => Err(format!("Invalid enum type: {}", x)),
3067        }
3068    }
3069}
3070
3071impl ::std::convert::AsRef<str> for PluginConfigInterfaceProtocolSchemeEnum {
3072    fn as_ref(&self) -> &str {
3073        match self { 
3074            PluginConfigInterfaceProtocolSchemeEnum::EMPTY => "",
3075            PluginConfigInterfaceProtocolSchemeEnum::MOBY_PLUGINS_HTTP_V1 => "moby.plugins.http/v1",
3076        }
3077    }
3078}
3079
3080#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3081pub struct PluginConfigLinux {
3082    #[serde(rename = "Capabilities")]
3083    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
3084    pub capabilities: Vec<String>,
3085
3086    #[serde(rename = "AllowAllDevices")]
3087    pub allow_all_devices: bool,
3088
3089    #[serde(rename = "Devices")]
3090    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
3091    pub devices: Vec<PluginDevice>,
3092
3093}
3094
3095#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3096pub struct PluginConfigNetwork {
3097    #[serde(rename = "Type")]
3098    pub typ: String,
3099
3100}
3101
3102#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3103pub struct PluginConfigRootfs {
3104    #[serde(rename = "type")]
3105    #[serde(skip_serializing_if="Option::is_none")]
3106    pub typ: Option<String>,
3107
3108    #[serde(rename = "diff_ids")]
3109    #[serde(skip_serializing_if="Option::is_none")]
3110    pub diff_ids: Option<Vec<String>>,
3111
3112}
3113
3114#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3115pub struct PluginConfigUser {
3116    #[serde(rename = "UID")]
3117    #[serde(skip_serializing_if="Option::is_none")]
3118    pub uid: Option<u32>,
3119
3120    #[serde(rename = "GID")]
3121    #[serde(skip_serializing_if="Option::is_none")]
3122    pub gid: Option<u32>,
3123
3124}
3125
3126#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3127pub struct PluginDevice {
3128    #[serde(rename = "Name")]
3129    pub name: String,
3130
3131    #[serde(rename = "Description")]
3132    pub description: String,
3133
3134    #[serde(rename = "Settable")]
3135    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
3136    pub settable: Vec<String>,
3137
3138    #[serde(rename = "Path")]
3139    pub path: String,
3140
3141}
3142
3143#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3144pub struct PluginEnv {
3145    #[serde(rename = "Name")]
3146    pub name: String,
3147
3148    #[serde(rename = "Description")]
3149    pub description: String,
3150
3151    #[serde(rename = "Settable")]
3152    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
3153    pub settable: Vec<String>,
3154
3155    #[serde(rename = "Value")]
3156    pub value: String,
3157
3158}
3159
3160#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3161pub struct PluginInterfaceType {
3162    #[serde(rename = "Prefix")]
3163    pub prefix: String,
3164
3165    #[serde(rename = "Capability")]
3166    pub capability: String,
3167
3168    #[serde(rename = "Version")]
3169    pub version: String,
3170
3171}
3172
3173#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3174pub struct PluginMount {
3175    #[serde(rename = "Name")]
3176    pub name: String,
3177
3178    #[serde(rename = "Description")]
3179    pub description: String,
3180
3181    #[serde(rename = "Settable")]
3182    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
3183    pub settable: Vec<String>,
3184
3185    #[serde(rename = "Source")]
3186    pub source: String,
3187
3188    #[serde(rename = "Destination")]
3189    pub destination: String,
3190
3191    #[serde(rename = "Type")]
3192    pub typ: String,
3193
3194    #[serde(rename = "Options")]
3195    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
3196    pub options: Vec<String>,
3197
3198}
3199
3200/// Describes a permission the user has to accept upon installing the plugin. 
3201#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3202pub struct PluginPrivilegeItem {
3203    #[serde(rename = "Name")]
3204    #[serde(skip_serializing_if="Option::is_none")]
3205    pub name: Option<String>,
3206
3207    #[serde(rename = "Description")]
3208    #[serde(skip_serializing_if="Option::is_none")]
3209    pub description: Option<String>,
3210
3211    #[serde(rename = "Value")]
3212    #[serde(skip_serializing_if="Option::is_none")]
3213    pub value: Option<Vec<String>>,
3214
3215}
3216
3217/// Settings that can be modified by users.
3218#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3219pub struct PluginSettings {
3220    #[serde(rename = "Mounts")]
3221    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
3222    pub mounts: Vec<PluginMount>,
3223
3224    #[serde(rename = "Env")]
3225    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
3226    pub env: Vec<String>,
3227
3228    #[serde(rename = "Args")]
3229    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
3230    pub args: Vec<String>,
3231
3232    #[serde(rename = "Devices")]
3233    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
3234    pub devices: Vec<PluginDevice>,
3235
3236}
3237
3238/// Available plugins per type.  <p><br /></p>  > **Note**: Only unmanaged (V1) plugins are included in this list. > V1 plugins are \"lazily\" loaded, and are not returned in this list > if there is no resource using the plugin. 
3239#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3240pub struct PluginsInfo {
3241    /// Names of available volume-drivers, and network-driver plugins.
3242    #[serde(rename = "Volume")]
3243    #[serde(skip_serializing_if="Option::is_none")]
3244    pub volume: Option<Vec<String>>,
3245
3246    /// Names of available network-drivers, and network-driver plugins.
3247    #[serde(rename = "Network")]
3248    #[serde(skip_serializing_if="Option::is_none")]
3249    pub network: Option<Vec<String>>,
3250
3251    /// Names of available authorization plugins.
3252    #[serde(rename = "Authorization")]
3253    #[serde(skip_serializing_if="Option::is_none")]
3254    pub authorization: Option<Vec<String>>,
3255
3256    /// Names of available logging-drivers, and logging-driver plugins.
3257    #[serde(rename = "Log")]
3258    #[serde(skip_serializing_if="Option::is_none")]
3259    pub log: Option<Vec<String>>,
3260
3261}
3262
3263/// An open port on a container
3264#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3265pub struct Port {
3266    /// Host IP address that the container's port is mapped to
3267    #[serde(rename = "IP")]
3268    #[serde(skip_serializing_if="Option::is_none")]
3269    pub ip: Option<String>,
3270
3271    /// Port on the container
3272    #[serde(rename = "PrivatePort")]
3273    pub private_port: i64,
3274
3275    /// Port exposed on the host
3276    #[serde(rename = "PublicPort")]
3277    #[serde(skip_serializing_if="Option::is_none")]
3278    pub public_port: Option<i64>,
3279
3280    #[serde(rename = "Type")]
3281    #[serde(skip_serializing_if="Option::is_none")]
3282    #[serde(with = "serde_with::rust::string_empty_as_none")]
3283    pub typ: Option<PortTypeEnum>,
3284
3285}
3286
3287#[allow(non_camel_case_types)]
3288#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
3289pub enum PortTypeEnum { 
3290    #[serde(rename = "")]
3291    EMPTY,
3292    #[serde(rename = "tcp")]
3293    TCP,
3294    #[serde(rename = "udp")]
3295    UDP,
3296    #[serde(rename = "sctp")]
3297    SCTP,
3298}
3299
3300impl ::std::fmt::Display for PortTypeEnum {
3301    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
3302        match *self { 
3303            PortTypeEnum::EMPTY => write!(f, ""),
3304            PortTypeEnum::TCP => write!(f, "{}", "tcp"),
3305            PortTypeEnum::UDP => write!(f, "{}", "udp"),
3306            PortTypeEnum::SCTP => write!(f, "{}", "sctp"),
3307
3308        }
3309    }
3310}
3311
3312impl ::std::str::FromStr for PortTypeEnum {
3313    type Err = String;
3314    fn from_str(s: &str) -> Result<Self, Self::Err> {
3315        match s { 
3316            "" => Ok(PortTypeEnum::EMPTY),
3317            "tcp" => Ok(PortTypeEnum::TCP),
3318            "udp" => Ok(PortTypeEnum::UDP),
3319            "sctp" => Ok(PortTypeEnum::SCTP),
3320            x => Err(format!("Invalid enum type: {}", x)),
3321        }
3322    }
3323}
3324
3325impl ::std::convert::AsRef<str> for PortTypeEnum {
3326    fn as_ref(&self) -> &str {
3327        match self { 
3328            PortTypeEnum::EMPTY => "",
3329            PortTypeEnum::TCP => "tcp",
3330            PortTypeEnum::UDP => "udp",
3331            PortTypeEnum::SCTP => "sctp",
3332        }
3333    }
3334}
3335
3336/// PortBinding represents a binding between a host IP address and a host port. 
3337#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3338pub struct PortBinding {
3339    /// Host IP address that the container's port is mapped to.
3340    #[serde(rename = "HostIp")]
3341    #[serde(skip_serializing_if="Option::is_none")]
3342    pub host_ip: Option<String>,
3343
3344    /// Host port number that the container's port is mapped to.
3345    #[serde(rename = "HostPort")]
3346    #[serde(skip_serializing_if="Option::is_none")]
3347    pub host_port: Option<String>,
3348
3349}
3350
3351/// PortMap describes the mapping of container ports to host ports, using the container's port-number and protocol as key in the format `<port>/<protocol>`, for example, `80/udp`.  If a container's port is mapped for multiple protocols, separate entries are added to the mapping table. 
3352// special-casing PortMap, cos swagger-codegen doesn't figure out this type
3353pub type PortMap = HashMap<String, Option<Vec<PortBinding>>>;
3354
3355#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3356pub struct ProcessConfig {
3357    #[serde(rename = "privileged")]
3358    #[serde(skip_serializing_if="Option::is_none")]
3359    pub privileged: Option<bool>,
3360
3361    #[serde(rename = "user")]
3362    #[serde(skip_serializing_if="Option::is_none")]
3363    pub user: Option<String>,
3364
3365    #[serde(rename = "tty")]
3366    #[serde(skip_serializing_if="Option::is_none")]
3367    pub tty: Option<bool>,
3368
3369    #[serde(rename = "entrypoint")]
3370    #[serde(skip_serializing_if="Option::is_none")]
3371    pub entrypoint: Option<String>,
3372
3373    #[serde(rename = "arguments")]
3374    #[serde(skip_serializing_if="Option::is_none")]
3375    pub arguments: Option<Vec<String>>,
3376
3377}
3378
3379#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3380pub struct ProgressDetail {
3381    #[serde(rename = "current")]
3382    #[serde(skip_serializing_if="Option::is_none")]
3383    pub current: Option<i64>,
3384
3385    #[serde(rename = "total")]
3386    #[serde(skip_serializing_if="Option::is_none")]
3387    pub total: Option<i64>,
3388
3389}
3390
3391#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3392pub struct PushImageInfo {
3393    #[serde(rename = "error")]
3394    #[serde(skip_serializing_if="Option::is_none")]
3395    pub error: Option<String>,
3396
3397    #[serde(rename = "status")]
3398    #[serde(skip_serializing_if="Option::is_none")]
3399    pub status: Option<String>,
3400
3401    #[serde(rename = "progress")]
3402    #[serde(skip_serializing_if="Option::is_none")]
3403    pub progress: Option<String>,
3404
3405    #[serde(rename = "progressDetail")]
3406    #[serde(skip_serializing_if="Option::is_none")]
3407    pub progress_detail: Option<ProgressDetail>,
3408
3409}
3410
3411/// Reachability represents the reachability of a node.
3412/// Enumeration of values.
3413/// Since this enum's variants do not hold data, we can easily define them them as `#[repr(C)]`
3414/// which helps with FFI.
3415#[allow(non_camel_case_types)]
3416#[repr(C)]
3417#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
3418pub enum Reachability { 
3419    #[serde(rename = "unknown")]
3420    UNKNOWN,
3421    #[serde(rename = "unreachable")]
3422    UNREACHABLE,
3423    #[serde(rename = "reachable")]
3424    REACHABLE,
3425}
3426
3427impl ::std::fmt::Display for Reachability {
3428    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
3429        match *self { 
3430            Reachability::UNKNOWN => write!(f, "{}", "unknown"),
3431            Reachability::UNREACHABLE => write!(f, "{}", "unreachable"),
3432            Reachability::REACHABLE => write!(f, "{}", "reachable"),
3433        }
3434    }
3435}
3436
3437impl ::std::str::FromStr for Reachability {
3438    type Err = ();
3439    fn from_str(s: &str) -> Result<Self, Self::Err> {
3440        match s {
3441            "unknown" => Ok(Reachability::UNKNOWN),
3442            "unreachable" => Ok(Reachability::UNREACHABLE),
3443            "reachable" => Ok(Reachability::REACHABLE),
3444            _ => Err(()),
3445        }
3446    }
3447}
3448
3449/// RegistryServiceConfig stores daemon registry services configuration. 
3450#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3451pub struct RegistryServiceConfig {
3452    /// List of IP ranges to which nondistributable artifacts can be pushed, using the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632).  Some images (for example, Windows base images) contain artifacts whose distribution is restricted by license. When these images are pushed to a registry, restricted artifacts are not included.  This configuration override this behavior, and enables the daemon to push nondistributable artifacts to all registries whose resolved IP address is within the subnet described by the CIDR syntax.  This option is useful when pushing images containing nondistributable artifacts to a registry on an air-gapped network so hosts on that network can pull the images without connecting to another server.  > **Warning**: Nondistributable artifacts typically have restrictions > on how and where they can be distributed and shared. Only use this > feature to push artifacts to private registries and ensure that you > are in compliance with any terms that cover redistributing > nondistributable artifacts. 
3453    #[serde(rename = "AllowNondistributableArtifactsCIDRs")]
3454    #[serde(skip_serializing_if="Option::is_none")]
3455    pub allow_nondistributable_artifacts_cid_rs: Option<Vec<String>>,
3456
3457    /// List of registry hostnames to which nondistributable artifacts can be pushed, using the format `<hostname>[:<port>]` or `<IP address>[:<port>]`.  Some images (for example, Windows base images) contain artifacts whose distribution is restricted by license. When these images are pushed to a registry, restricted artifacts are not included.  This configuration override this behavior for the specified registries.  This option is useful when pushing images containing nondistributable artifacts to a registry on an air-gapped network so hosts on that network can pull the images without connecting to another server.  > **Warning**: Nondistributable artifacts typically have restrictions > on how and where they can be distributed and shared. Only use this > feature to push artifacts to private registries and ensure that you > are in compliance with any terms that cover redistributing > nondistributable artifacts. 
3458    #[serde(rename = "AllowNondistributableArtifactsHostnames")]
3459    #[serde(skip_serializing_if="Option::is_none")]
3460    pub allow_nondistributable_artifacts_hostnames: Option<Vec<String>>,
3461
3462    /// List of IP ranges of insecure registries, using the CIDR syntax ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from unknown CAs) communication.  By default, local registries (`127.0.0.0/8`) are configured as insecure. All other registries are secure. Communicating with an insecure registry is not possible if the daemon assumes that registry is secure.  This configuration override this behavior, insecure communication with registries whose resolved IP address is within the subnet described by the CIDR syntax.  Registries can also be marked insecure by hostname. Those registries are listed under `IndexConfigs` and have their `Secure` field set to `false`.  > **Warning**: Using this option can be useful when running a local > registry, but introduces security vulnerabilities. This option > should therefore ONLY be used for testing purposes. For increased > security, users should add their CA to their system's list of trusted > CAs instead of enabling this option. 
3463    #[serde(rename = "InsecureRegistryCIDRs")]
3464    #[serde(skip_serializing_if="Option::is_none")]
3465    pub insecure_registry_cid_rs: Option<Vec<String>>,
3466
3467    #[serde(rename = "IndexConfigs")]
3468    #[serde(skip_serializing_if="Option::is_none")]
3469    pub index_configs: Option<HashMap<String, IndexInfo>>,
3470
3471    /// List of registry URLs that act as a mirror for the official (`docker.io`) registry. 
3472    #[serde(rename = "Mirrors")]
3473    #[serde(skip_serializing_if="Option::is_none")]
3474    pub mirrors: Option<Vec<String>>,
3475
3476}
3477
3478/// An object describing the resources which can be advertised by a node and requested by a task. 
3479#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3480pub struct ResourceObject {
3481    #[serde(rename = "NanoCPUs")]
3482    #[serde(skip_serializing_if="Option::is_none")]
3483    pub nano_cp_us: Option<i64>,
3484
3485    #[serde(rename = "MemoryBytes")]
3486    #[serde(skip_serializing_if="Option::is_none")]
3487    pub memory_bytes: Option<i64>,
3488
3489    #[serde(rename = "GenericResources")]
3490    #[serde(skip_serializing_if="Option::is_none")]
3491    pub generic_resources: Option<GenericResources>,
3492
3493}
3494
3495/// A container's resources (cgroups config, ulimits, etc)
3496#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3497pub struct Resources {
3498    /// An integer value representing this container's relative CPU weight versus other containers. 
3499    #[serde(rename = "CpuShares")]
3500    #[serde(skip_serializing_if="Option::is_none")]
3501    pub cpu_shares: Option<i64>,
3502
3503    /// Memory limit in bytes.
3504    #[serde(rename = "Memory")]
3505    #[serde(skip_serializing_if="Option::is_none")]
3506    pub memory: Option<i64>,
3507
3508    /// Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist. 
3509    #[serde(rename = "CgroupParent")]
3510    #[serde(skip_serializing_if="Option::is_none")]
3511    pub cgroup_parent: Option<String>,
3512
3513    /// Block IO weight (relative weight).
3514    #[serde(rename = "BlkioWeight")]
3515    #[serde(skip_serializing_if="Option::is_none")]
3516    pub blkio_weight: Option<u16>,
3517
3518    /// Block IO weight (relative device weight) in the form:  ``` [{\"Path\": \"device_path\", \"Weight\": weight}] ``` 
3519    #[serde(rename = "BlkioWeightDevice")]
3520    #[serde(skip_serializing_if="Option::is_none")]
3521    pub blkio_weight_device: Option<Vec<ResourcesBlkioWeightDevice>>,
3522
3523    /// Limit read rate (bytes per second) from a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
3524    #[serde(rename = "BlkioDeviceReadBps")]
3525    #[serde(skip_serializing_if="Option::is_none")]
3526    pub blkio_device_read_bps: Option<Vec<ThrottleDevice>>,
3527
3528    /// Limit write rate (bytes per second) to a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
3529    #[serde(rename = "BlkioDeviceWriteBps")]
3530    #[serde(skip_serializing_if="Option::is_none")]
3531    pub blkio_device_write_bps: Option<Vec<ThrottleDevice>>,
3532
3533    /// Limit read rate (IO per second) from a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
3534    #[serde(rename = "BlkioDeviceReadIOps")]
3535    #[serde(skip_serializing_if="Option::is_none")]
3536    pub blkio_device_read_iops: Option<Vec<ThrottleDevice>>,
3537
3538    /// Limit write rate (IO per second) to a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
3539    #[serde(rename = "BlkioDeviceWriteIOps")]
3540    #[serde(skip_serializing_if="Option::is_none")]
3541    pub blkio_device_write_iops: Option<Vec<ThrottleDevice>>,
3542
3543    /// The length of a CPU period in microseconds.
3544    #[serde(rename = "CpuPeriod")]
3545    #[serde(skip_serializing_if="Option::is_none")]
3546    pub cpu_period: Option<i64>,
3547
3548    /// Microseconds of CPU time that the container can get in a CPU period. 
3549    #[serde(rename = "CpuQuota")]
3550    #[serde(skip_serializing_if="Option::is_none")]
3551    pub cpu_quota: Option<i64>,
3552
3553    /// The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. 
3554    #[serde(rename = "CpuRealtimePeriod")]
3555    #[serde(skip_serializing_if="Option::is_none")]
3556    pub cpu_realtime_period: Option<i64>,
3557
3558    /// The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. 
3559    #[serde(rename = "CpuRealtimeRuntime")]
3560    #[serde(skip_serializing_if="Option::is_none")]
3561    pub cpu_realtime_runtime: Option<i64>,
3562
3563    /// CPUs in which to allow execution (e.g., `0-3`, `0,1`). 
3564    #[serde(rename = "CpusetCpus")]
3565    #[serde(skip_serializing_if="Option::is_none")]
3566    pub cpuset_cpus: Option<String>,
3567
3568    /// Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. 
3569    #[serde(rename = "CpusetMems")]
3570    #[serde(skip_serializing_if="Option::is_none")]
3571    pub cpuset_mems: Option<String>,
3572
3573    /// A list of devices to add to the container.
3574    #[serde(rename = "Devices")]
3575    #[serde(skip_serializing_if="Option::is_none")]
3576    pub devices: Option<Vec<DeviceMapping>>,
3577
3578    /// a list of cgroup rules to apply to the container
3579    #[serde(rename = "DeviceCgroupRules")]
3580    #[serde(skip_serializing_if="Option::is_none")]
3581    pub device_cgroup_rules: Option<Vec<String>>,
3582
3583    /// A list of requests for devices to be sent to device drivers. 
3584    #[serde(rename = "DeviceRequests")]
3585    #[serde(skip_serializing_if="Option::is_none")]
3586    pub device_requests: Option<Vec<DeviceRequest>>,
3587
3588    /// Kernel memory limit in bytes.  <p><br /></p>  > **Deprecated**: This field is deprecated as the kernel 5.4 deprecated > `kmem.limit_in_bytes`. 
3589    #[serde(rename = "KernelMemory")]
3590    #[serde(skip_serializing_if="Option::is_none")]
3591    pub kernel_memory: Option<i64>,
3592
3593    /// Hard limit for kernel TCP buffer memory (in bytes).
3594    #[serde(rename = "KernelMemoryTCP")]
3595    #[serde(skip_serializing_if="Option::is_none")]
3596    pub kernel_memory_tcp: Option<i64>,
3597
3598    /// Memory soft limit in bytes.
3599    #[serde(rename = "MemoryReservation")]
3600    #[serde(skip_serializing_if="Option::is_none")]
3601    pub memory_reservation: Option<i64>,
3602
3603    /// Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. 
3604    #[serde(rename = "MemorySwap")]
3605    #[serde(skip_serializing_if="Option::is_none")]
3606    pub memory_swap: Option<i64>,
3607
3608    /// Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. 
3609    #[serde(rename = "MemorySwappiness")]
3610    #[serde(skip_serializing_if="Option::is_none")]
3611    pub memory_swappiness: Option<i64>,
3612
3613    /// CPU quota in units of 10<sup>-9</sup> CPUs.
3614    #[serde(rename = "NanoCpus")]
3615    #[serde(skip_serializing_if="Option::is_none")]
3616    pub nano_cpus: Option<i64>,
3617
3618    /// Disable OOM Killer for the container.
3619    #[serde(rename = "OomKillDisable")]
3620    #[serde(skip_serializing_if="Option::is_none")]
3621    pub oom_kill_disable: Option<bool>,
3622
3623    /// Run an init inside the container that forwards signals and reaps processes. This field is omitted if empty, and the default (as configured on the daemon) is used. 
3624    #[serde(rename = "Init")]
3625    #[serde(skip_serializing_if="Option::is_none")]
3626    pub init: Option<bool>,
3627
3628    /// Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` to not change. 
3629    #[serde(rename = "PidsLimit")]
3630    #[serde(skip_serializing_if="Option::is_none")]
3631    pub pids_limit: Option<i64>,
3632
3633    /// A list of resource limits to set in the container. For example:  ``` {\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048} ``` 
3634    #[serde(rename = "Ulimits")]
3635    #[serde(skip_serializing_if="Option::is_none")]
3636    pub ulimits: Option<Vec<ResourcesUlimits>>,
3637
3638    /// The number of usable CPUs (Windows only).  On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. 
3639    #[serde(rename = "CpuCount")]
3640    #[serde(skip_serializing_if="Option::is_none")]
3641    pub cpu_count: Option<i64>,
3642
3643    /// The usable percentage of the available CPUs (Windows only).  On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. 
3644    #[serde(rename = "CpuPercent")]
3645    #[serde(skip_serializing_if="Option::is_none")]
3646    pub cpu_percent: Option<i64>,
3647
3648    /// Maximum IOps for the container system drive (Windows only)
3649    #[serde(rename = "IOMaximumIOps")]
3650    #[serde(skip_serializing_if="Option::is_none")]
3651    pub io_maximum_iops: Option<i64>,
3652
3653    /// Maximum IO in bytes per second for the container system drive (Windows only). 
3654    #[serde(rename = "IOMaximumBandwidth")]
3655    #[serde(skip_serializing_if="Option::is_none")]
3656    pub io_maximum_bandwidth: Option<i64>,
3657
3658}
3659
3660#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3661pub struct ResourcesBlkioWeightDevice {
3662    #[serde(rename = "Path")]
3663    #[serde(skip_serializing_if="Option::is_none")]
3664    pub path: Option<String>,
3665
3666    #[serde(rename = "Weight")]
3667    #[serde(skip_serializing_if="Option::is_none")]
3668    pub weight: Option<usize>,
3669
3670}
3671
3672#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3673pub struct ResourcesUlimits {
3674    /// Name of ulimit
3675    #[serde(rename = "Name")]
3676    #[serde(skip_serializing_if="Option::is_none")]
3677    pub name: Option<String>,
3678
3679    /// Soft limit
3680    #[serde(rename = "Soft")]
3681    #[serde(skip_serializing_if="Option::is_none")]
3682    pub soft: Option<i64>,
3683
3684    /// Hard limit
3685    #[serde(rename = "Hard")]
3686    #[serde(skip_serializing_if="Option::is_none")]
3687    pub hard: Option<i64>,
3688
3689}
3690
3691/// The behavior to apply when the container exits. The default is not to restart.  An ever increasing delay (double the previous delay, starting at 100ms) is added before each restart to prevent flooding the server. 
3692#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3693pub struct RestartPolicy {
3694    /// - Empty string means not to restart - `always` Always restart - `unless-stopped` Restart always except when the user has manually stopped the container - `on-failure` Restart only when the container exit code is non-zero 
3695    #[serde(rename = "Name")]
3696    #[serde(skip_serializing_if="Option::is_none")]
3697    pub name: Option<RestartPolicyNameEnum>,
3698
3699    /// If `on-failure` is used, the number of times to retry before giving up. 
3700    #[serde(rename = "MaximumRetryCount")]
3701    #[serde(skip_serializing_if="Option::is_none")]
3702    pub maximum_retry_count: Option<i64>,
3703
3704}
3705
3706#[allow(non_camel_case_types)]
3707#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
3708pub enum RestartPolicyNameEnum { 
3709    #[serde(rename = "")]
3710    EMPTY,
3711    #[serde(rename = "always")]
3712    ALWAYS,
3713    #[serde(rename = "unless-stopped")]
3714    UNLESS_STOPPED,
3715    #[serde(rename = "on-failure")]
3716    ON_FAILURE,
3717    #[serde(rename = "no")]
3718    NO,
3719}
3720
3721impl ::std::fmt::Display for RestartPolicyNameEnum {
3722    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
3723        match *self { 
3724            RestartPolicyNameEnum::EMPTY => write!(f, "{}", ""),
3725            RestartPolicyNameEnum::ALWAYS => write!(f, "{}", "always"),
3726            RestartPolicyNameEnum::UNLESS_STOPPED => write!(f, "{}", "unless-stopped"),
3727            RestartPolicyNameEnum::ON_FAILURE => write!(f, "{}", "on-failure"),
3728            RestartPolicyNameEnum::NO => write!(f, "{}", "no"),
3729
3730        }
3731    }
3732}
3733
3734impl ::std::str::FromStr for RestartPolicyNameEnum {
3735    type Err = String;
3736    fn from_str(s: &str) -> Result<Self, Self::Err> {
3737        match s { 
3738            "" => Ok(RestartPolicyNameEnum::EMPTY),
3739            "always" => Ok(RestartPolicyNameEnum::ALWAYS),
3740            "unless-stopped" => Ok(RestartPolicyNameEnum::UNLESS_STOPPED),
3741            "on-failure" => Ok(RestartPolicyNameEnum::ON_FAILURE),
3742            "no" => Ok(RestartPolicyNameEnum::NO),
3743            x => Err(format!("Invalid enum type: {}", x)),
3744        }
3745    }
3746}
3747
3748impl ::std::convert::AsRef<str> for RestartPolicyNameEnum {
3749    fn as_ref(&self) -> &str {
3750        match self { 
3751            RestartPolicyNameEnum::EMPTY => "",
3752            RestartPolicyNameEnum::ALWAYS => "always",
3753            RestartPolicyNameEnum::UNLESS_STOPPED => "unless-stopped",
3754            RestartPolicyNameEnum::ON_FAILURE => "on-failure",
3755            RestartPolicyNameEnum::NO => "no",
3756        }
3757    }
3758}
3759
3760/// Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec) runtime.  The runtime is invoked by the daemon via the `containerd` daemon. OCI runtimes act as an interface to the Linux kernel namespaces, cgroups, and SELinux. 
3761#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3762pub struct Runtime {
3763    /// Name and, optional, path, of the OCI executable binary.  If the path is omitted, the daemon searches the host's `$PATH` for the binary and uses the first result. 
3764    #[serde(rename = "path")]
3765    #[serde(skip_serializing_if="Option::is_none")]
3766    pub path: Option<String>,
3767
3768    /// List of command-line arguments to pass to the runtime when invoked. 
3769    #[serde(rename = "runtimeArgs")]
3770    #[serde(skip_serializing_if="Option::is_none")]
3771    pub runtime_args: Option<Vec<String>>,
3772
3773}
3774
3775#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3776pub struct Secret {
3777    #[serde(rename = "ID")]
3778    #[serde(skip_serializing_if="Option::is_none")]
3779    pub id: Option<String>,
3780
3781    #[serde(rename = "Version")]
3782    #[serde(skip_serializing_if="Option::is_none")]
3783    pub version: Option<ObjectVersion>,
3784
3785    #[serde(rename = "CreatedAt")]
3786    #[serde(skip_serializing_if="Option::is_none")]
3787    pub created_at: Option<DateTime<Utc>>,
3788
3789    #[serde(rename = "UpdatedAt")]
3790    #[serde(skip_serializing_if="Option::is_none")]
3791    pub updated_at: Option<DateTime<Utc>>,
3792
3793    #[serde(rename = "Spec")]
3794    #[serde(skip_serializing_if="Option::is_none")]
3795    pub spec: Option<SecretSpec>,
3796
3797}
3798
3799#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3800pub struct SecretSpec {
3801    /// User-defined name of the secret.
3802    #[serde(rename = "Name")]
3803    #[serde(skip_serializing_if="Option::is_none")]
3804    pub name: Option<String>,
3805
3806    /// User-defined key/value metadata.
3807    #[serde(rename = "Labels")]
3808    #[serde(skip_serializing_if="Option::is_none")]
3809    pub labels: Option<HashMap<String, String>>,
3810
3811    /// Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) data to store as secret.  This field is only used to _create_ a secret, and is not returned by other endpoints. 
3812    #[serde(rename = "Data")]
3813    #[serde(skip_serializing_if="Option::is_none")]
3814    pub data: Option<String>,
3815
3816    /// Name of the secrets driver used to fetch the secret's value from an external secret store. 
3817    #[serde(rename = "Driver")]
3818    #[serde(skip_serializing_if="Option::is_none")]
3819    pub driver: Option<Driver>,
3820
3821    /// Templating driver, if applicable  Templating controls whether and how to evaluate the config payload as a template. If no driver is set, no templating is used. 
3822    #[serde(rename = "Templating")]
3823    #[serde(skip_serializing_if="Option::is_none")]
3824    pub templating: Option<Driver>,
3825
3826}
3827
3828#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3829pub struct Service {
3830    #[serde(rename = "ID")]
3831    #[serde(skip_serializing_if="Option::is_none")]
3832    pub id: Option<String>,
3833
3834    #[serde(rename = "Version")]
3835    #[serde(skip_serializing_if="Option::is_none")]
3836    pub version: Option<ObjectVersion>,
3837
3838    #[serde(rename = "CreatedAt")]
3839    #[serde(skip_serializing_if="Option::is_none")]
3840    pub created_at: Option<DateTime<Utc>>,
3841
3842    #[serde(rename = "UpdatedAt")]
3843    #[serde(skip_serializing_if="Option::is_none")]
3844    pub updated_at: Option<DateTime<Utc>>,
3845
3846    #[serde(rename = "Spec")]
3847    #[serde(skip_serializing_if="Option::is_none")]
3848    pub spec: Option<ServiceSpec>,
3849
3850    #[serde(rename = "Endpoint")]
3851    #[serde(skip_serializing_if="Option::is_none")]
3852    pub endpoint: Option<ServiceEndpoint>,
3853
3854    #[serde(rename = "UpdateStatus")]
3855    #[serde(skip_serializing_if="Option::is_none")]
3856    pub update_status: Option<ServiceUpdateStatus>,
3857
3858    #[serde(rename = "ServiceStatus")]
3859    #[serde(skip_serializing_if="Option::is_none")]
3860    pub service_status: Option<ServiceServiceStatus>,
3861
3862    #[serde(rename = "JobStatus")]
3863    #[serde(skip_serializing_if="Option::is_none")]
3864    pub job_status: Option<ServiceJobStatus>,
3865
3866}
3867
3868#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3869pub struct ServiceCreateResponse {
3870    /// The ID of the created service.
3871    #[serde(rename = "ID")]
3872    #[serde(skip_serializing_if="Option::is_none")]
3873    pub id: Option<String>,
3874
3875    /// Optional warning message
3876    #[serde(rename = "Warning")]
3877    #[serde(skip_serializing_if="Option::is_none")]
3878    pub warning: Option<String>,
3879
3880}
3881
3882#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3883pub struct ServiceEndpoint {
3884    #[serde(rename = "Spec")]
3885    #[serde(skip_serializing_if="Option::is_none")]
3886    pub spec: Option<EndpointSpec>,
3887
3888    #[serde(rename = "Ports")]
3889    #[serde(skip_serializing_if="Option::is_none")]
3890    pub ports: Option<Vec<EndpointPortConfig>>,
3891
3892    #[serde(rename = "VirtualIPs")]
3893    #[serde(skip_serializing_if="Option::is_none")]
3894    pub virtual_i_ps: Option<Vec<ServiceEndpointVirtualIPs>>,
3895
3896}
3897
3898#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3899pub struct ServiceEndpointVirtualIPs {
3900    #[serde(rename = "NetworkID")]
3901    #[serde(skip_serializing_if="Option::is_none")]
3902    pub network_id: Option<String>,
3903
3904    #[serde(rename = "Addr")]
3905    #[serde(skip_serializing_if="Option::is_none")]
3906    pub addr: Option<String>,
3907
3908}
3909
3910/// The status of the service when it is in one of ReplicatedJob or GlobalJob modes. Absent on Replicated and Global mode services. The JobIteration is an ObjectVersion, but unlike the Service's version, does not need to be sent with an update request. 
3911#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3912pub struct ServiceJobStatus {
3913    /// JobIteration is a value increased each time a Job is executed, successfully or otherwise. \"Executed\", in this case, means the job as a whole has been started, not that an individual Task has been launched. A job is \"Executed\" when its ServiceSpec is updated. JobIteration can be used to disambiguate Tasks belonging to different executions of a job.  Though JobIteration will increase with each subsequent execution, it may not necessarily increase by 1, and so JobIteration should not be used to 
3914    #[serde(rename = "JobIteration")]
3915    #[serde(skip_serializing_if="Option::is_none")]
3916    pub job_iteration: Option<ObjectVersion>,
3917
3918    /// The last time, as observed by the server, that this job was started. 
3919    #[serde(rename = "LastExecution")]
3920    #[serde(skip_serializing_if="Option::is_none")]
3921    pub last_execution: Option<DateTime<Utc>>,
3922
3923}
3924
3925/// The status of the service's tasks. Provided only when requested as part of a ServiceList operation. 
3926#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3927pub struct ServiceServiceStatus {
3928    /// The number of tasks for the service currently in the Running state. 
3929    #[serde(rename = "RunningTasks")]
3930    #[serde(skip_serializing_if="Option::is_none")]
3931    pub running_tasks: Option<u64>,
3932
3933    /// The number of tasks for the service desired to be running. For replicated services, this is the replica count from the service spec. For global services, this is computed by taking count of all tasks for the service with a Desired State other than Shutdown. 
3934    #[serde(rename = "DesiredTasks")]
3935    #[serde(skip_serializing_if="Option::is_none")]
3936    pub desired_tasks: Option<u64>,
3937
3938    /// The number of tasks for a job that are in the Completed state. This field must be cross-referenced with the service type, as the value of 0 may mean the service is not in a job mode, or it may mean the job-mode service has no tasks yet Completed. 
3939    #[serde(rename = "CompletedTasks")]
3940    #[serde(skip_serializing_if="Option::is_none")]
3941    pub completed_tasks: Option<u64>,
3942
3943}
3944
3945/// User modifiable configuration for a service.
3946#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3947pub struct ServiceSpec {
3948    /// Name of the service.
3949    #[serde(rename = "Name")]
3950    #[serde(skip_serializing_if="Option::is_none")]
3951    pub name: Option<String>,
3952
3953    /// User-defined key/value metadata.
3954    #[serde(rename = "Labels")]
3955    #[serde(skip_serializing_if="Option::is_none")]
3956    pub labels: Option<HashMap<String, String>>,
3957
3958    #[serde(rename = "TaskTemplate")]
3959    #[serde(skip_serializing_if="Option::is_none")]
3960    pub task_template: Option<TaskSpec>,
3961
3962    #[serde(rename = "Mode")]
3963    #[serde(skip_serializing_if="Option::is_none")]
3964    pub mode: Option<ServiceSpecMode>,
3965
3966    #[serde(rename = "UpdateConfig")]
3967    #[serde(skip_serializing_if="Option::is_none")]
3968    pub update_config: Option<ServiceSpecUpdateConfig>,
3969
3970    #[serde(rename = "RollbackConfig")]
3971    #[serde(skip_serializing_if="Option::is_none")]
3972    pub rollback_config: Option<ServiceSpecRollbackConfig>,
3973
3974    /// Specifies which networks the service should attach to.
3975    #[serde(rename = "Networks")]
3976    #[serde(skip_serializing_if="Option::is_none")]
3977    pub networks: Option<Vec<NetworkAttachmentConfig>>,
3978
3979    #[serde(rename = "EndpointSpec")]
3980    #[serde(skip_serializing_if="Option::is_none")]
3981    pub endpoint_spec: Option<EndpointSpec>,
3982
3983}
3984
3985/// Scheduling mode for the service.
3986#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3987pub struct ServiceSpecMode {
3988    #[serde(rename = "Replicated")]
3989    #[serde(skip_serializing_if="Option::is_none")]
3990    pub replicated: Option<ServiceSpecModeReplicated>,
3991
3992    #[serde(rename = "Global")]
3993    #[serde(skip_serializing_if="Option::is_none")]
3994    pub global: Option<HashMap<(), ()>>,
3995
3996    #[serde(rename = "ReplicatedJob")]
3997    #[serde(skip_serializing_if="Option::is_none")]
3998    pub replicated_job: Option<ServiceSpecModeReplicatedJob>,
3999
4000    /// The mode used for services which run a task to the completed state on each valid node. 
4001    #[serde(rename = "GlobalJob")]
4002    #[serde(skip_serializing_if="Option::is_none")]
4003    pub global_job: Option<HashMap<(), ()>>,
4004
4005}
4006
4007#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4008pub struct ServiceSpecModeReplicated {
4009    #[serde(rename = "Replicas")]
4010    #[serde(skip_serializing_if="Option::is_none")]
4011    pub replicas: Option<i64>,
4012
4013}
4014
4015/// The mode used for services with a finite number of tasks that run to a completed state. 
4016#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4017pub struct ServiceSpecModeReplicatedJob {
4018    /// The maximum number of replicas to run simultaneously. 
4019    #[serde(rename = "MaxConcurrent")]
4020    #[serde(skip_serializing_if="Option::is_none")]
4021    pub max_concurrent: Option<i64>,
4022
4023    /// The total number of replicas desired to reach the Completed state. If unset, will default to the value of `MaxConcurrent` 
4024    #[serde(rename = "TotalCompletions")]
4025    #[serde(skip_serializing_if="Option::is_none")]
4026    pub total_completions: Option<i64>,
4027
4028}
4029
4030/// Specification for the rollback strategy of the service.
4031#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4032pub struct ServiceSpecRollbackConfig {
4033    /// Maximum number of tasks to be rolled back in one iteration (0 means unlimited parallelism). 
4034    #[serde(rename = "Parallelism")]
4035    #[serde(skip_serializing_if="Option::is_none")]
4036    pub parallelism: Option<i64>,
4037
4038    /// Amount of time between rollback iterations, in nanoseconds. 
4039    #[serde(rename = "Delay")]
4040    #[serde(skip_serializing_if="Option::is_none")]
4041    pub delay: Option<i64>,
4042
4043    /// Action to take if an rolled back task fails to run, or stops running during the rollback. 
4044    #[serde(rename = "FailureAction")]
4045    #[serde(skip_serializing_if="Option::is_none")]
4046    pub failure_action: Option<ServiceSpecRollbackConfigFailureActionEnum>,
4047
4048    /// Amount of time to monitor each rolled back task for failures, in nanoseconds. 
4049    #[serde(rename = "Monitor")]
4050    #[serde(skip_serializing_if="Option::is_none")]
4051    pub monitor: Option<i64>,
4052
4053    /// The fraction of tasks that may fail during a rollback before the failure action is invoked, specified as a floating point number between 0 and 1. 
4054    #[serde(rename = "MaxFailureRatio")]
4055    #[serde(skip_serializing_if="Option::is_none")]
4056    pub max_failure_ratio: Option<f64>,
4057
4058    /// The order of operations when rolling back a task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down. 
4059    #[serde(rename = "Order")]
4060    #[serde(skip_serializing_if="Option::is_none")]
4061    pub order: Option<ServiceSpecRollbackConfigOrderEnum>,
4062
4063}
4064
4065#[allow(non_camel_case_types)]
4066#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
4067pub enum ServiceSpecRollbackConfigFailureActionEnum { 
4068    #[serde(rename = "")]
4069    EMPTY,
4070    #[serde(rename = "continue")]
4071    CONTINUE,
4072    #[serde(rename = "pause")]
4073    PAUSE,
4074}
4075
4076impl ::std::fmt::Display for ServiceSpecRollbackConfigFailureActionEnum {
4077    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
4078        match *self { 
4079            ServiceSpecRollbackConfigFailureActionEnum::EMPTY => write!(f, ""),
4080            ServiceSpecRollbackConfigFailureActionEnum::CONTINUE => write!(f, "{}", "continue"),
4081            ServiceSpecRollbackConfigFailureActionEnum::PAUSE => write!(f, "{}", "pause"),
4082
4083        }
4084    }
4085}
4086
4087impl ::std::str::FromStr for ServiceSpecRollbackConfigFailureActionEnum {
4088    type Err = String;
4089    fn from_str(s: &str) -> Result<Self, Self::Err> {
4090        match s { 
4091            "" => Ok(ServiceSpecRollbackConfigFailureActionEnum::EMPTY),
4092            "continue" => Ok(ServiceSpecRollbackConfigFailureActionEnum::CONTINUE),
4093            "pause" => Ok(ServiceSpecRollbackConfigFailureActionEnum::PAUSE),
4094            x => Err(format!("Invalid enum type: {}", x)),
4095        }
4096    }
4097}
4098
4099impl ::std::convert::AsRef<str> for ServiceSpecRollbackConfigFailureActionEnum {
4100    fn as_ref(&self) -> &str {
4101        match self { 
4102            ServiceSpecRollbackConfigFailureActionEnum::EMPTY => "",
4103            ServiceSpecRollbackConfigFailureActionEnum::CONTINUE => "continue",
4104            ServiceSpecRollbackConfigFailureActionEnum::PAUSE => "pause",
4105        }
4106    }
4107}
4108
4109#[allow(non_camel_case_types)]
4110#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
4111pub enum ServiceSpecRollbackConfigOrderEnum { 
4112    #[serde(rename = "")]
4113    EMPTY,
4114    #[serde(rename = "stop-first")]
4115    STOP_FIRST,
4116    #[serde(rename = "start-first")]
4117    START_FIRST,
4118}
4119
4120impl ::std::fmt::Display for ServiceSpecRollbackConfigOrderEnum {
4121    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
4122        match *self { 
4123            ServiceSpecRollbackConfigOrderEnum::EMPTY => write!(f, ""),
4124            ServiceSpecRollbackConfigOrderEnum::STOP_FIRST => write!(f, "{}", "stop-first"),
4125            ServiceSpecRollbackConfigOrderEnum::START_FIRST => write!(f, "{}", "start-first"),
4126
4127        }
4128    }
4129}
4130
4131impl ::std::str::FromStr for ServiceSpecRollbackConfigOrderEnum {
4132    type Err = String;
4133    fn from_str(s: &str) -> Result<Self, Self::Err> {
4134        match s { 
4135            "" => Ok(ServiceSpecRollbackConfigOrderEnum::EMPTY),
4136            "stop-first" => Ok(ServiceSpecRollbackConfigOrderEnum::STOP_FIRST),
4137            "start-first" => Ok(ServiceSpecRollbackConfigOrderEnum::START_FIRST),
4138            x => Err(format!("Invalid enum type: {}", x)),
4139        }
4140    }
4141}
4142
4143impl ::std::convert::AsRef<str> for ServiceSpecRollbackConfigOrderEnum {
4144    fn as_ref(&self) -> &str {
4145        match self { 
4146            ServiceSpecRollbackConfigOrderEnum::EMPTY => "",
4147            ServiceSpecRollbackConfigOrderEnum::STOP_FIRST => "stop-first",
4148            ServiceSpecRollbackConfigOrderEnum::START_FIRST => "start-first",
4149        }
4150    }
4151}
4152
4153/// Specification for the update strategy of the service.
4154#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4155pub struct ServiceSpecUpdateConfig {
4156    /// Maximum number of tasks to be updated in one iteration (0 means unlimited parallelism). 
4157    #[serde(rename = "Parallelism")]
4158    #[serde(skip_serializing_if="Option::is_none")]
4159    pub parallelism: Option<i64>,
4160
4161    /// Amount of time between updates, in nanoseconds.
4162    #[serde(rename = "Delay")]
4163    #[serde(skip_serializing_if="Option::is_none")]
4164    pub delay: Option<i64>,
4165
4166    /// Action to take if an updated task fails to run, or stops running during the update. 
4167    #[serde(rename = "FailureAction")]
4168    #[serde(skip_serializing_if="Option::is_none")]
4169    pub failure_action: Option<ServiceSpecUpdateConfigFailureActionEnum>,
4170
4171    /// Amount of time to monitor each updated task for failures, in nanoseconds. 
4172    #[serde(rename = "Monitor")]
4173    #[serde(skip_serializing_if="Option::is_none")]
4174    pub monitor: Option<i64>,
4175
4176    /// The fraction of tasks that may fail during an update before the failure action is invoked, specified as a floating point number between 0 and 1. 
4177    #[serde(rename = "MaxFailureRatio")]
4178    #[serde(skip_serializing_if="Option::is_none")]
4179    pub max_failure_ratio: Option<f64>,
4180
4181    /// The order of operations when rolling out an updated task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down. 
4182    #[serde(rename = "Order")]
4183    #[serde(skip_serializing_if="Option::is_none")]
4184    pub order: Option<ServiceSpecUpdateConfigOrderEnum>,
4185
4186}
4187
4188#[allow(non_camel_case_types)]
4189#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
4190pub enum ServiceSpecUpdateConfigFailureActionEnum { 
4191    #[serde(rename = "")]
4192    EMPTY,
4193    #[serde(rename = "continue")]
4194    CONTINUE,
4195    #[serde(rename = "pause")]
4196    PAUSE,
4197    #[serde(rename = "rollback")]
4198    ROLLBACK,
4199}
4200
4201impl ::std::fmt::Display for ServiceSpecUpdateConfigFailureActionEnum {
4202    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
4203        match *self { 
4204            ServiceSpecUpdateConfigFailureActionEnum::EMPTY => write!(f, ""),
4205            ServiceSpecUpdateConfigFailureActionEnum::CONTINUE => write!(f, "{}", "continue"),
4206            ServiceSpecUpdateConfigFailureActionEnum::PAUSE => write!(f, "{}", "pause"),
4207            ServiceSpecUpdateConfigFailureActionEnum::ROLLBACK => write!(f, "{}", "rollback"),
4208
4209        }
4210    }
4211}
4212
4213impl ::std::str::FromStr for ServiceSpecUpdateConfigFailureActionEnum {
4214    type Err = String;
4215    fn from_str(s: &str) -> Result<Self, Self::Err> {
4216        match s { 
4217            "" => Ok(ServiceSpecUpdateConfigFailureActionEnum::EMPTY),
4218            "continue" => Ok(ServiceSpecUpdateConfigFailureActionEnum::CONTINUE),
4219            "pause" => Ok(ServiceSpecUpdateConfigFailureActionEnum::PAUSE),
4220            "rollback" => Ok(ServiceSpecUpdateConfigFailureActionEnum::ROLLBACK),
4221            x => Err(format!("Invalid enum type: {}", x)),
4222        }
4223    }
4224}
4225
4226impl ::std::convert::AsRef<str> for ServiceSpecUpdateConfigFailureActionEnum {
4227    fn as_ref(&self) -> &str {
4228        match self { 
4229            ServiceSpecUpdateConfigFailureActionEnum::EMPTY => "",
4230            ServiceSpecUpdateConfigFailureActionEnum::CONTINUE => "continue",
4231            ServiceSpecUpdateConfigFailureActionEnum::PAUSE => "pause",
4232            ServiceSpecUpdateConfigFailureActionEnum::ROLLBACK => "rollback",
4233        }
4234    }
4235}
4236
4237#[allow(non_camel_case_types)]
4238#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
4239pub enum ServiceSpecUpdateConfigOrderEnum { 
4240    #[serde(rename = "")]
4241    EMPTY,
4242    #[serde(rename = "stop-first")]
4243    STOP_FIRST,
4244    #[serde(rename = "start-first")]
4245    START_FIRST,
4246}
4247
4248impl ::std::fmt::Display for ServiceSpecUpdateConfigOrderEnum {
4249    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
4250        match *self { 
4251            ServiceSpecUpdateConfigOrderEnum::EMPTY => write!(f, ""),
4252            ServiceSpecUpdateConfigOrderEnum::STOP_FIRST => write!(f, "{}", "stop-first"),
4253            ServiceSpecUpdateConfigOrderEnum::START_FIRST => write!(f, "{}", "start-first"),
4254
4255        }
4256    }
4257}
4258
4259impl ::std::str::FromStr for ServiceSpecUpdateConfigOrderEnum {
4260    type Err = String;
4261    fn from_str(s: &str) -> Result<Self, Self::Err> {
4262        match s { 
4263            "" => Ok(ServiceSpecUpdateConfigOrderEnum::EMPTY),
4264            "stop-first" => Ok(ServiceSpecUpdateConfigOrderEnum::STOP_FIRST),
4265            "start-first" => Ok(ServiceSpecUpdateConfigOrderEnum::START_FIRST),
4266            x => Err(format!("Invalid enum type: {}", x)),
4267        }
4268    }
4269}
4270
4271impl ::std::convert::AsRef<str> for ServiceSpecUpdateConfigOrderEnum {
4272    fn as_ref(&self) -> &str {
4273        match self { 
4274            ServiceSpecUpdateConfigOrderEnum::EMPTY => "",
4275            ServiceSpecUpdateConfigOrderEnum::STOP_FIRST => "stop-first",
4276            ServiceSpecUpdateConfigOrderEnum::START_FIRST => "start-first",
4277        }
4278    }
4279}
4280
4281#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4282pub struct ServiceUpdateResponse {
4283    /// Optional warning messages
4284    #[serde(rename = "Warnings")]
4285    #[serde(skip_serializing_if="Option::is_none")]
4286    pub warnings: Option<Vec<String>>,
4287
4288}
4289
4290/// The status of a service update.
4291#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4292pub struct ServiceUpdateStatus {
4293    #[serde(rename = "State")]
4294    #[serde(skip_serializing_if="Option::is_none")]
4295    pub state: Option<ServiceUpdateStatusStateEnum>,
4296
4297    #[serde(rename = "StartedAt")]
4298    #[serde(skip_serializing_if="Option::is_none")]
4299    pub started_at: Option<DateTime<Utc>>,
4300
4301    #[serde(rename = "CompletedAt")]
4302    #[serde(skip_serializing_if="Option::is_none")]
4303    pub completed_at: Option<DateTime<Utc>>,
4304
4305    #[serde(rename = "Message")]
4306    #[serde(skip_serializing_if="Option::is_none")]
4307    pub message: Option<String>,
4308
4309}
4310
4311#[allow(non_camel_case_types)]
4312#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
4313pub enum ServiceUpdateStatusStateEnum { 
4314    #[serde(rename = "")]
4315    EMPTY,
4316    #[serde(rename = "updating")]
4317    UPDATING,
4318    #[serde(rename = "paused")]
4319    PAUSED,
4320    #[serde(rename = "completed")]
4321    COMPLETED,
4322    #[serde(rename = "rollback_started")]
4323    ROLLBACK_STARTED,
4324    #[serde(rename = "rollback_paused")]
4325    ROLLBACK_PAUSED,
4326    #[serde(rename = "rollback_completed")]
4327    ROLLBACK_COMPLETED,
4328}
4329
4330impl ::std::fmt::Display for ServiceUpdateStatusStateEnum {
4331    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
4332        match *self { 
4333            ServiceUpdateStatusStateEnum::EMPTY => write!(f, ""),
4334            ServiceUpdateStatusStateEnum::UPDATING => write!(f, "{}", "updating"),
4335            ServiceUpdateStatusStateEnum::PAUSED => write!(f, "{}", "paused"),
4336            ServiceUpdateStatusStateEnum::COMPLETED => write!(f, "{}", "completed"),
4337            ServiceUpdateStatusStateEnum::ROLLBACK_STARTED => write!(f, "{}", "rollback_started"),
4338            ServiceUpdateStatusStateEnum::ROLLBACK_PAUSED => write!(f, "{}", "rollback_paused"),
4339            ServiceUpdateStatusStateEnum::ROLLBACK_COMPLETED => write!(f, "{}", "rollback_completed"),
4340
4341        }
4342    }
4343}
4344
4345impl ::std::str::FromStr for ServiceUpdateStatusStateEnum {
4346    type Err = String;
4347    fn from_str(s: &str) -> Result<Self, Self::Err> {
4348        match s { 
4349            "" => Ok(ServiceUpdateStatusStateEnum::EMPTY),
4350            "updating" => Ok(ServiceUpdateStatusStateEnum::UPDATING),
4351            "paused" => Ok(ServiceUpdateStatusStateEnum::PAUSED),
4352            "completed" => Ok(ServiceUpdateStatusStateEnum::COMPLETED),
4353            "rollback_started" => Ok(ServiceUpdateStatusStateEnum::ROLLBACK_STARTED),
4354            "rollback_paused" => Ok(ServiceUpdateStatusStateEnum::ROLLBACK_PAUSED),
4355            "rollback_completed" => Ok(ServiceUpdateStatusStateEnum::ROLLBACK_COMPLETED),
4356            x => Err(format!("Invalid enum type: {}", x)),
4357        }
4358    }
4359}
4360
4361impl ::std::convert::AsRef<str> for ServiceUpdateStatusStateEnum {
4362    fn as_ref(&self) -> &str {
4363        match self { 
4364            ServiceUpdateStatusStateEnum::EMPTY => "",
4365            ServiceUpdateStatusStateEnum::UPDATING => "updating",
4366            ServiceUpdateStatusStateEnum::PAUSED => "paused",
4367            ServiceUpdateStatusStateEnum::COMPLETED => "completed",
4368            ServiceUpdateStatusStateEnum::ROLLBACK_STARTED => "rollback_started",
4369            ServiceUpdateStatusStateEnum::ROLLBACK_PAUSED => "rollback_paused",
4370            ServiceUpdateStatusStateEnum::ROLLBACK_COMPLETED => "rollback_completed",
4371        }
4372    }
4373}
4374
4375/// Represents generic information about swarm. 
4376#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4377pub struct SwarmInfo {
4378    /// Unique identifier of for this node in the swarm.
4379    #[serde(rename = "NodeID")]
4380    #[serde(skip_serializing_if="Option::is_none")]
4381    pub node_id: Option<String>,
4382
4383    /// IP address at which this node can be reached by other nodes in the swarm. 
4384    #[serde(rename = "NodeAddr")]
4385    #[serde(skip_serializing_if="Option::is_none")]
4386    pub node_addr: Option<String>,
4387
4388    #[serde(rename = "LocalNodeState")]
4389    #[serde(skip_serializing_if="Option::is_none")]
4390    pub local_node_state: Option<LocalNodeState>,
4391
4392    #[serde(rename = "ControlAvailable")]
4393    #[serde(skip_serializing_if="Option::is_none")]
4394    pub control_available: Option<bool>,
4395
4396    #[serde(rename = "Error")]
4397    #[serde(skip_serializing_if="Option::is_none")]
4398    pub error: Option<String>,
4399
4400    /// List of ID's and addresses of other managers in the swarm. 
4401    #[serde(rename = "RemoteManagers")]
4402    #[serde(skip_serializing_if="Option::is_none")]
4403    pub remote_managers: Option<Vec<PeerNode>>,
4404
4405    /// Total number of nodes in the swarm.
4406    #[serde(rename = "Nodes")]
4407    #[serde(skip_serializing_if="Option::is_none")]
4408    pub nodes: Option<i64>,
4409
4410    /// Total number of managers in the swarm.
4411    #[serde(rename = "Managers")]
4412    #[serde(skip_serializing_if="Option::is_none")]
4413    pub managers: Option<i64>,
4414
4415    #[serde(rename = "Cluster")]
4416    #[serde(skip_serializing_if="Option::is_none")]
4417    pub cluster: Option<ClusterInfo>,
4418
4419}
4420
4421/// User modifiable swarm configuration.
4422#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4423pub struct SwarmSpec {
4424    /// Name of the swarm.
4425    #[serde(rename = "Name")]
4426    #[serde(skip_serializing_if="Option::is_none")]
4427    pub name: Option<String>,
4428
4429    /// User-defined key/value metadata.
4430    #[serde(rename = "Labels")]
4431    #[serde(skip_serializing_if="Option::is_none")]
4432    pub labels: Option<HashMap<String, String>>,
4433
4434    #[serde(rename = "Orchestration")]
4435    #[serde(skip_serializing_if="Option::is_none")]
4436    pub orchestration: Option<SwarmSpecOrchestration>,
4437
4438    #[serde(rename = "Raft")]
4439    #[serde(skip_serializing_if="Option::is_none")]
4440    pub raft: Option<SwarmSpecRaft>,
4441
4442    #[serde(rename = "Dispatcher")]
4443    #[serde(skip_serializing_if="Option::is_none")]
4444    pub dispatcher: Option<SwarmSpecDispatcher>,
4445
4446    #[serde(rename = "CAConfig")]
4447    #[serde(skip_serializing_if="Option::is_none")]
4448    pub ca_config: Option<SwarmSpecCaConfig>,
4449
4450    #[serde(rename = "EncryptionConfig")]
4451    #[serde(skip_serializing_if="Option::is_none")]
4452    pub encryption_config: Option<SwarmSpecEncryptionConfig>,
4453
4454    #[serde(rename = "TaskDefaults")]
4455    #[serde(skip_serializing_if="Option::is_none")]
4456    pub task_defaults: Option<SwarmSpecTaskDefaults>,
4457
4458}
4459
4460/// CA configuration.
4461#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4462pub struct SwarmSpecCaConfig {
4463    /// The duration node certificates are issued for.
4464    #[serde(rename = "NodeCertExpiry")]
4465    #[serde(skip_serializing_if="Option::is_none")]
4466    pub node_cert_expiry: Option<i64>,
4467
4468    /// Configuration for forwarding signing requests to an external certificate authority. 
4469    #[serde(rename = "ExternalCAs")]
4470    #[serde(skip_serializing_if="Option::is_none")]
4471    pub external_cas: Option<Vec<SwarmSpecCaConfigExternalCAs>>,
4472
4473    /// The desired signing CA certificate for all swarm node TLS leaf certificates, in PEM format. 
4474    #[serde(rename = "SigningCACert")]
4475    #[serde(skip_serializing_if="Option::is_none")]
4476    pub signing_ca_cert: Option<String>,
4477
4478    /// The desired signing CA key for all swarm node TLS leaf certificates, in PEM format. 
4479    #[serde(rename = "SigningCAKey")]
4480    #[serde(skip_serializing_if="Option::is_none")]
4481    pub signing_ca_key: Option<String>,
4482
4483    /// An integer whose purpose is to force swarm to generate a new signing CA certificate and key, if none have been specified in `SigningCACert` and `SigningCAKey` 
4484    #[serde(rename = "ForceRotate")]
4485    #[serde(skip_serializing_if="Option::is_none")]
4486    pub force_rotate: Option<u64>,
4487
4488}
4489
4490#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4491pub struct SwarmSpecCaConfigExternalCAs {
4492    /// Protocol for communication with the external CA (currently only `cfssl` is supported). 
4493    #[serde(rename = "Protocol")]
4494    #[serde(skip_serializing_if="Option::is_none")]
4495    pub protocol: Option<SwarmSpecCaConfigExternalCAsProtocolEnum>,
4496
4497    /// URL where certificate signing requests should be sent. 
4498    #[serde(rename = "URL")]
4499    #[serde(skip_serializing_if="Option::is_none")]
4500    pub url: Option<String>,
4501
4502    /// An object with key/value pairs that are interpreted as protocol-specific options for the external CA driver. 
4503    #[serde(rename = "Options")]
4504    #[serde(skip_serializing_if="Option::is_none")]
4505    pub options: Option<HashMap<String, String>>,
4506
4507    /// The root CA certificate (in PEM format) this external CA uses to issue TLS certificates (assumed to be to the current swarm root CA certificate if not provided). 
4508    #[serde(rename = "CACert")]
4509    #[serde(skip_serializing_if="Option::is_none")]
4510    pub ca_cert: Option<String>,
4511
4512}
4513
4514#[allow(non_camel_case_types)]
4515#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
4516pub enum SwarmSpecCaConfigExternalCAsProtocolEnum { 
4517    #[serde(rename = "")]
4518    EMPTY,
4519    #[serde(rename = "cfssl")]
4520    CFSSL,
4521}
4522
4523impl ::std::fmt::Display for SwarmSpecCaConfigExternalCAsProtocolEnum {
4524    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
4525        match *self { 
4526            SwarmSpecCaConfigExternalCAsProtocolEnum::EMPTY => write!(f, ""),
4527            SwarmSpecCaConfigExternalCAsProtocolEnum::CFSSL => write!(f, "{}", "cfssl"),
4528
4529        }
4530    }
4531}
4532
4533impl ::std::str::FromStr for SwarmSpecCaConfigExternalCAsProtocolEnum {
4534    type Err = String;
4535    fn from_str(s: &str) -> Result<Self, Self::Err> {
4536        match s { 
4537            "" => Ok(SwarmSpecCaConfigExternalCAsProtocolEnum::EMPTY),
4538            "cfssl" => Ok(SwarmSpecCaConfigExternalCAsProtocolEnum::CFSSL),
4539            x => Err(format!("Invalid enum type: {}", x)),
4540        }
4541    }
4542}
4543
4544impl ::std::convert::AsRef<str> for SwarmSpecCaConfigExternalCAsProtocolEnum {
4545    fn as_ref(&self) -> &str {
4546        match self { 
4547            SwarmSpecCaConfigExternalCAsProtocolEnum::EMPTY => "",
4548            SwarmSpecCaConfigExternalCAsProtocolEnum::CFSSL => "cfssl",
4549        }
4550    }
4551}
4552
4553/// Dispatcher configuration.
4554#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4555pub struct SwarmSpecDispatcher {
4556    /// The delay for an agent to send a heartbeat to the dispatcher. 
4557    #[serde(rename = "HeartbeatPeriod")]
4558    #[serde(skip_serializing_if="Option::is_none")]
4559    pub heartbeat_period: Option<i64>,
4560
4561}
4562
4563/// Parameters related to encryption-at-rest.
4564#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4565pub struct SwarmSpecEncryptionConfig {
4566    /// If set, generate a key and use it to lock data stored on the managers. 
4567    #[serde(rename = "AutoLockManagers")]
4568    #[serde(skip_serializing_if="Option::is_none")]
4569    pub auto_lock_managers: Option<bool>,
4570
4571}
4572
4573/// Orchestration configuration.
4574#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4575pub struct SwarmSpecOrchestration {
4576    /// The number of historic tasks to keep per instance or node. If negative, never remove completed or failed tasks. 
4577    #[serde(rename = "TaskHistoryRetentionLimit")]
4578    #[serde(skip_serializing_if="Option::is_none")]
4579    pub task_history_retention_limit: Option<i64>,
4580
4581}
4582
4583/// Raft configuration.
4584#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4585pub struct SwarmSpecRaft {
4586    /// The number of log entries between snapshots.
4587    #[serde(rename = "SnapshotInterval")]
4588    #[serde(skip_serializing_if="Option::is_none")]
4589    pub snapshot_interval: Option<u64>,
4590
4591    /// The number of snapshots to keep beyond the current snapshot. 
4592    #[serde(rename = "KeepOldSnapshots")]
4593    #[serde(skip_serializing_if="Option::is_none")]
4594    pub keep_old_snapshots: Option<u64>,
4595
4596    /// The number of log entries to keep around to sync up slow followers after a snapshot is created. 
4597    #[serde(rename = "LogEntriesForSlowFollowers")]
4598    #[serde(skip_serializing_if="Option::is_none")]
4599    pub log_entries_for_slow_followers: Option<u64>,
4600
4601    /// The number of ticks that a follower will wait for a message from the leader before becoming a candidate and starting an election. `ElectionTick` must be greater than `HeartbeatTick`.  A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed. 
4602    #[serde(rename = "ElectionTick")]
4603    #[serde(skip_serializing_if="Option::is_none")]
4604    pub election_tick: Option<i64>,
4605
4606    /// The number of ticks between heartbeats. Every HeartbeatTick ticks, the leader will send a heartbeat to the followers.  A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed. 
4607    #[serde(rename = "HeartbeatTick")]
4608    #[serde(skip_serializing_if="Option::is_none")]
4609    pub heartbeat_tick: Option<i64>,
4610
4611}
4612
4613/// Defaults for creating tasks in this cluster.
4614#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4615pub struct SwarmSpecTaskDefaults {
4616    #[serde(rename = "LogDriver")]
4617    #[serde(skip_serializing_if="Option::is_none")]
4618    pub log_driver: Option<SwarmSpecTaskDefaultsLogDriver>,
4619
4620}
4621
4622/// The log driver to use for tasks created in the orchestrator if unspecified by a service.  Updating this value only affects new tasks. Existing tasks continue to use their previously configured log driver until recreated. 
4623#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4624pub struct SwarmSpecTaskDefaultsLogDriver {
4625    /// The log driver to use as a default for new tasks. 
4626    #[serde(rename = "Name")]
4627    #[serde(skip_serializing_if="Option::is_none")]
4628    pub name: Option<String>,
4629
4630    /// Driver-specific options for the selectd log driver, specified as key/value pairs. 
4631    #[serde(rename = "Options")]
4632    #[serde(skip_serializing_if="Option::is_none")]
4633    pub options: Option<HashMap<String, String>>,
4634
4635}
4636
4637#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4638pub struct SystemAuthResponse {
4639    /// The status of the authentication
4640    #[serde(rename = "Status")]
4641    pub status: String,
4642
4643    /// An opaque token used to authenticate a user after a successful login
4644    #[serde(rename = "IdentityToken")]
4645    #[serde(skip_serializing_if="Option::is_none")]
4646    pub identity_token: Option<String>,
4647
4648}
4649
4650#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4651pub struct SystemDataUsageResponse {
4652    #[serde(rename = "LayersSize")]
4653    #[serde(skip_serializing_if="Option::is_none")]
4654    pub layers_size: Option<i64>,
4655
4656    #[serde(rename = "Images")]
4657    #[serde(skip_serializing_if="Option::is_none")]
4658    pub images: Option<Vec<ImageSummary>>,
4659
4660    #[serde(rename = "Containers")]
4661    #[serde(skip_serializing_if="Option::is_none")]
4662    pub containers: Option<Vec<ContainerSummary>>,
4663
4664    #[serde(rename = "Volumes")]
4665    #[serde(skip_serializing_if="Option::is_none")]
4666    pub volumes: Option<Vec<Volume>>,
4667
4668    #[serde(rename = "BuildCache")]
4669    #[serde(skip_serializing_if="Option::is_none")]
4670    pub build_cache: Option<Vec<BuildCache>>,
4671
4672}
4673
4674#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4675pub struct SystemEventsResponse {
4676    /// The type of object emitting the event
4677    #[serde(rename = "Type")]
4678    #[serde(skip_serializing_if="Option::is_none")]
4679    pub typ: Option<String>,
4680
4681    /// The type of event
4682    #[serde(rename = "Action")]
4683    #[serde(skip_serializing_if="Option::is_none")]
4684    pub action: Option<String>,
4685
4686    #[serde(rename = "Actor")]
4687    #[serde(skip_serializing_if="Option::is_none")]
4688    pub actor: Option<SystemEventsResponseActor>,
4689
4690    /// Timestamp of event
4691    #[serde(rename = "time")]
4692    #[serde(skip_serializing_if="Option::is_none")]
4693    pub time: Option<i64>,
4694
4695    /// Timestamp of event, with nanosecond accuracy
4696    #[serde(rename = "timeNano")]
4697    #[serde(skip_serializing_if="Option::is_none")]
4698    pub time_nano: Option<i64>,
4699
4700}
4701
4702#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4703pub struct SystemEventsResponseActor {
4704    /// The ID of the object emitting the event
4705    #[serde(rename = "ID")]
4706    #[serde(skip_serializing_if="Option::is_none")]
4707    pub id: Option<String>,
4708
4709    /// Various key/value attributes of the object, depending on its type
4710    #[serde(rename = "Attributes")]
4711    #[serde(skip_serializing_if="Option::is_none")]
4712    pub attributes: Option<HashMap<String, String>>,
4713
4714}
4715
4716#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4717pub struct SystemInfo {
4718    /// Unique identifier of the daemon.  <p><br /></p>  > **Note**: The format of the ID itself is not part of the API, and > should not be considered stable. 
4719    #[serde(rename = "ID")]
4720    #[serde(skip_serializing_if="Option::is_none")]
4721    pub id: Option<String>,
4722
4723    /// Total number of containers on the host.
4724    #[serde(rename = "Containers")]
4725    #[serde(skip_serializing_if="Option::is_none")]
4726    pub containers: Option<i64>,
4727
4728    /// Number of containers with status `\"running\"`. 
4729    #[serde(rename = "ContainersRunning")]
4730    #[serde(skip_serializing_if="Option::is_none")]
4731    pub containers_running: Option<i64>,
4732
4733    /// Number of containers with status `\"paused\"`. 
4734    #[serde(rename = "ContainersPaused")]
4735    #[serde(skip_serializing_if="Option::is_none")]
4736    pub containers_paused: Option<i64>,
4737
4738    /// Number of containers with status `\"stopped\"`. 
4739    #[serde(rename = "ContainersStopped")]
4740    #[serde(skip_serializing_if="Option::is_none")]
4741    pub containers_stopped: Option<i64>,
4742
4743    /// Total number of images on the host.  Both _tagged_ and _untagged_ (dangling) images are counted. 
4744    #[serde(rename = "Images")]
4745    #[serde(skip_serializing_if="Option::is_none")]
4746    pub images: Option<i64>,
4747
4748    /// Name of the storage driver in use.
4749    #[serde(rename = "Driver")]
4750    #[serde(skip_serializing_if="Option::is_none")]
4751    pub driver: Option<String>,
4752
4753    /// Information specific to the storage driver, provided as \"label\" / \"value\" pairs.  This information is provided by the storage driver, and formatted in a way consistent with the output of `docker info` on the command line.  <p><br /></p>  > **Note**: The information returned in this field, including the > formatting of values and labels, should not be considered stable, > and may change without notice. 
4754    #[serde(rename = "DriverStatus")]
4755    #[serde(skip_serializing_if="Option::is_none")]
4756    pub driver_status: Option<Vec<Vec<String>>>,
4757
4758    /// Root directory of persistent Docker state.  Defaults to `/var/lib/docker` on Linux, and `C:\\ProgramData\\docker` on Windows. 
4759    #[serde(rename = "DockerRootDir")]
4760    #[serde(skip_serializing_if="Option::is_none")]
4761    pub docker_root_dir: Option<String>,
4762
4763    #[serde(rename = "Plugins")]
4764    #[serde(skip_serializing_if="Option::is_none")]
4765    pub plugins: Option<PluginsInfo>,
4766
4767    /// Indicates if the host has memory limit support enabled.
4768    #[serde(rename = "MemoryLimit")]
4769    #[serde(skip_serializing_if="Option::is_none")]
4770    pub memory_limit: Option<bool>,
4771
4772    /// Indicates if the host has memory swap limit support enabled.
4773    #[serde(rename = "SwapLimit")]
4774    #[serde(skip_serializing_if="Option::is_none")]
4775    pub swap_limit: Option<bool>,
4776
4777    /// Indicates if the host has kernel memory limit support enabled.  <p><br /></p>  > **Deprecated**: This field is deprecated as the kernel 5.4 deprecated > `kmem.limit_in_bytes`. 
4778    #[serde(rename = "KernelMemory")]
4779    #[serde(skip_serializing_if="Option::is_none")]
4780    pub kernel_memory: Option<bool>,
4781
4782    /// Indicates if CPU CFS(Completely Fair Scheduler) period is supported by the host. 
4783    #[serde(rename = "CpuCfsPeriod")]
4784    #[serde(skip_serializing_if="Option::is_none")]
4785    pub cpu_cfs_period: Option<bool>,
4786
4787    /// Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by the host. 
4788    #[serde(rename = "CpuCfsQuota")]
4789    #[serde(skip_serializing_if="Option::is_none")]
4790    pub cpu_cfs_quota: Option<bool>,
4791
4792    /// Indicates if CPU Shares limiting is supported by the host. 
4793    #[serde(rename = "CPUShares")]
4794    #[serde(skip_serializing_if="Option::is_none")]
4795    pub cpu_shares: Option<bool>,
4796
4797    /// Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host.  See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) 
4798    #[serde(rename = "CPUSet")]
4799    #[serde(skip_serializing_if="Option::is_none")]
4800    pub cpu_set: Option<bool>,
4801
4802    /// Indicates if the host kernel has PID limit support enabled.
4803    #[serde(rename = "PidsLimit")]
4804    #[serde(skip_serializing_if="Option::is_none")]
4805    pub pids_limit: Option<bool>,
4806
4807    /// Indicates if OOM killer disable is supported on the host.
4808    #[serde(rename = "OomKillDisable")]
4809    #[serde(skip_serializing_if="Option::is_none")]
4810    pub oom_kill_disable: Option<bool>,
4811
4812    /// Indicates IPv4 forwarding is enabled.
4813    #[serde(rename = "IPv4Forwarding")]
4814    #[serde(skip_serializing_if="Option::is_none")]
4815    pub ipv4_forwarding: Option<bool>,
4816
4817    /// Indicates if `bridge-nf-call-iptables` is available on the host.
4818    #[serde(rename = "BridgeNfIptables")]
4819    #[serde(skip_serializing_if="Option::is_none")]
4820    pub bridge_nf_iptables: Option<bool>,
4821
4822    /// Indicates if `bridge-nf-call-ip6tables` is available on the host.
4823    #[serde(rename = "BridgeNfIp6tables")]
4824    #[serde(skip_serializing_if="Option::is_none")]
4825    pub bridge_nf_ip6tables: Option<bool>,
4826
4827    /// Indicates if the daemon is running in debug-mode / with debug-level logging enabled. 
4828    #[serde(rename = "Debug")]
4829    #[serde(skip_serializing_if="Option::is_none")]
4830    pub debug: Option<bool>,
4831
4832    /// The total number of file Descriptors in use by the daemon process.  This information is only returned if debug-mode is enabled. 
4833    #[serde(rename = "NFd")]
4834    #[serde(skip_serializing_if="Option::is_none")]
4835    pub n_fd: Option<i64>,
4836
4837    /// The  number of goroutines that currently exist.  This information is only returned if debug-mode is enabled. 
4838    #[serde(rename = "NGoroutines")]
4839    #[serde(skip_serializing_if="Option::is_none")]
4840    pub n_goroutines: Option<i64>,
4841
4842    /// Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
4843    #[serde(rename = "SystemTime")]
4844    #[serde(skip_serializing_if="Option::is_none")]
4845    pub system_time: Option<String>,
4846
4847    /// The logging driver to use as a default for new containers. 
4848    #[serde(rename = "LoggingDriver")]
4849    #[serde(skip_serializing_if="Option::is_none")]
4850    pub logging_driver: Option<String>,
4851
4852    /// The driver to use for managing cgroups. 
4853    #[serde(rename = "CgroupDriver")]
4854    #[serde(skip_serializing_if="Option::is_none")]
4855    pub cgroup_driver: Option<SystemInfoCgroupDriverEnum>,
4856
4857    /// The version of the cgroup. 
4858    #[serde(rename = "CgroupVersion")]
4859    #[serde(skip_serializing_if="Option::is_none")]
4860    pub cgroup_version: Option<SystemInfoCgroupVersionEnum>,
4861
4862    /// Number of event listeners subscribed.
4863    #[serde(rename = "NEventsListener")]
4864    #[serde(skip_serializing_if="Option::is_none")]
4865    pub n_events_listener: Option<i64>,
4866
4867    /// Kernel version of the host.  On Linux, this information obtained from `uname`. On Windows this information is queried from the <kbd>HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\</kbd> registry value, for example _\"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)\"_. 
4868    #[serde(rename = "KernelVersion")]
4869    #[serde(skip_serializing_if="Option::is_none")]
4870    pub kernel_version: Option<String>,
4871
4872    /// Name of the host's operating system, for example: \"Ubuntu 16.04.2 LTS\" or \"Windows Server 2016 Datacenter\" 
4873    #[serde(rename = "OperatingSystem")]
4874    #[serde(skip_serializing_if="Option::is_none")]
4875    pub operating_system: Option<String>,
4876
4877    /// Version of the host's operating system  <p><br /></p>  > **Note**: The information returned in this field, including its > very existence, and the formatting of values, should not be considered > stable, and may change without notice. 
4878    #[serde(rename = "OSVersion")]
4879    #[serde(skip_serializing_if="Option::is_none")]
4880    pub os_version: Option<String>,
4881
4882    /// Generic type of the operating system of the host, as returned by the Go runtime (`GOOS`).  Currently returned values are \"linux\" and \"windows\". A full list of possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment). 
4883    #[serde(rename = "OSType")]
4884    #[serde(skip_serializing_if="Option::is_none")]
4885    pub os_type: Option<String>,
4886
4887    /// Hardware architecture of the host, as returned by the Go runtime (`GOARCH`).  A full list of possible values can be found in the [Go documentation](https://golang.org/doc/install/source#environment). 
4888    #[serde(rename = "Architecture")]
4889    #[serde(skip_serializing_if="Option::is_none")]
4890    pub architecture: Option<String>,
4891
4892    /// The number of logical CPUs usable by the daemon.  The number of available CPUs is checked by querying the operating system when the daemon starts. Changes to operating system CPU allocation after the daemon is started are not reflected. 
4893    #[serde(rename = "NCPU")]
4894    #[serde(skip_serializing_if="Option::is_none")]
4895    pub ncpu: Option<i64>,
4896
4897    /// Total amount of physical memory available on the host, in bytes. 
4898    #[serde(rename = "MemTotal")]
4899    #[serde(skip_serializing_if="Option::is_none")]
4900    pub mem_total: Option<i64>,
4901
4902    /// Address / URL of the index server that is used for image search, and as a default for user authentication for Docker Hub and Docker Cloud. 
4903    #[serde(rename = "IndexServerAddress")]
4904    #[serde(skip_serializing_if="Option::is_none")]
4905    pub index_server_address: Option<String>,
4906
4907    #[serde(rename = "RegistryConfig")]
4908    #[serde(skip_serializing_if="Option::is_none")]
4909    pub registry_config: Option<RegistryServiceConfig>,
4910
4911    #[serde(rename = "GenericResources")]
4912    #[serde(skip_serializing_if="Option::is_none")]
4913    pub generic_resources: Option<GenericResources>,
4914
4915    /// HTTP-proxy configured for the daemon. This value is obtained from the [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL are masked in the API response.  Containers do not automatically inherit this configuration. 
4916    #[serde(rename = "HttpProxy")]
4917    #[serde(skip_serializing_if="Option::is_none")]
4918    pub http_proxy: Option<String>,
4919
4920    /// HTTPS-proxy configured for the daemon. This value is obtained from the [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL are masked in the API response.  Containers do not automatically inherit this configuration. 
4921    #[serde(rename = "HttpsProxy")]
4922    #[serde(skip_serializing_if="Option::is_none")]
4923    pub https_proxy: Option<String>,
4924
4925    /// Comma-separated list of domain extensions for which no proxy should be used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable.  Containers do not automatically inherit this configuration. 
4926    #[serde(rename = "NoProxy")]
4927    #[serde(skip_serializing_if="Option::is_none")]
4928    pub no_proxy: Option<String>,
4929
4930    /// Hostname of the host.
4931    #[serde(rename = "Name")]
4932    #[serde(skip_serializing_if="Option::is_none")]
4933    pub name: Option<String>,
4934
4935    /// User-defined labels (key/value metadata) as set on the daemon.  <p><br /></p>  > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, > set through the daemon configuration, and _node_ labels, set from a > manager node in the Swarm. Node labels are not included in this > field. Node labels can be retrieved using the `/nodes/(id)` endpoint > on a manager node in the Swarm. 
4936    #[serde(rename = "Labels")]
4937    #[serde(skip_serializing_if="Option::is_none")]
4938    pub labels: Option<Vec<String>>,
4939
4940    /// Indicates if experimental features are enabled on the daemon. 
4941    #[serde(rename = "ExperimentalBuild")]
4942    #[serde(skip_serializing_if="Option::is_none")]
4943    pub experimental_build: Option<bool>,
4944
4945    /// Version string of the daemon.  > **Note**: the [standalone Swarm API](https://docs.docker.com/swarm/swarm-api/) > returns the Swarm version instead of the daemon  version, for example > `swarm/1.2.8`. 
4946    #[serde(rename = "ServerVersion")]
4947    #[serde(skip_serializing_if="Option::is_none")]
4948    pub server_version: Option<String>,
4949
4950    /// URL of the distributed storage backend.   The storage backend is used for multihost networking (to store network and endpoint information) and by the node discovery mechanism.  <p><br /></p>  > **Deprecated**: This field is only propagated when using standalone Swarm > mode, and overlay networking using an external k/v store. Overlay > networks with Swarm mode enabled use the built-in raft store, and > this field will be empty. 
4951    #[serde(rename = "ClusterStore")]
4952    #[serde(skip_serializing_if="Option::is_none")]
4953    pub cluster_store: Option<String>,
4954
4955    /// The network endpoint that the Engine advertises for the purpose of node discovery. ClusterAdvertise is a `host:port` combination on which the daemon is reachable by other hosts.  <p><br /></p>  > **Deprecated**: This field is only propagated when using standalone Swarm > mode, and overlay networking using an external k/v store. Overlay > networks with Swarm mode enabled use the built-in raft store, and > this field will be empty. 
4956    #[serde(rename = "ClusterAdvertise")]
4957    #[serde(skip_serializing_if="Option::is_none")]
4958    pub cluster_advertise: Option<String>,
4959
4960    /// List of [OCI compliant](https://github.com/opencontainers/runtime-spec) runtimes configured on the daemon. Keys hold the \"name\" used to reference the runtime.  The Docker daemon relies on an OCI compliant runtime (invoked via the `containerd` daemon) as its interface to the Linux kernel namespaces, cgroups, and SELinux.  The default runtime is `runc`, and automatically configured. Additional runtimes can be configured by the user and will be listed here. 
4961    #[serde(rename = "Runtimes")]
4962    #[serde(skip_serializing_if="Option::is_none")]
4963    pub runtimes: Option<HashMap<String, Runtime>>,
4964
4965    /// Name of the default OCI runtime that is used when starting containers.  The default can be overridden per-container at create time. 
4966    #[serde(rename = "DefaultRuntime")]
4967    #[serde(skip_serializing_if="Option::is_none")]
4968    pub default_runtime: Option<String>,
4969
4970    #[serde(rename = "Swarm")]
4971    #[serde(skip_serializing_if="Option::is_none")]
4972    pub swarm: Option<SwarmInfo>,
4973
4974    /// Indicates if live restore is enabled.  If enabled, containers are kept running when the daemon is shutdown or upon daemon start if running containers are detected. 
4975    #[serde(rename = "LiveRestoreEnabled")]
4976    #[serde(skip_serializing_if="Option::is_none")]
4977    pub live_restore_enabled: Option<bool>,
4978
4979    /// Represents the isolation technology to use as a default for containers. The supported values are platform-specific.  If no isolation value is specified on daemon start, on Windows client, the default is `hyperv`, and on Windows server, the default is `process`.  This option is currently not used on other platforms. 
4980    #[serde(rename = "Isolation")]
4981    #[serde(skip_serializing_if="Option::is_none")]
4982    pub isolation: Option<SystemInfoIsolationEnum>,
4983
4984    /// Name and, optional, path of the `docker-init` binary.  If the path is omitted, the daemon searches the host's `$PATH` for the binary and uses the first result. 
4985    #[serde(rename = "InitBinary")]
4986    #[serde(skip_serializing_if="Option::is_none")]
4987    pub init_binary: Option<String>,
4988
4989    #[serde(rename = "ContainerdCommit")]
4990    #[serde(skip_serializing_if="Option::is_none")]
4991    pub containerd_commit: Option<Commit>,
4992
4993    #[serde(rename = "RuncCommit")]
4994    #[serde(skip_serializing_if="Option::is_none")]
4995    pub runc_commit: Option<Commit>,
4996
4997    #[serde(rename = "InitCommit")]
4998    #[serde(skip_serializing_if="Option::is_none")]
4999    pub init_commit: Option<Commit>,
5000
5001    /// List of security features that are enabled on the daemon, such as apparmor, seccomp, SELinux, user-namespaces (userns), and rootless.  Additional configuration options for each security feature may be present, and are included as a comma-separated list of key/value pairs. 
5002    #[serde(rename = "SecurityOptions")]
5003    #[serde(skip_serializing_if="Option::is_none")]
5004    pub security_options: Option<Vec<String>>,
5005
5006    /// Reports a summary of the product license on the daemon.  If a commercial license has been applied to the daemon, information such as number of nodes, and expiration are included. 
5007    #[serde(rename = "ProductLicense")]
5008    #[serde(skip_serializing_if="Option::is_none")]
5009    pub product_license: Option<String>,
5010
5011    /// List of custom default address pools for local networks, which can be specified in the daemon.json file or dockerd option.  Example: a Base \"10.10.0.0/16\" with Size 24 will define the set of 256 10.10.[0-255].0/24 address pools. 
5012    #[serde(rename = "DefaultAddressPools")]
5013    #[serde(skip_serializing_if="Option::is_none")]
5014    pub default_address_pools: Option<Vec<SystemInfoDefaultAddressPools>>,
5015
5016    /// List of warnings / informational messages about missing features, or issues related to the daemon configuration.  These messages can be printed by the client as information to the user. 
5017    #[serde(rename = "Warnings")]
5018    #[serde(skip_serializing_if="Option::is_none")]
5019    pub warnings: Option<Vec<String>>,
5020
5021}
5022
5023#[allow(non_camel_case_types)]
5024#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
5025pub enum SystemInfoCgroupDriverEnum { 
5026    #[serde(rename = "")]
5027    EMPTY,
5028    #[serde(rename = "cgroupfs")]
5029    CGROUPFS,
5030    #[serde(rename = "systemd")]
5031    SYSTEMD,
5032    #[serde(rename = "none")]
5033    NONE,
5034}
5035
5036impl ::std::fmt::Display for SystemInfoCgroupDriverEnum {
5037    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
5038        match *self { 
5039            SystemInfoCgroupDriverEnum::EMPTY => write!(f, ""),
5040            SystemInfoCgroupDriverEnum::CGROUPFS => write!(f, "{}", "cgroupfs"),
5041            SystemInfoCgroupDriverEnum::SYSTEMD => write!(f, "{}", "systemd"),
5042            SystemInfoCgroupDriverEnum::NONE => write!(f, "{}", "none"),
5043
5044        }
5045    }
5046}
5047
5048impl ::std::str::FromStr for SystemInfoCgroupDriverEnum {
5049    type Err = String;
5050    fn from_str(s: &str) -> Result<Self, Self::Err> {
5051        match s { 
5052            "" => Ok(SystemInfoCgroupDriverEnum::EMPTY),
5053            "cgroupfs" => Ok(SystemInfoCgroupDriverEnum::CGROUPFS),
5054            "systemd" => Ok(SystemInfoCgroupDriverEnum::SYSTEMD),
5055            "none" => Ok(SystemInfoCgroupDriverEnum::NONE),
5056            x => Err(format!("Invalid enum type: {}", x)),
5057        }
5058    }
5059}
5060
5061impl ::std::convert::AsRef<str> for SystemInfoCgroupDriverEnum {
5062    fn as_ref(&self) -> &str {
5063        match self { 
5064            SystemInfoCgroupDriverEnum::EMPTY => "",
5065            SystemInfoCgroupDriverEnum::CGROUPFS => "cgroupfs",
5066            SystemInfoCgroupDriverEnum::SYSTEMD => "systemd",
5067            SystemInfoCgroupDriverEnum::NONE => "none",
5068        }
5069    }
5070}
5071
5072#[allow(non_camel_case_types)]
5073#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
5074pub enum SystemInfoCgroupVersionEnum { 
5075    #[serde(rename = "")]
5076    EMPTY,
5077    #[serde(rename = "1")]
5078    _1,
5079    #[serde(rename = "2")]
5080    _2,
5081}
5082
5083impl ::std::fmt::Display for SystemInfoCgroupVersionEnum {
5084    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
5085        match *self { 
5086            SystemInfoCgroupVersionEnum::EMPTY => write!(f, ""),
5087            SystemInfoCgroupVersionEnum::_1 => write!(f, "{}", "1"),
5088            SystemInfoCgroupVersionEnum::_2 => write!(f, "{}", "2"),
5089
5090        }
5091    }
5092}
5093
5094impl ::std::str::FromStr for SystemInfoCgroupVersionEnum {
5095    type Err = String;
5096    fn from_str(s: &str) -> Result<Self, Self::Err> {
5097        match s { 
5098            "" => Ok(SystemInfoCgroupVersionEnum::EMPTY),
5099            "1" => Ok(SystemInfoCgroupVersionEnum::_1),
5100            "2" => Ok(SystemInfoCgroupVersionEnum::_2),
5101            x => Err(format!("Invalid enum type: {}", x)),
5102        }
5103    }
5104}
5105
5106impl ::std::convert::AsRef<str> for SystemInfoCgroupVersionEnum {
5107    fn as_ref(&self) -> &str {
5108        match self { 
5109            SystemInfoCgroupVersionEnum::EMPTY => "",
5110            SystemInfoCgroupVersionEnum::_1 => "1",
5111            SystemInfoCgroupVersionEnum::_2 => "2",
5112        }
5113    }
5114}
5115
5116#[allow(non_camel_case_types)]
5117#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
5118pub enum SystemInfoIsolationEnum { 
5119    #[serde(rename = "")]
5120    EMPTY,
5121    #[serde(rename = "default")]
5122    DEFAULT,
5123    #[serde(rename = "hyperv")]
5124    HYPERV,
5125    #[serde(rename = "process")]
5126    PROCESS,
5127}
5128
5129impl ::std::fmt::Display for SystemInfoIsolationEnum {
5130    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
5131        match *self { 
5132            SystemInfoIsolationEnum::EMPTY => write!(f, ""),
5133            SystemInfoIsolationEnum::DEFAULT => write!(f, "{}", "default"),
5134            SystemInfoIsolationEnum::HYPERV => write!(f, "{}", "hyperv"),
5135            SystemInfoIsolationEnum::PROCESS => write!(f, "{}", "process"),
5136
5137        }
5138    }
5139}
5140
5141impl ::std::str::FromStr for SystemInfoIsolationEnum {
5142    type Err = String;
5143    fn from_str(s: &str) -> Result<Self, Self::Err> {
5144        match s { 
5145            "" => Ok(SystemInfoIsolationEnum::EMPTY),
5146            "default" => Ok(SystemInfoIsolationEnum::DEFAULT),
5147            "hyperv" => Ok(SystemInfoIsolationEnum::HYPERV),
5148            "process" => Ok(SystemInfoIsolationEnum::PROCESS),
5149            x => Err(format!("Invalid enum type: {}", x)),
5150        }
5151    }
5152}
5153
5154impl ::std::convert::AsRef<str> for SystemInfoIsolationEnum {
5155    fn as_ref(&self) -> &str {
5156        match self { 
5157            SystemInfoIsolationEnum::EMPTY => "",
5158            SystemInfoIsolationEnum::DEFAULT => "default",
5159            SystemInfoIsolationEnum::HYPERV => "hyperv",
5160            SystemInfoIsolationEnum::PROCESS => "process",
5161        }
5162    }
5163}
5164
5165#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5166pub struct SystemInfoDefaultAddressPools {
5167    /// The network address in CIDR format
5168    #[serde(rename = "Base")]
5169    #[serde(skip_serializing_if="Option::is_none")]
5170    pub base: Option<String>,
5171
5172    /// The network pool size
5173    #[serde(rename = "Size")]
5174    #[serde(skip_serializing_if="Option::is_none")]
5175    pub size: Option<i64>,
5176
5177}
5178
5179/// Response of Engine API: GET \"/version\" 
5180#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5181pub struct SystemVersion {
5182    #[serde(rename = "Platform")]
5183    #[serde(skip_serializing_if="Option::is_none")]
5184    pub platform: Option<SystemVersionPlatform>,
5185
5186    /// Information about system components 
5187    #[serde(rename = "Components")]
5188    #[serde(skip_serializing_if="Option::is_none")]
5189    pub components: Option<Vec<SystemVersionComponents>>,
5190
5191    /// The version of the daemon
5192    #[serde(rename = "Version")]
5193    #[serde(skip_serializing_if="Option::is_none")]
5194    pub version: Option<String>,
5195
5196    /// The default (and highest) API version that is supported by the daemon 
5197    #[serde(rename = "ApiVersion")]
5198    #[serde(skip_serializing_if="Option::is_none")]
5199    pub api_version: Option<String>,
5200
5201    /// The minimum API version that is supported by the daemon 
5202    #[serde(rename = "MinAPIVersion")]
5203    #[serde(skip_serializing_if="Option::is_none")]
5204    pub min_api_version: Option<String>,
5205
5206    /// The Git commit of the source code that was used to build the daemon 
5207    #[serde(rename = "GitCommit")]
5208    #[serde(skip_serializing_if="Option::is_none")]
5209    pub git_commit: Option<String>,
5210
5211    /// The version Go used to compile the daemon, and the version of the Go runtime in use. 
5212    #[serde(rename = "GoVersion")]
5213    #[serde(skip_serializing_if="Option::is_none")]
5214    pub go_version: Option<String>,
5215
5216    /// The operating system that the daemon is running on (\"linux\" or \"windows\") 
5217    #[serde(rename = "Os")]
5218    #[serde(skip_serializing_if="Option::is_none")]
5219    pub os: Option<String>,
5220
5221    /// The architecture that the daemon is running on 
5222    #[serde(rename = "Arch")]
5223    #[serde(skip_serializing_if="Option::is_none")]
5224    pub arch: Option<String>,
5225
5226    /// The kernel version (`uname -r`) that the daemon is running on.  This field is omitted when empty. 
5227    #[serde(rename = "KernelVersion")]
5228    #[serde(skip_serializing_if="Option::is_none")]
5229    pub kernel_version: Option<String>,
5230
5231    /// Indicates if the daemon is started with experimental features enabled.  This field is omitted when empty / false. 
5232    #[serde(rename = "Experimental")]
5233    #[serde(skip_serializing_if="Option::is_none")]
5234    pub experimental: Option<bool>,
5235
5236    /// The date and time that the daemon was compiled. 
5237    #[serde(rename = "BuildTime")]
5238    #[serde(skip_serializing_if="Option::is_none")]
5239    pub build_time: Option<String>,
5240
5241}
5242
5243#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5244pub struct SystemVersionComponents {
5245    /// Name of the component 
5246    #[serde(rename = "Name")]
5247    pub name: String,
5248
5249    /// Version of the component 
5250    #[serde(rename = "Version")]
5251    pub version: String,
5252
5253    /// Key/value pairs of strings with additional information about the component. These values are intended for informational purposes only, and their content is not defined, and not part of the API specification.  These messages can be printed by the client as information to the user. 
5254    #[serde(rename = "Details")]
5255    #[serde(skip_serializing_if="Option::is_none")]
5256    pub details: Option<HashMap<(), ()>>,
5257
5258}
5259
5260#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5261pub struct SystemVersionPlatform {
5262    #[serde(rename = "Name")]
5263    pub name: String,
5264
5265}
5266
5267#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5268pub struct Task {
5269    /// The ID of the task.
5270    #[serde(rename = "ID")]
5271    #[serde(skip_serializing_if="Option::is_none")]
5272    pub id: Option<String>,
5273
5274    #[serde(rename = "Version")]
5275    #[serde(skip_serializing_if="Option::is_none")]
5276    pub version: Option<ObjectVersion>,
5277
5278    #[serde(rename = "CreatedAt")]
5279    #[serde(skip_serializing_if="Option::is_none")]
5280    pub created_at: Option<DateTime<Utc>>,
5281
5282    #[serde(rename = "UpdatedAt")]
5283    #[serde(skip_serializing_if="Option::is_none")]
5284    pub updated_at: Option<DateTime<Utc>>,
5285
5286    /// Name of the task.
5287    #[serde(rename = "Name")]
5288    #[serde(skip_serializing_if="Option::is_none")]
5289    pub name: Option<String>,
5290
5291    /// User-defined key/value metadata.
5292    #[serde(rename = "Labels")]
5293    #[serde(skip_serializing_if="Option::is_none")]
5294    pub labels: Option<HashMap<String, String>>,
5295
5296    #[serde(rename = "Spec")]
5297    #[serde(skip_serializing_if="Option::is_none")]
5298    pub spec: Option<TaskSpec>,
5299
5300    /// The ID of the service this task is part of.
5301    #[serde(rename = "ServiceID")]
5302    #[serde(skip_serializing_if="Option::is_none")]
5303    pub service_id: Option<String>,
5304
5305    #[serde(rename = "Slot")]
5306    #[serde(skip_serializing_if="Option::is_none")]
5307    pub slot: Option<i64>,
5308
5309    /// The ID of the node that this task is on.
5310    #[serde(rename = "NodeID")]
5311    #[serde(skip_serializing_if="Option::is_none")]
5312    pub node_id: Option<String>,
5313
5314    #[serde(rename = "AssignedGenericResources")]
5315    #[serde(skip_serializing_if="Option::is_none")]
5316    pub assigned_generic_resources: Option<GenericResources>,
5317
5318    #[serde(rename = "Status")]
5319    #[serde(skip_serializing_if="Option::is_none")]
5320    pub status: Option<TaskStatus>,
5321
5322    #[serde(rename = "DesiredState")]
5323    #[serde(skip_serializing_if="Option::is_none")]
5324    pub desired_state: Option<TaskState>,
5325
5326    /// If the Service this Task belongs to is a job-mode service, contains the JobIteration of the Service this Task was created for. Absent if the Task was created for a Replicated or Global Service. 
5327    #[serde(rename = "JobIteration")]
5328    #[serde(skip_serializing_if="Option::is_none")]
5329    pub job_iteration: Option<ObjectVersion>,
5330
5331}
5332
5333/// User modifiable task configuration.
5334#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5335pub struct TaskSpec {
5336    #[serde(rename = "PluginSpec")]
5337    #[serde(skip_serializing_if="Option::is_none")]
5338    pub plugin_spec: Option<TaskSpecPluginSpec>,
5339
5340    #[serde(rename = "ContainerSpec")]
5341    #[serde(skip_serializing_if="Option::is_none")]
5342    pub container_spec: Option<TaskSpecContainerSpec>,
5343
5344    #[serde(rename = "NetworkAttachmentSpec")]
5345    #[serde(skip_serializing_if="Option::is_none")]
5346    pub network_attachment_spec: Option<TaskSpecNetworkAttachmentSpec>,
5347
5348    #[serde(rename = "Resources")]
5349    #[serde(skip_serializing_if="Option::is_none")]
5350    pub resources: Option<TaskSpecResources>,
5351
5352    #[serde(rename = "RestartPolicy")]
5353    #[serde(skip_serializing_if="Option::is_none")]
5354    pub restart_policy: Option<TaskSpecRestartPolicy>,
5355
5356    #[serde(rename = "Placement")]
5357    #[serde(skip_serializing_if="Option::is_none")]
5358    pub placement: Option<TaskSpecPlacement>,
5359
5360    /// A counter that triggers an update even if no relevant parameters have been changed. 
5361    #[serde(rename = "ForceUpdate")]
5362    #[serde(skip_serializing_if="Option::is_none")]
5363    pub force_update: Option<i64>,
5364
5365    /// Runtime is the type of runtime specified for the task executor. 
5366    #[serde(rename = "Runtime")]
5367    #[serde(skip_serializing_if="Option::is_none")]
5368    pub runtime: Option<String>,
5369
5370    /// Specifies which networks the service should attach to.
5371    #[serde(rename = "Networks")]
5372    #[serde(skip_serializing_if="Option::is_none")]
5373    pub networks: Option<Vec<NetworkAttachmentConfig>>,
5374
5375    #[serde(rename = "LogDriver")]
5376    #[serde(skip_serializing_if="Option::is_none")]
5377    pub log_driver: Option<TaskSpecLogDriver>,
5378
5379}
5380
5381/// Container spec for the service.  <p><br /></p>  > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are > mutually exclusive. PluginSpec is only used when the Runtime field > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime > field is set to `attachment`. 
5382#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5383pub struct TaskSpecContainerSpec {
5384    /// The image name to use for the container
5385    #[serde(rename = "Image")]
5386    #[serde(skip_serializing_if="Option::is_none")]
5387    pub image: Option<String>,
5388
5389    /// User-defined key/value data.
5390    #[serde(rename = "Labels")]
5391    #[serde(skip_serializing_if="Option::is_none")]
5392    pub labels: Option<HashMap<String, String>>,
5393
5394    /// The command to be run in the image.
5395    #[serde(rename = "Command")]
5396    #[serde(skip_serializing_if="Option::is_none")]
5397    pub command: Option<Vec<String>>,
5398
5399    /// Arguments to the command.
5400    #[serde(rename = "Args")]
5401    #[serde(skip_serializing_if="Option::is_none")]
5402    pub args: Option<Vec<String>>,
5403
5404    /// The hostname to use for the container, as a valid [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. 
5405    #[serde(rename = "Hostname")]
5406    #[serde(skip_serializing_if="Option::is_none")]
5407    pub hostname: Option<String>,
5408
5409    /// A list of environment variables in the form `VAR=value`. 
5410    #[serde(rename = "Env")]
5411    #[serde(skip_serializing_if="Option::is_none")]
5412    pub env: Option<Vec<String>>,
5413
5414    /// The working directory for commands to run in.
5415    #[serde(rename = "Dir")]
5416    #[serde(skip_serializing_if="Option::is_none")]
5417    pub dir: Option<String>,
5418
5419    /// The user inside the container.
5420    #[serde(rename = "User")]
5421    #[serde(skip_serializing_if="Option::is_none")]
5422    pub user: Option<String>,
5423
5424    /// A list of additional groups that the container process will run as. 
5425    #[serde(rename = "Groups")]
5426    #[serde(skip_serializing_if="Option::is_none")]
5427    pub groups: Option<Vec<String>>,
5428
5429    #[serde(rename = "Privileges")]
5430    #[serde(skip_serializing_if="Option::is_none")]
5431    pub privileges: Option<TaskSpecContainerSpecPrivileges>,
5432
5433    /// Whether a pseudo-TTY should be allocated.
5434    #[serde(rename = "TTY")]
5435    #[serde(skip_serializing_if="Option::is_none")]
5436    pub tty: Option<bool>,
5437
5438    /// Open `stdin`
5439    #[serde(rename = "OpenStdin")]
5440    #[serde(skip_serializing_if="Option::is_none")]
5441    pub open_stdin: Option<bool>,
5442
5443    /// Mount the container's root filesystem as read only.
5444    #[serde(rename = "ReadOnly")]
5445    #[serde(skip_serializing_if="Option::is_none")]
5446    pub read_only: Option<bool>,
5447
5448    /// Specification for mounts to be added to containers created as part of the service. 
5449    #[serde(rename = "Mounts")]
5450    #[serde(skip_serializing_if="Option::is_none")]
5451    pub mounts: Option<Vec<Mount>>,
5452
5453    /// Signal to stop the container.
5454    #[serde(rename = "StopSignal")]
5455    #[serde(skip_serializing_if="Option::is_none")]
5456    pub stop_signal: Option<String>,
5457
5458    /// Amount of time to wait for the container to terminate before forcefully killing it. 
5459    #[serde(rename = "StopGracePeriod")]
5460    #[serde(skip_serializing_if="Option::is_none")]
5461    pub stop_grace_period: Option<i64>,
5462
5463    #[serde(rename = "HealthCheck")]
5464    #[serde(skip_serializing_if="Option::is_none")]
5465    pub health_check: Option<HealthConfig>,
5466
5467    /// A list of hostname/IP mappings to add to the container's `hosts` file. The format of extra hosts is specified in the [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) man page:      IP_address canonical_hostname [aliases...] 
5468    #[serde(rename = "Hosts")]
5469    #[serde(skip_serializing_if="Option::is_none")]
5470    pub hosts: Option<Vec<String>>,
5471
5472    #[serde(rename = "DNSConfig")]
5473    #[serde(skip_serializing_if="Option::is_none")]
5474    pub dns_config: Option<TaskSpecContainerSpecDnsConfig>,
5475
5476    /// Secrets contains references to zero or more secrets that will be exposed to the service. 
5477    #[serde(rename = "Secrets")]
5478    #[serde(skip_serializing_if="Option::is_none")]
5479    pub secrets: Option<Vec<TaskSpecContainerSpecSecrets>>,
5480
5481    /// Configs contains references to zero or more configs that will be exposed to the service. 
5482    #[serde(rename = "Configs")]
5483    #[serde(skip_serializing_if="Option::is_none")]
5484    pub configs: Option<Vec<TaskSpecContainerSpecConfigs>>,
5485
5486    /// Isolation technology of the containers running the service. (Windows only) 
5487    #[serde(rename = "Isolation")]
5488    #[serde(skip_serializing_if="Option::is_none")]
5489    pub isolation: Option<TaskSpecContainerSpecIsolationEnum>,
5490
5491    /// Run an init inside the container that forwards signals and reaps processes. This field is omitted if empty, and the default (as configured on the daemon) is used. 
5492    #[serde(rename = "Init")]
5493    #[serde(skip_serializing_if="Option::is_none")]
5494    pub init: Option<bool>,
5495
5496    /// Set kernel namedspaced parameters (sysctls) in the container. The Sysctls option on services accepts the same sysctls as the are supported on containers. Note that while the same sysctls are supported, no guarantees or checks are made about their suitability for a clustered environment, and it's up to the user to determine whether a given sysctl will work properly in a Service. 
5497    #[serde(rename = "Sysctls")]
5498    #[serde(skip_serializing_if="Option::is_none")]
5499    pub sysctls: Option<HashMap<String, String>>,
5500
5501    /// A list of kernel capabilities to add to the default set for the container. 
5502    #[serde(rename = "CapabilityAdd")]
5503    #[serde(skip_serializing_if="Option::is_none")]
5504    pub capability_add: Option<Vec<String>>,
5505
5506    /// A list of kernel capabilities to drop from the default set for the container. 
5507    #[serde(rename = "CapabilityDrop")]
5508    #[serde(skip_serializing_if="Option::is_none")]
5509    pub capability_drop: Option<Vec<String>>,
5510
5511    /// A list of resource limits to set in the container. For example: `{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}`\" 
5512    #[serde(rename = "Ulimits")]
5513    #[serde(skip_serializing_if="Option::is_none")]
5514    pub ulimits: Option<Vec<ResourcesUlimits>>,
5515
5516}
5517
5518#[allow(non_camel_case_types)]
5519#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
5520pub enum TaskSpecContainerSpecIsolationEnum { 
5521    #[serde(rename = "")]
5522    EMPTY,
5523    #[serde(rename = "default")]
5524    DEFAULT,
5525    #[serde(rename = "process")]
5526    PROCESS,
5527    #[serde(rename = "hyperv")]
5528    HYPERV,
5529}
5530
5531impl ::std::fmt::Display for TaskSpecContainerSpecIsolationEnum {
5532    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
5533        match *self { 
5534            TaskSpecContainerSpecIsolationEnum::EMPTY => write!(f, ""),
5535            TaskSpecContainerSpecIsolationEnum::DEFAULT => write!(f, "{}", "default"),
5536            TaskSpecContainerSpecIsolationEnum::PROCESS => write!(f, "{}", "process"),
5537            TaskSpecContainerSpecIsolationEnum::HYPERV => write!(f, "{}", "hyperv"),
5538
5539        }
5540    }
5541}
5542
5543impl ::std::str::FromStr for TaskSpecContainerSpecIsolationEnum {
5544    type Err = String;
5545    fn from_str(s: &str) -> Result<Self, Self::Err> {
5546        match s { 
5547            "" => Ok(TaskSpecContainerSpecIsolationEnum::EMPTY),
5548            "default" => Ok(TaskSpecContainerSpecIsolationEnum::DEFAULT),
5549            "process" => Ok(TaskSpecContainerSpecIsolationEnum::PROCESS),
5550            "hyperv" => Ok(TaskSpecContainerSpecIsolationEnum::HYPERV),
5551            x => Err(format!("Invalid enum type: {}", x)),
5552        }
5553    }
5554}
5555
5556impl ::std::convert::AsRef<str> for TaskSpecContainerSpecIsolationEnum {
5557    fn as_ref(&self) -> &str {
5558        match self { 
5559            TaskSpecContainerSpecIsolationEnum::EMPTY => "",
5560            TaskSpecContainerSpecIsolationEnum::DEFAULT => "default",
5561            TaskSpecContainerSpecIsolationEnum::PROCESS => "process",
5562            TaskSpecContainerSpecIsolationEnum::HYPERV => "hyperv",
5563        }
5564    }
5565}
5566
5567#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5568pub struct TaskSpecContainerSpecConfigs {
5569    #[serde(rename = "File")]
5570    #[serde(skip_serializing_if="Option::is_none")]
5571    pub file: Option<TaskSpecContainerSpecFile1>,
5572
5573    /// Runtime represents a target that is not mounted into the container but is used by the task  <p><br /><p>  > **Note**: `Configs.File` and `Configs.Runtime` are mutually > exclusive 
5574    #[serde(rename = "Runtime")]
5575    #[serde(skip_serializing_if="Option::is_none")]
5576    pub runtime: Option<HashMap<(), ()>>,
5577
5578    /// ConfigID represents the ID of the specific config that we're referencing. 
5579    #[serde(rename = "ConfigID")]
5580    #[serde(skip_serializing_if="Option::is_none")]
5581    pub config_id: Option<String>,
5582
5583    /// ConfigName is the name of the config that this references, but this is just provided for lookup/display purposes. The config in the reference will be identified by its ID. 
5584    #[serde(rename = "ConfigName")]
5585    #[serde(skip_serializing_if="Option::is_none")]
5586    pub config_name: Option<String>,
5587
5588}
5589
5590/// Specification for DNS related configurations in resolver configuration file (`resolv.conf`). 
5591#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5592pub struct TaskSpecContainerSpecDnsConfig {
5593    /// The IP addresses of the name servers.
5594    #[serde(rename = "Nameservers")]
5595    #[serde(skip_serializing_if="Option::is_none")]
5596    pub nameservers: Option<Vec<String>>,
5597
5598    /// A search list for host-name lookup.
5599    #[serde(rename = "Search")]
5600    #[serde(skip_serializing_if="Option::is_none")]
5601    pub search: Option<Vec<String>>,
5602
5603    /// A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.). 
5604    #[serde(rename = "Options")]
5605    #[serde(skip_serializing_if="Option::is_none")]
5606    pub options: Option<Vec<String>>,
5607
5608}
5609
5610/// File represents a specific target that is backed by a file. 
5611#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5612pub struct TaskSpecContainerSpecFile {
5613    /// Name represents the final filename in the filesystem. 
5614    #[serde(rename = "Name")]
5615    #[serde(skip_serializing_if="Option::is_none")]
5616    pub name: Option<String>,
5617
5618    /// UID represents the file UID.
5619    #[serde(rename = "UID")]
5620    #[serde(skip_serializing_if="Option::is_none")]
5621    pub uid: Option<String>,
5622
5623    /// GID represents the file GID.
5624    #[serde(rename = "GID")]
5625    #[serde(skip_serializing_if="Option::is_none")]
5626    pub gid: Option<String>,
5627
5628    /// Mode represents the FileMode of the file.
5629    #[serde(rename = "Mode")]
5630    #[serde(skip_serializing_if="Option::is_none")]
5631    pub mode: Option<u32>,
5632
5633}
5634
5635/// File represents a specific target that is backed by a file.  <p><br /><p>  > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive 
5636#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5637pub struct TaskSpecContainerSpecFile1 {
5638    /// Name represents the final filename in the filesystem. 
5639    #[serde(rename = "Name")]
5640    #[serde(skip_serializing_if="Option::is_none")]
5641    pub name: Option<String>,
5642
5643    /// UID represents the file UID.
5644    #[serde(rename = "UID")]
5645    #[serde(skip_serializing_if="Option::is_none")]
5646    pub uid: Option<String>,
5647
5648    /// GID represents the file GID.
5649    #[serde(rename = "GID")]
5650    #[serde(skip_serializing_if="Option::is_none")]
5651    pub gid: Option<String>,
5652
5653    /// Mode represents the FileMode of the file.
5654    #[serde(rename = "Mode")]
5655    #[serde(skip_serializing_if="Option::is_none")]
5656    pub mode: Option<u32>,
5657
5658}
5659
5660/// Security options for the container
5661#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5662pub struct TaskSpecContainerSpecPrivileges {
5663    #[serde(rename = "CredentialSpec")]
5664    #[serde(skip_serializing_if="Option::is_none")]
5665    pub credential_spec: Option<TaskSpecContainerSpecPrivilegesCredentialSpec>,
5666
5667    #[serde(rename = "SELinuxContext")]
5668    #[serde(skip_serializing_if="Option::is_none")]
5669    pub se_linux_context: Option<TaskSpecContainerSpecPrivilegesSeLinuxContext>,
5670
5671}
5672
5673/// CredentialSpec for managed service account (Windows only)
5674#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5675pub struct TaskSpecContainerSpecPrivilegesCredentialSpec {
5676    /// Load credential spec from a Swarm Config with the given ID. The specified config must also be present in the Configs field with the Runtime property set.  <p><br /></p>   > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, > and `CredentialSpec.Config` are mutually exclusive. 
5677    #[serde(rename = "Config")]
5678    #[serde(skip_serializing_if="Option::is_none")]
5679    pub config: Option<String>,
5680
5681    /// Load credential spec from this file. The file is read by the daemon, and must be present in the `CredentialSpecs` subdirectory in the docker data directory, which defaults to `C:\\ProgramData\\Docker\\` on Windows.  For example, specifying `spec.json` loads `C:\\ProgramData\\Docker\\CredentialSpecs\\spec.json`.  <p><br /></p>  > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, > and `CredentialSpec.Config` are mutually exclusive. 
5682    #[serde(rename = "File")]
5683    #[serde(skip_serializing_if="Option::is_none")]
5684    pub file: Option<String>,
5685
5686    /// Load credential spec from this value in the Windows registry. The specified registry value must be located in:  `HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Virtualization\\Containers\\CredentialSpecs`  <p><br /></p>   > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, > and `CredentialSpec.Config` are mutually exclusive. 
5687    #[serde(rename = "Registry")]
5688    #[serde(skip_serializing_if="Option::is_none")]
5689    pub registry: Option<String>,
5690
5691}
5692
5693/// SELinux labels of the container
5694#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5695pub struct TaskSpecContainerSpecPrivilegesSeLinuxContext {
5696    /// Disable SELinux
5697    #[serde(rename = "Disable")]
5698    #[serde(skip_serializing_if="Option::is_none")]
5699    pub disable: Option<bool>,
5700
5701    /// SELinux user label
5702    #[serde(rename = "User")]
5703    #[serde(skip_serializing_if="Option::is_none")]
5704    pub user: Option<String>,
5705
5706    /// SELinux role label
5707    #[serde(rename = "Role")]
5708    #[serde(skip_serializing_if="Option::is_none")]
5709    pub role: Option<String>,
5710
5711    /// SELinux type label
5712    #[serde(rename = "Type")]
5713    #[serde(skip_serializing_if="Option::is_none")]
5714    pub typ: Option<String>,
5715
5716    /// SELinux level label
5717    #[serde(rename = "Level")]
5718    #[serde(skip_serializing_if="Option::is_none")]
5719    pub level: Option<String>,
5720
5721}
5722
5723#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5724pub struct TaskSpecContainerSpecSecrets {
5725    #[serde(rename = "File")]
5726    #[serde(skip_serializing_if="Option::is_none")]
5727    pub file: Option<TaskSpecContainerSpecFile>,
5728
5729    /// SecretID represents the ID of the specific secret that we're referencing. 
5730    #[serde(rename = "SecretID")]
5731    #[serde(skip_serializing_if="Option::is_none")]
5732    pub secret_id: Option<String>,
5733
5734    /// SecretName is the name of the secret that this references, but this is just provided for lookup/display purposes. The secret in the reference will be identified by its ID. 
5735    #[serde(rename = "SecretName")]
5736    #[serde(skip_serializing_if="Option::is_none")]
5737    pub secret_name: Option<String>,
5738
5739}
5740
5741/// Specifies the log driver to use for tasks created from this spec. If not present, the default one for the swarm will be used, finally falling back to the engine default if not specified. 
5742#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5743pub struct TaskSpecLogDriver {
5744    #[serde(rename = "Name")]
5745    #[serde(skip_serializing_if="Option::is_none")]
5746    pub name: Option<String>,
5747
5748    #[serde(rename = "Options")]
5749    #[serde(skip_serializing_if="Option::is_none")]
5750    pub options: Option<HashMap<String, String>>,
5751
5752}
5753
5754/// Read-only spec type for non-swarm containers attached to swarm overlay networks.  <p><br /></p>  > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are > mutually exclusive. PluginSpec is only used when the Runtime field > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime > field is set to `attachment`. 
5755#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5756pub struct TaskSpecNetworkAttachmentSpec {
5757    /// ID of the container represented by this task
5758    #[serde(rename = "ContainerID")]
5759    #[serde(skip_serializing_if="Option::is_none")]
5760    pub container_id: Option<String>,
5761
5762}
5763
5764#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5765pub struct TaskSpecPlacement {
5766    /// An array of constraint expressions to limit the set of nodes where a task can be scheduled. Constraint expressions can either use a _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find nodes that satisfy every expression (AND match). Constraints can match node or Docker Engine labels as follows:  node attribute       | matches                        | example ---------------------|--------------------------------|----------------------------------------------- `node.id`            | Node ID                        | `node.id==2ivku8v2gvtg4` `node.hostname`      | Node hostname                  | `node.hostname!=node-2` `node.role`          | Node role (`manager`/`worker`) | `node.role==manager` `node.platform.os`   | Node operating system          | `node.platform.os==windows` `node.platform.arch` | Node architecture              | `node.platform.arch==x86_64` `node.labels`        | User-defined node labels       | `node.labels.security==high` `engine.labels`      | Docker Engine's labels         | `engine.labels.operatingsystem==ubuntu-14.04`  `engine.labels` apply to Docker Engine labels like operating system, drivers, etc. Swarm administrators add `node.labels` for operational purposes by using the [`node update endpoint`](#operation/NodeUpdate). 
5767    #[serde(rename = "Constraints")]
5768    #[serde(skip_serializing_if="Option::is_none")]
5769    pub constraints: Option<Vec<String>>,
5770
5771    /// Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence. 
5772    #[serde(rename = "Preferences")]
5773    #[serde(skip_serializing_if="Option::is_none")]
5774    pub preferences: Option<Vec<TaskSpecPlacementPreferences>>,
5775
5776    /// Maximum number of replicas for per node (default value is 0, which is unlimited) 
5777    #[serde(rename = "MaxReplicas")]
5778    #[serde(skip_serializing_if="Option::is_none")]
5779    pub max_replicas: Option<i64>,
5780
5781    /// Platforms stores all the platforms that the service's image can run on. This field is used in the platform filter for scheduling. If empty, then the platform filter is off, meaning there are no scheduling restrictions. 
5782    #[serde(rename = "Platforms")]
5783    #[serde(skip_serializing_if="Option::is_none")]
5784    pub platforms: Option<Vec<Platform>>,
5785
5786}
5787
5788#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5789pub struct TaskSpecPlacementPreferences {
5790    #[serde(rename = "Spread")]
5791    #[serde(skip_serializing_if="Option::is_none")]
5792    pub spread: Option<TaskSpecPlacementSpread>,
5793
5794}
5795
5796#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5797pub struct TaskSpecPlacementSpread {
5798    /// label descriptor, such as `engine.labels.az`. 
5799    #[serde(rename = "SpreadDescriptor")]
5800    #[serde(skip_serializing_if="Option::is_none")]
5801    pub spread_descriptor: Option<String>,
5802
5803}
5804
5805/// Plugin spec for the service.  *(Experimental release only.)*  <p><br /></p>  > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are > mutually exclusive. PluginSpec is only used when the Runtime field > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime > field is set to `attachment`. 
5806#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5807pub struct TaskSpecPluginSpec {
5808    /// The name or 'alias' to use for the plugin.
5809    #[serde(rename = "Name")]
5810    #[serde(skip_serializing_if="Option::is_none")]
5811    pub name: Option<String>,
5812
5813    /// The plugin image reference to use.
5814    #[serde(rename = "Remote")]
5815    #[serde(skip_serializing_if="Option::is_none")]
5816    pub remote: Option<String>,
5817
5818    /// Disable the plugin once scheduled.
5819    #[serde(rename = "Disabled")]
5820    #[serde(skip_serializing_if="Option::is_none")]
5821    pub disabled: Option<bool>,
5822
5823    #[serde(rename = "PluginPrivilege")]
5824    #[serde(skip_serializing_if="Option::is_none")]
5825    pub plugin_privilege: Option<Vec<Body>>,
5826
5827}
5828
5829/// Resource requirements which apply to each individual container created as part of the service. 
5830#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5831pub struct TaskSpecResources {
5832    /// Define resources limits.
5833    #[serde(rename = "Limits")]
5834    #[serde(skip_serializing_if="Option::is_none")]
5835    pub limits: Option<Limit>,
5836
5837    /// Define resources reservation.
5838    #[serde(rename = "Reservation")]
5839    #[serde(skip_serializing_if="Option::is_none")]
5840    pub reservation: Option<ResourceObject>,
5841
5842}
5843
5844/// Specification for the restart policy which applies to containers created as part of this service. 
5845#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5846pub struct TaskSpecRestartPolicy {
5847    /// Condition for restart.
5848    #[serde(rename = "Condition")]
5849    #[serde(skip_serializing_if="Option::is_none")]
5850    pub condition: Option<TaskSpecRestartPolicyConditionEnum>,
5851
5852    /// Delay between restart attempts.
5853    #[serde(rename = "Delay")]
5854    #[serde(skip_serializing_if="Option::is_none")]
5855    pub delay: Option<i64>,
5856
5857    /// Maximum attempts to restart a given container before giving up (default value is 0, which is ignored). 
5858    #[serde(rename = "MaxAttempts")]
5859    #[serde(skip_serializing_if="Option::is_none")]
5860    pub max_attempts: Option<i64>,
5861
5862    /// Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded). 
5863    #[serde(rename = "Window")]
5864    #[serde(skip_serializing_if="Option::is_none")]
5865    pub window: Option<i64>,
5866
5867}
5868
5869#[allow(non_camel_case_types)]
5870#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
5871pub enum TaskSpecRestartPolicyConditionEnum { 
5872    #[serde(rename = "")]
5873    EMPTY,
5874    #[serde(rename = "none")]
5875    NONE,
5876    #[serde(rename = "on-failure")]
5877    ON_FAILURE,
5878    #[serde(rename = "any")]
5879    ANY,
5880}
5881
5882impl ::std::fmt::Display for TaskSpecRestartPolicyConditionEnum {
5883    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
5884        match *self { 
5885            TaskSpecRestartPolicyConditionEnum::EMPTY => write!(f, ""),
5886            TaskSpecRestartPolicyConditionEnum::NONE => write!(f, "{}", "none"),
5887            TaskSpecRestartPolicyConditionEnum::ON_FAILURE => write!(f, "{}", "on-failure"),
5888            TaskSpecRestartPolicyConditionEnum::ANY => write!(f, "{}", "any"),
5889
5890        }
5891    }
5892}
5893
5894impl ::std::str::FromStr for TaskSpecRestartPolicyConditionEnum {
5895    type Err = String;
5896    fn from_str(s: &str) -> Result<Self, Self::Err> {
5897        match s { 
5898            "" => Ok(TaskSpecRestartPolicyConditionEnum::EMPTY),
5899            "none" => Ok(TaskSpecRestartPolicyConditionEnum::NONE),
5900            "on-failure" => Ok(TaskSpecRestartPolicyConditionEnum::ON_FAILURE),
5901            "any" => Ok(TaskSpecRestartPolicyConditionEnum::ANY),
5902            x => Err(format!("Invalid enum type: {}", x)),
5903        }
5904    }
5905}
5906
5907impl ::std::convert::AsRef<str> for TaskSpecRestartPolicyConditionEnum {
5908    fn as_ref(&self) -> &str {
5909        match self { 
5910            TaskSpecRestartPolicyConditionEnum::EMPTY => "",
5911            TaskSpecRestartPolicyConditionEnum::NONE => "none",
5912            TaskSpecRestartPolicyConditionEnum::ON_FAILURE => "on-failure",
5913            TaskSpecRestartPolicyConditionEnum::ANY => "any",
5914        }
5915    }
5916}
5917
5918/// Enumeration of values.
5919/// Since this enum's variants do not hold data, we can easily define them them as `#[repr(C)]`
5920/// which helps with FFI.
5921#[allow(non_camel_case_types)]
5922#[repr(C)]
5923#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
5924pub enum TaskState { 
5925    #[serde(rename = "new")]
5926    NEW,
5927    #[serde(rename = "allocated")]
5928    ALLOCATED,
5929    #[serde(rename = "pending")]
5930    PENDING,
5931    #[serde(rename = "assigned")]
5932    ASSIGNED,
5933    #[serde(rename = "accepted")]
5934    ACCEPTED,
5935    #[serde(rename = "preparing")]
5936    PREPARING,
5937    #[serde(rename = "ready")]
5938    READY,
5939    #[serde(rename = "starting")]
5940    STARTING,
5941    #[serde(rename = "running")]
5942    RUNNING,
5943    #[serde(rename = "complete")]
5944    COMPLETE,
5945    #[serde(rename = "shutdown")]
5946    SHUTDOWN,
5947    #[serde(rename = "failed")]
5948    FAILED,
5949    #[serde(rename = "rejected")]
5950    REJECTED,
5951    #[serde(rename = "remove")]
5952    REMOVE,
5953    #[serde(rename = "orphaned")]
5954    ORPHANED,
5955}
5956
5957impl ::std::fmt::Display for TaskState {
5958    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
5959        match *self { 
5960            TaskState::NEW => write!(f, "{}", "new"),
5961            TaskState::ALLOCATED => write!(f, "{}", "allocated"),
5962            TaskState::PENDING => write!(f, "{}", "pending"),
5963            TaskState::ASSIGNED => write!(f, "{}", "assigned"),
5964            TaskState::ACCEPTED => write!(f, "{}", "accepted"),
5965            TaskState::PREPARING => write!(f, "{}", "preparing"),
5966            TaskState::READY => write!(f, "{}", "ready"),
5967            TaskState::STARTING => write!(f, "{}", "starting"),
5968            TaskState::RUNNING => write!(f, "{}", "running"),
5969            TaskState::COMPLETE => write!(f, "{}", "complete"),
5970            TaskState::SHUTDOWN => write!(f, "{}", "shutdown"),
5971            TaskState::FAILED => write!(f, "{}", "failed"),
5972            TaskState::REJECTED => write!(f, "{}", "rejected"),
5973            TaskState::REMOVE => write!(f, "{}", "remove"),
5974            TaskState::ORPHANED => write!(f, "{}", "orphaned"),
5975        }
5976    }
5977}
5978
5979impl ::std::str::FromStr for TaskState {
5980    type Err = ();
5981    fn from_str(s: &str) -> Result<Self, Self::Err> {
5982        match s {
5983            "new" => Ok(TaskState::NEW),
5984            "allocated" => Ok(TaskState::ALLOCATED),
5985            "pending" => Ok(TaskState::PENDING),
5986            "assigned" => Ok(TaskState::ASSIGNED),
5987            "accepted" => Ok(TaskState::ACCEPTED),
5988            "preparing" => Ok(TaskState::PREPARING),
5989            "ready" => Ok(TaskState::READY),
5990            "starting" => Ok(TaskState::STARTING),
5991            "running" => Ok(TaskState::RUNNING),
5992            "complete" => Ok(TaskState::COMPLETE),
5993            "shutdown" => Ok(TaskState::SHUTDOWN),
5994            "failed" => Ok(TaskState::FAILED),
5995            "rejected" => Ok(TaskState::REJECTED),
5996            "remove" => Ok(TaskState::REMOVE),
5997            "orphaned" => Ok(TaskState::ORPHANED),
5998            _ => Err(()),
5999        }
6000    }
6001}
6002
6003#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6004pub struct TaskStatus {
6005    #[serde(rename = "Timestamp")]
6006    #[serde(skip_serializing_if="Option::is_none")]
6007    pub timestamp: Option<DateTime<Utc>>,
6008
6009    #[serde(rename = "State")]
6010    #[serde(skip_serializing_if="Option::is_none")]
6011    pub state: Option<TaskState>,
6012
6013    #[serde(rename = "Message")]
6014    #[serde(skip_serializing_if="Option::is_none")]
6015    pub message: Option<String>,
6016
6017    #[serde(rename = "Err")]
6018    #[serde(skip_serializing_if="Option::is_none")]
6019    pub err: Option<String>,
6020
6021    #[serde(rename = "ContainerStatus")]
6022    #[serde(skip_serializing_if="Option::is_none")]
6023    pub container_status: Option<TaskStatusContainerStatus>,
6024
6025}
6026
6027#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6028pub struct TaskStatusContainerStatus {
6029    #[serde(rename = "ContainerID")]
6030    #[serde(skip_serializing_if="Option::is_none")]
6031    pub container_id: Option<String>,
6032
6033    #[serde(rename = "PID")]
6034    #[serde(skip_serializing_if="Option::is_none")]
6035    pub pid: Option<i64>,
6036
6037    #[serde(rename = "ExitCode")]
6038    #[serde(skip_serializing_if="Option::is_none")]
6039    pub exit_code: Option<i64>,
6040
6041}
6042
6043#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6044pub struct ThrottleDevice {
6045    /// Device path
6046    #[serde(rename = "Path")]
6047    #[serde(skip_serializing_if="Option::is_none")]
6048    pub path: Option<String>,
6049
6050    /// Rate
6051    #[serde(rename = "Rate")]
6052    #[serde(skip_serializing_if="Option::is_none")]
6053    pub rate: Option<i64>,
6054
6055}
6056
6057/// Information about the issuer of leaf TLS certificates and the trusted root CA certificate. 
6058#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6059pub struct TlsInfo {
6060    /// The root CA certificate(s) that are used to validate leaf TLS certificates. 
6061    #[serde(rename = "TrustRoot")]
6062    #[serde(skip_serializing_if="Option::is_none")]
6063    pub trust_root: Option<String>,
6064
6065    /// The base64-url-safe-encoded raw subject bytes of the issuer.
6066    #[serde(rename = "CertIssuerSubject")]
6067    #[serde(skip_serializing_if="Option::is_none")]
6068    pub cert_issuer_subject: Option<String>,
6069
6070    /// The base64-url-safe-encoded raw public key bytes of the issuer. 
6071    #[serde(rename = "CertIssuerPublicKey")]
6072    #[serde(skip_serializing_if="Option::is_none")]
6073    pub cert_issuer_public_key: Option<String>,
6074
6075}
6076
6077#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6078pub struct UnlockKeyResponse {
6079    /// The swarm's unlock key.
6080    #[serde(rename = "UnlockKey")]
6081    #[serde(skip_serializing_if="Option::is_none")]
6082    pub unlock_key: Option<String>,
6083
6084}
6085
6086#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6087pub struct Volume {
6088    /// Name of the volume.
6089    #[serde(rename = "Name")]
6090    pub name: String,
6091
6092    /// Name of the volume driver used by the volume.
6093    #[serde(rename = "Driver")]
6094    pub driver: String,
6095
6096    /// Mount path of the volume on the host.
6097    #[serde(rename = "Mountpoint")]
6098    pub mountpoint: String,
6099
6100    /// Date/Time the volume was created.
6101    #[serde(rename = "CreatedAt")]
6102    #[serde(skip_serializing_if="Option::is_none")]
6103    pub created_at: Option<DateTime<Utc>>,
6104
6105    /// Low-level details about the volume, provided by the volume driver. Details are returned as a map with key/value pairs: `{\"key\":\"value\",\"key2\":\"value2\"}`.  The `Status` field is optional, and is omitted if the volume driver does not support this feature. 
6106    #[serde(rename = "Status")]
6107    #[serde(skip_serializing_if="Option::is_none")]
6108    pub status: Option<HashMap<String, HashMap<(), ()>>>,
6109
6110    /// User-defined key/value metadata.
6111    #[serde(rename = "Labels")]
6112    #[serde(deserialize_with = "deserialize_nonoptional_map")]
6113    pub labels: HashMap<String, String>,
6114
6115    /// The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level. 
6116    #[serde(rename = "Scope")]
6117    #[serde(skip_serializing_if="Option::is_none")]
6118    #[serde(with = "serde_with::rust::string_empty_as_none")]
6119    pub scope: Option<VolumeScopeEnum>,
6120
6121    /// The driver specific options used when creating the volume. 
6122    #[serde(rename = "Options")]
6123    #[serde(deserialize_with = "deserialize_nonoptional_map")]
6124    pub options: HashMap<String, String>,
6125
6126    #[serde(rename = "UsageData")]
6127    #[serde(skip_serializing_if="Option::is_none")]
6128    pub usage_data: Option<VolumeUsageData>,
6129
6130}
6131
6132#[allow(non_camel_case_types)]
6133#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
6134pub enum VolumeScopeEnum { 
6135    #[serde(rename = "")]
6136    EMPTY,
6137    #[serde(rename = "local")]
6138    LOCAL,
6139    #[serde(rename = "global")]
6140    GLOBAL,
6141}
6142
6143impl ::std::fmt::Display for VolumeScopeEnum {
6144    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
6145        match *self { 
6146            VolumeScopeEnum::EMPTY => write!(f, ""),
6147            VolumeScopeEnum::LOCAL => write!(f, "{}", "local"),
6148            VolumeScopeEnum::GLOBAL => write!(f, "{}", "global"),
6149
6150        }
6151    }
6152}
6153
6154impl ::std::str::FromStr for VolumeScopeEnum {
6155    type Err = String;
6156    fn from_str(s: &str) -> Result<Self, Self::Err> {
6157        match s { 
6158            "" => Ok(VolumeScopeEnum::EMPTY),
6159            "local" => Ok(VolumeScopeEnum::LOCAL),
6160            "global" => Ok(VolumeScopeEnum::GLOBAL),
6161            x => Err(format!("Invalid enum type: {}", x)),
6162        }
6163    }
6164}
6165
6166impl ::std::convert::AsRef<str> for VolumeScopeEnum {
6167    fn as_ref(&self) -> &str {
6168        match self { 
6169            VolumeScopeEnum::EMPTY => "",
6170            VolumeScopeEnum::LOCAL => "local",
6171            VolumeScopeEnum::GLOBAL => "global",
6172        }
6173    }
6174}
6175
6176/// Volume configuration
6177#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6178pub struct VolumeConfig {
6179    /// The new volume's name. If not specified, Docker generates a name. 
6180    #[serde(rename = "Name")]
6181    #[serde(skip_serializing_if="Option::is_none")]
6182    pub name: Option<String>,
6183
6184    /// Name of the volume driver to use.
6185    #[serde(rename = "Driver")]
6186    #[serde(skip_serializing_if="Option::is_none")]
6187    pub driver: Option<String>,
6188
6189    /// A mapping of driver options and values. These options are passed directly to the driver and are driver specific. 
6190    #[serde(rename = "DriverOpts")]
6191    #[serde(skip_serializing_if="Option::is_none")]
6192    pub driver_opts: Option<HashMap<String, String>>,
6193
6194    /// User-defined key/value metadata.
6195    #[serde(rename = "Labels")]
6196    #[serde(skip_serializing_if="Option::is_none")]
6197    pub labels: Option<HashMap<String, String>>,
6198
6199}
6200
6201/// Volume list response
6202#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6203pub struct VolumeListResponse {
6204    /// List of volumes
6205    #[serde(rename = "Volumes")]
6206    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
6207    pub volumes: Vec<Volume>,
6208
6209    /// Warnings that occurred when fetching the list of volumes. 
6210    #[serde(rename = "Warnings")]
6211    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
6212    pub warnings: Vec<String>,
6213
6214}
6215
6216#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6217pub struct VolumePruneResponse {
6218    /// Volumes that were deleted
6219    #[serde(rename = "VolumesDeleted")]
6220    #[serde(skip_serializing_if="Option::is_none")]
6221    pub volumes_deleted: Option<Vec<String>>,
6222
6223    /// Disk space reclaimed in bytes
6224    #[serde(rename = "SpaceReclaimed")]
6225    #[serde(skip_serializing_if="Option::is_none")]
6226    pub space_reclaimed: Option<i64>,
6227
6228}
6229
6230/// Usage details about the volume. This information is used by the `GET /system/df` endpoint, and omitted in other endpoints. 
6231#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6232pub struct VolumeUsageData {
6233    /// Amount of disk space used by the volume (in bytes). This information is only available for volumes created with the `\"local\"` volume driver. For volumes created with other volume drivers, this field is set to `-1` (\"not available\") 
6234    #[serde(rename = "Size")]
6235    pub size: i64,
6236
6237    /// The number of containers referencing this volume. This field is set to `-1` if the reference-count is not available. 
6238    #[serde(rename = "RefCount")]
6239    pub ref_count: i64,
6240
6241}
6242
6243/// Container configuration that depends on the host we are running on
6244#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6245pub struct HostConfig {
6246    /// An integer value representing this container's relative CPU weight versus other containers. 
6247    #[serde(rename = "CpuShares")]
6248    #[serde(skip_serializing_if="Option::is_none")]
6249    pub cpu_shares: Option<i64>,
6250
6251    /// Memory limit in bytes.
6252    #[serde(rename = "Memory")]
6253    #[serde(skip_serializing_if="Option::is_none")]
6254    pub memory: Option<i64>,
6255
6256    /// Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist. 
6257    #[serde(rename = "CgroupParent")]
6258    #[serde(skip_serializing_if="Option::is_none")]
6259    pub cgroup_parent: Option<String>,
6260
6261    /// Block IO weight (relative weight).
6262    #[serde(rename = "BlkioWeight")]
6263    #[serde(skip_serializing_if="Option::is_none")]
6264    pub blkio_weight: Option<u16>,
6265
6266    /// Block IO weight (relative device weight) in the form:  ``` [{\"Path\": \"device_path\", \"Weight\": weight}] ``` 
6267    #[serde(rename = "BlkioWeightDevice")]
6268    #[serde(skip_serializing_if="Option::is_none")]
6269    pub blkio_weight_device: Option<Vec<ResourcesBlkioWeightDevice>>,
6270
6271    /// Limit read rate (bytes per second) from a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
6272    #[serde(rename = "BlkioDeviceReadBps")]
6273    #[serde(skip_serializing_if="Option::is_none")]
6274    pub blkio_device_read_bps: Option<Vec<ThrottleDevice>>,
6275
6276    /// Limit write rate (bytes per second) to a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
6277    #[serde(rename = "BlkioDeviceWriteBps")]
6278    #[serde(skip_serializing_if="Option::is_none")]
6279    pub blkio_device_write_bps: Option<Vec<ThrottleDevice>>,
6280
6281    /// Limit read rate (IO per second) from a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
6282    #[serde(rename = "BlkioDeviceReadIOps")]
6283    #[serde(skip_serializing_if="Option::is_none")]
6284    pub blkio_device_read_iops: Option<Vec<ThrottleDevice>>,
6285
6286    /// Limit write rate (IO per second) to a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
6287    #[serde(rename = "BlkioDeviceWriteIOps")]
6288    #[serde(skip_serializing_if="Option::is_none")]
6289    pub blkio_device_write_iops: Option<Vec<ThrottleDevice>>,
6290
6291    /// The length of a CPU period in microseconds.
6292    #[serde(rename = "CpuPeriod")]
6293    #[serde(skip_serializing_if="Option::is_none")]
6294    pub cpu_period: Option<i64>,
6295
6296    /// Microseconds of CPU time that the container can get in a CPU period. 
6297    #[serde(rename = "CpuQuota")]
6298    #[serde(skip_serializing_if="Option::is_none")]
6299    pub cpu_quota: Option<i64>,
6300
6301    /// The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. 
6302    #[serde(rename = "CpuRealtimePeriod")]
6303    #[serde(skip_serializing_if="Option::is_none")]
6304    pub cpu_realtime_period: Option<i64>,
6305
6306    /// The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. 
6307    #[serde(rename = "CpuRealtimeRuntime")]
6308    #[serde(skip_serializing_if="Option::is_none")]
6309    pub cpu_realtime_runtime: Option<i64>,
6310
6311    /// CPUs in which to allow execution (e.g., `0-3`, `0,1`). 
6312    #[serde(rename = "CpusetCpus")]
6313    #[serde(skip_serializing_if="Option::is_none")]
6314    pub cpuset_cpus: Option<String>,
6315
6316    /// Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. 
6317    #[serde(rename = "CpusetMems")]
6318    #[serde(skip_serializing_if="Option::is_none")]
6319    pub cpuset_mems: Option<String>,
6320
6321    /// A list of devices to add to the container.
6322    #[serde(rename = "Devices")]
6323    #[serde(skip_serializing_if="Option::is_none")]
6324    pub devices: Option<Vec<DeviceMapping>>,
6325
6326    /// a list of cgroup rules to apply to the container
6327    #[serde(rename = "DeviceCgroupRules")]
6328    #[serde(skip_serializing_if="Option::is_none")]
6329    pub device_cgroup_rules: Option<Vec<String>>,
6330
6331    /// A list of requests for devices to be sent to device drivers. 
6332    #[serde(rename = "DeviceRequests")]
6333    #[serde(skip_serializing_if="Option::is_none")]
6334    pub device_requests: Option<Vec<DeviceRequest>>,
6335
6336    /// Kernel memory limit in bytes.  <p><br /></p>  > **Deprecated**: This field is deprecated as the kernel 5.4 deprecated > `kmem.limit_in_bytes`. 
6337    #[serde(rename = "KernelMemory")]
6338    #[serde(skip_serializing_if="Option::is_none")]
6339    pub kernel_memory: Option<i64>,
6340
6341    /// Hard limit for kernel TCP buffer memory (in bytes).
6342    #[serde(rename = "KernelMemoryTCP")]
6343    #[serde(skip_serializing_if="Option::is_none")]
6344    pub kernel_memory_tcp: Option<i64>,
6345
6346    /// Memory soft limit in bytes.
6347    #[serde(rename = "MemoryReservation")]
6348    #[serde(skip_serializing_if="Option::is_none")]
6349    pub memory_reservation: Option<i64>,
6350
6351    /// Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. 
6352    #[serde(rename = "MemorySwap")]
6353    #[serde(skip_serializing_if="Option::is_none")]
6354    pub memory_swap: Option<i64>,
6355
6356    /// Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. 
6357    #[serde(rename = "MemorySwappiness")]
6358    #[serde(skip_serializing_if="Option::is_none")]
6359    pub memory_swappiness: Option<i64>,
6360
6361    /// CPU quota in units of 10<sup>-9</sup> CPUs.
6362    #[serde(rename = "NanoCpus")]
6363    #[serde(skip_serializing_if="Option::is_none")]
6364    pub nano_cpus: Option<i64>,
6365
6366    /// Disable OOM Killer for the container.
6367    #[serde(rename = "OomKillDisable")]
6368    #[serde(skip_serializing_if="Option::is_none")]
6369    pub oom_kill_disable: Option<bool>,
6370
6371    /// Run an init inside the container that forwards signals and reaps processes. This field is omitted if empty, and the default (as configured on the daemon) is used. 
6372    #[serde(rename = "Init")]
6373    #[serde(skip_serializing_if="Option::is_none")]
6374    pub init: Option<bool>,
6375
6376    /// Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` to not change. 
6377    #[serde(rename = "PidsLimit")]
6378    #[serde(skip_serializing_if="Option::is_none")]
6379    pub pids_limit: Option<i64>,
6380
6381    /// A list of resource limits to set in the container. For example:  ``` {\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048} ``` 
6382    #[serde(rename = "Ulimits")]
6383    #[serde(skip_serializing_if="Option::is_none")]
6384    pub ulimits: Option<Vec<ResourcesUlimits>>,
6385
6386    /// The number of usable CPUs (Windows only).  On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. 
6387    #[serde(rename = "CpuCount")]
6388    #[serde(skip_serializing_if="Option::is_none")]
6389    pub cpu_count: Option<i64>,
6390
6391    /// The usable percentage of the available CPUs (Windows only).  On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. 
6392    #[serde(rename = "CpuPercent")]
6393    #[serde(skip_serializing_if="Option::is_none")]
6394    pub cpu_percent: Option<i64>,
6395
6396    /// Maximum IOps for the container system drive (Windows only)
6397    #[serde(rename = "IOMaximumIOps")]
6398    #[serde(skip_serializing_if="Option::is_none")]
6399    pub io_maximum_iops: Option<i64>,
6400
6401    /// Maximum IO in bytes per second for the container system drive (Windows only). 
6402    #[serde(rename = "IOMaximumBandwidth")]
6403    #[serde(skip_serializing_if="Option::is_none")]
6404    pub io_maximum_bandwidth: Option<i64>,
6405
6406    /// A list of volume bindings for this container. Each volume binding is a string in one of these forms:  - `host-src:container-dest[:options]` to bind-mount a host path   into the container. Both `host-src`, and `container-dest` must   be an _absolute_ path. - `volume-name:container-dest[:options]` to bind-mount a volume   managed by a volume driver into the container. `container-dest`   must be an _absolute_ path.  `options` is an optional, comma-delimited list of:  - `nocopy` disables automatic copying of data from the container   path to the volume. The `nocopy` flag only applies to named volumes. - `[ro|rw]` mounts a volume read-only or read-write, respectively.   If omitted or set to `rw`, volumes are mounted read-write. - `[z|Z]` applies SELinux labels to allow or deny multiple containers   to read and write to the same volume.     - `z`: a _shared_ content label is applied to the content. This       label indicates that multiple containers can share the volume       content, for both reading and writing.     - `Z`: a _private unshared_ label is applied to the content.       This label indicates that only the current container can use       a private volume. Labeling systems such as SELinux require       proper labels to be placed on volume content that is mounted       into a container. Without a label, the security system can       prevent a container's processes from using the content. By       default, the labels set by the host operating system are not       modified. - `[[r]shared|[r]slave|[r]private]` specifies mount   [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt).   This only applies to bind-mounted volumes, not internal volumes   or named volumes. Mount propagation requires the source mount   point (the location where the source directory is mounted in the   host operating system) to have the correct propagation properties.   For shared volumes, the source mount point must be set to `shared`.   For slave volumes, the mount must be set to either `shared` or   `slave`. 
6407    #[serde(rename = "Binds")]
6408    #[serde(skip_serializing_if="Option::is_none")]
6409    pub binds: Option<Vec<String>>,
6410
6411    /// Path to a file where the container ID is written
6412    #[serde(rename = "ContainerIDFile")]
6413    #[serde(skip_serializing_if="Option::is_none")]
6414    pub container_id_file: Option<String>,
6415
6416    #[serde(rename = "LogConfig")]
6417    #[serde(skip_serializing_if="Option::is_none")]
6418    pub log_config: Option<HostConfigLogConfig>,
6419
6420    /// Network mode to use for this container. Supported standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. Any other value is taken as a custom network's name to which this container should connect to. 
6421    #[serde(rename = "NetworkMode")]
6422    #[serde(skip_serializing_if="Option::is_none")]
6423    pub network_mode: Option<String>,
6424
6425    #[serde(rename = "PortBindings")]
6426    #[serde(skip_serializing_if="Option::is_none")]
6427    pub port_bindings: Option<PortMap>,
6428
6429    #[serde(rename = "RestartPolicy")]
6430    #[serde(skip_serializing_if="Option::is_none")]
6431    pub restart_policy: Option<RestartPolicy>,
6432
6433    /// Automatically remove the container when the container's process exits. This has no effect if `RestartPolicy` is set. 
6434    #[serde(rename = "AutoRemove")]
6435    #[serde(skip_serializing_if="Option::is_none")]
6436    pub auto_remove: Option<bool>,
6437
6438    /// Driver that this container uses to mount volumes.
6439    #[serde(rename = "VolumeDriver")]
6440    #[serde(skip_serializing_if="Option::is_none")]
6441    pub volume_driver: Option<String>,
6442
6443    /// A list of volumes to inherit from another container, specified in the form `<container name>[:<ro|rw>]`. 
6444    #[serde(rename = "VolumesFrom")]
6445    #[serde(skip_serializing_if="Option::is_none")]
6446    pub volumes_from: Option<Vec<String>>,
6447
6448    /// Specification for mounts to be added to the container. 
6449    #[serde(rename = "Mounts")]
6450    #[serde(skip_serializing_if="Option::is_none")]
6451    pub mounts: Option<Vec<Mount>>,
6452
6453    /// A list of kernel capabilities to add to the container. Conflicts with option 'Capabilities'. 
6454    #[serde(rename = "CapAdd")]
6455    #[serde(skip_serializing_if="Option::is_none")]
6456    pub cap_add: Option<Vec<String>>,
6457
6458    /// A list of kernel capabilities to drop from the container. Conflicts with option 'Capabilities'. 
6459    #[serde(rename = "CapDrop")]
6460    #[serde(skip_serializing_if="Option::is_none")]
6461    pub cap_drop: Option<Vec<String>>,
6462
6463    /// cgroup namespace mode for the container. Possible values are:  - `\"private\"`: the container runs in its own private cgroup namespace - `\"host\"`: use the host system's cgroup namespace  If not specified, the daemon default is used, which can either be `\"private\"` or `\"host\"`, depending on daemon version, kernel support and configuration. 
6464    #[serde(rename = "CgroupnsMode")]
6465    #[serde(skip_serializing_if="Option::is_none")]
6466    pub cgroupns_mode: Option<HostConfigCgroupnsModeEnum>,
6467
6468    /// A list of DNS servers for the container to use.
6469    #[serde(rename = "Dns")]
6470    #[serde(skip_serializing_if="Option::is_none")]
6471    pub dns: Option<Vec<String>>,
6472
6473    /// A list of DNS options.
6474    #[serde(rename = "DnsOptions")]
6475    #[serde(skip_serializing_if="Option::is_none")]
6476    pub dns_options: Option<Vec<String>>,
6477
6478    /// A list of DNS search domains.
6479    #[serde(rename = "DnsSearch")]
6480    #[serde(skip_serializing_if="Option::is_none")]
6481    pub dns_search: Option<Vec<String>>,
6482
6483    /// A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `[\"hostname:IP\"]`. 
6484    #[serde(rename = "ExtraHosts")]
6485    #[serde(skip_serializing_if="Option::is_none")]
6486    pub extra_hosts: Option<Vec<String>>,
6487
6488    /// A list of additional groups that the container process will run as. 
6489    #[serde(rename = "GroupAdd")]
6490    #[serde(skip_serializing_if="Option::is_none")]
6491    pub group_add: Option<Vec<String>>,
6492
6493    /// IPC sharing mode for the container. Possible values are:  - `\"none\"`: own private IPC namespace, with /dev/shm not mounted - `\"private\"`: own private IPC namespace - `\"shareable\"`: own private IPC namespace, with a possibility to share it with other containers - `\"container:<name|id>\"`: join another (shareable) container's IPC namespace - `\"host\"`: use the host system's IPC namespace  If not specified, daemon default is used, which can either be `\"private\"` or `\"shareable\"`, depending on daemon version and configuration. 
6494    #[serde(rename = "IpcMode")]
6495    #[serde(skip_serializing_if="Option::is_none")]
6496    pub ipc_mode: Option<String>,
6497
6498    /// Cgroup to use for the container.
6499    #[serde(rename = "Cgroup")]
6500    #[serde(skip_serializing_if="Option::is_none")]
6501    pub cgroup: Option<String>,
6502
6503    /// A list of links for the container in the form `container_name:alias`. 
6504    #[serde(rename = "Links")]
6505    #[serde(skip_serializing_if="Option::is_none")]
6506    pub links: Option<Vec<String>>,
6507
6508    /// An integer value containing the score given to the container in order to tune OOM killer preferences. 
6509    #[serde(rename = "OomScoreAdj")]
6510    #[serde(skip_serializing_if="Option::is_none")]
6511    pub oom_score_adj: Option<i64>,
6512
6513    /// Set the PID (Process) Namespace mode for the container. It can be either:  - `\"container:<name|id>\"`: joins another container's PID namespace - `\"host\"`: use the host's PID namespace inside the container 
6514    #[serde(rename = "PidMode")]
6515    #[serde(skip_serializing_if="Option::is_none")]
6516    pub pid_mode: Option<String>,
6517
6518    /// Gives the container full access to the host.
6519    #[serde(rename = "Privileged")]
6520    #[serde(skip_serializing_if="Option::is_none")]
6521    pub privileged: Option<bool>,
6522
6523    /// Allocates an ephemeral host port for all of a container's exposed ports.  Ports are de-allocated when the container stops and allocated when the container starts. The allocated port might be changed when restarting the container.  The port is selected from the ephemeral port range that depends on the kernel. For example, on Linux the range is defined by `/proc/sys/net/ipv4/ip_local_port_range`. 
6524    #[serde(rename = "PublishAllPorts")]
6525    #[serde(skip_serializing_if="Option::is_none")]
6526    pub publish_all_ports: Option<bool>,
6527
6528    /// Mount the container's root filesystem as read only.
6529    #[serde(rename = "ReadonlyRootfs")]
6530    #[serde(skip_serializing_if="Option::is_none")]
6531    pub readonly_rootfs: Option<bool>,
6532
6533    /// A list of string values to customize labels for MLS systems, such as SELinux.
6534    #[serde(rename = "SecurityOpt")]
6535    #[serde(skip_serializing_if="Option::is_none")]
6536    pub security_opt: Option<Vec<String>>,
6537
6538    /// Storage driver options for this container, in the form `{\"size\": \"120G\"}`. 
6539    #[serde(rename = "StorageOpt")]
6540    #[serde(skip_serializing_if="Option::is_none")]
6541    pub storage_opt: Option<HashMap<String, String>>,
6542
6543    /// A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options. For example:  ``` { \"/run\": \"rw,noexec,nosuid,size=65536k\" } ``` 
6544    #[serde(rename = "Tmpfs")]
6545    #[serde(skip_serializing_if="Option::is_none")]
6546    pub tmpfs: Option<HashMap<String, String>>,
6547
6548    /// UTS namespace to use for the container.
6549    #[serde(rename = "UTSMode")]
6550    #[serde(skip_serializing_if="Option::is_none")]
6551    pub uts_mode: Option<String>,
6552
6553    /// Sets the usernamespace mode for the container when usernamespace remapping option is enabled. 
6554    #[serde(rename = "UsernsMode")]
6555    #[serde(skip_serializing_if="Option::is_none")]
6556    pub userns_mode: Option<String>,
6557
6558    /// Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. 
6559    #[serde(rename = "ShmSize")]
6560    #[serde(skip_serializing_if="Option::is_none")]
6561    pub shm_size: Option<usize>,
6562
6563    /// A list of kernel parameters (sysctls) to set in the container. For example:  ``` {\"net.ipv4.ip_forward\": \"1\"} ``` 
6564    #[serde(rename = "Sysctls")]
6565    #[serde(skip_serializing_if="Option::is_none")]
6566    pub sysctls: Option<HashMap<String, String>>,
6567
6568    /// Runtime to use with this container.
6569    #[serde(rename = "Runtime")]
6570    #[serde(skip_serializing_if="Option::is_none")]
6571    pub runtime: Option<String>,
6572
6573    /// Initial console size, as an `[height, width]` array. (Windows only) 
6574    #[serde(rename = "ConsoleSize")]
6575    #[serde(skip_serializing_if="Option::is_none")]
6576    pub console_size: Option<Vec<i32>>,
6577
6578    /// Isolation technology of the container. (Windows only) 
6579    #[serde(rename = "Isolation")]
6580    #[serde(skip_serializing_if="Option::is_none")]
6581    pub isolation: Option<HostConfigIsolationEnum>,
6582
6583    /// The list of paths to be masked inside the container (this overrides the default set of paths). 
6584    #[serde(rename = "MaskedPaths")]
6585    #[serde(skip_serializing_if="Option::is_none")]
6586    pub masked_paths: Option<Vec<String>>,
6587
6588    /// The list of paths to be set as read-only inside the container (this overrides the default set of paths). 
6589    #[serde(rename = "ReadonlyPaths")]
6590    #[serde(skip_serializing_if="Option::is_none")]
6591    pub readonly_paths: Option<Vec<String>>,
6592
6593}
6594
6595#[allow(non_camel_case_types)]
6596#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
6597pub enum HostConfigCgroupnsModeEnum { 
6598    #[serde(rename = "")]
6599    EMPTY,
6600    #[serde(rename = "private")]
6601    PRIVATE,
6602    #[serde(rename = "host")]
6603    HOST,
6604}
6605
6606impl ::std::fmt::Display for HostConfigCgroupnsModeEnum {
6607    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
6608        match *self { 
6609            HostConfigCgroupnsModeEnum::EMPTY => write!(f, ""),
6610            HostConfigCgroupnsModeEnum::PRIVATE => write!(f, "{}", "private"),
6611            HostConfigCgroupnsModeEnum::HOST => write!(f, "{}", "host"),
6612
6613        }
6614    }
6615}
6616
6617impl ::std::str::FromStr for HostConfigCgroupnsModeEnum {
6618    type Err = String;
6619    fn from_str(s: &str) -> Result<Self, Self::Err> {
6620        match s { 
6621            "" => Ok(HostConfigCgroupnsModeEnum::EMPTY),
6622            "private" => Ok(HostConfigCgroupnsModeEnum::PRIVATE),
6623            "host" => Ok(HostConfigCgroupnsModeEnum::HOST),
6624            x => Err(format!("Invalid enum type: {}", x)),
6625        }
6626    }
6627}
6628
6629impl ::std::convert::AsRef<str> for HostConfigCgroupnsModeEnum {
6630    fn as_ref(&self) -> &str {
6631        match self { 
6632            HostConfigCgroupnsModeEnum::EMPTY => "",
6633            HostConfigCgroupnsModeEnum::PRIVATE => "private",
6634            HostConfigCgroupnsModeEnum::HOST => "host",
6635        }
6636    }
6637}
6638
6639#[allow(non_camel_case_types)]
6640#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
6641pub enum HostConfigIsolationEnum { 
6642    #[serde(rename = "")]
6643    EMPTY,
6644    #[serde(rename = "default")]
6645    DEFAULT,
6646    #[serde(rename = "process")]
6647    PROCESS,
6648    #[serde(rename = "hyperv")]
6649    HYPERV,
6650}
6651
6652impl ::std::fmt::Display for HostConfigIsolationEnum {
6653    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
6654        match *self { 
6655            HostConfigIsolationEnum::EMPTY => write!(f, ""),
6656            HostConfigIsolationEnum::DEFAULT => write!(f, "{}", "default"),
6657            HostConfigIsolationEnum::PROCESS => write!(f, "{}", "process"),
6658            HostConfigIsolationEnum::HYPERV => write!(f, "{}", "hyperv"),
6659
6660        }
6661    }
6662}
6663
6664impl ::std::str::FromStr for HostConfigIsolationEnum {
6665    type Err = String;
6666    fn from_str(s: &str) -> Result<Self, Self::Err> {
6667        match s { 
6668            "" => Ok(HostConfigIsolationEnum::EMPTY),
6669            "default" => Ok(HostConfigIsolationEnum::DEFAULT),
6670            "process" => Ok(HostConfigIsolationEnum::PROCESS),
6671            "hyperv" => Ok(HostConfigIsolationEnum::HYPERV),
6672            x => Err(format!("Invalid enum type: {}", x)),
6673        }
6674    }
6675}
6676
6677impl ::std::convert::AsRef<str> for HostConfigIsolationEnum {
6678    fn as_ref(&self) -> &str {
6679        match self { 
6680            HostConfigIsolationEnum::EMPTY => "",
6681            HostConfigIsolationEnum::DEFAULT => "default",
6682            HostConfigIsolationEnum::PROCESS => "process",
6683            HostConfigIsolationEnum::HYPERV => "hyperv",
6684        }
6685    }
6686}
6687
6688#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6689pub struct Swarm {
6690    /// The ID of the swarm.
6691    #[serde(rename = "ID")]
6692    #[serde(skip_serializing_if="Option::is_none")]
6693    pub id: Option<String>,
6694
6695    #[serde(rename = "Version")]
6696    #[serde(skip_serializing_if="Option::is_none")]
6697    pub version: Option<ObjectVersion>,
6698
6699    /// Date and time at which the swarm was initialised in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
6700    #[serde(rename = "CreatedAt")]
6701    #[serde(skip_serializing_if="Option::is_none")]
6702    pub created_at: Option<DateTime<Utc>>,
6703
6704    /// Date and time at which the swarm was last updated in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
6705    #[serde(rename = "UpdatedAt")]
6706    #[serde(skip_serializing_if="Option::is_none")]
6707    pub updated_at: Option<DateTime<Utc>>,
6708
6709    #[serde(rename = "Spec")]
6710    #[serde(skip_serializing_if="Option::is_none")]
6711    pub spec: Option<SwarmSpec>,
6712
6713    #[serde(rename = "TLSInfo")]
6714    #[serde(skip_serializing_if="Option::is_none")]
6715    pub tls_info: Option<TlsInfo>,
6716
6717    /// Whether there is currently a root CA rotation in progress for the swarm 
6718    #[serde(rename = "RootRotationInProgress")]
6719    #[serde(skip_serializing_if="Option::is_none")]
6720    pub root_rotation_in_progress: Option<bool>,
6721
6722    /// DataPathPort specifies the data path port number for data traffic. Acceptable port range is 1024 to 49151. If no port is set or is set to 0, the default port (4789) is used. 
6723    #[serde(rename = "DataPathPort")]
6724    #[serde(skip_serializing_if="Option::is_none")]
6725    pub data_path_port: Option<u32>,
6726
6727    /// Default Address Pool specifies default subnet pools for global scope networks. 
6728    #[serde(rename = "DefaultAddrPool")]
6729    #[serde(skip_serializing_if="Option::is_none")]
6730    pub default_addr_pool: Option<Vec<String>>,
6731
6732    /// SubnetSize specifies the subnet size of the networks created from the default subnet pool. 
6733    #[serde(rename = "SubnetSize")]
6734    #[serde(skip_serializing_if="Option::is_none")]
6735    pub subnet_size: Option<u32>,
6736
6737    #[serde(rename = "JoinTokens")]
6738    #[serde(skip_serializing_if="Option::is_none")]
6739    pub join_tokens: Option<JoinTokens>,
6740
6741}