bollard_stubs/
models.rs

1#![allow(
2    unused_imports,
3    unused_qualifications,
4    unused_extern_crates,
5    clippy::all
6)]
7
8#[cfg(feature = "buildkit")]
9use prost::Message;
10use serde::de::{DeserializeOwned, Deserializer};
11use serde::ser::Serializer;
12use serde::{Deserialize, Serialize};
13use serde_repr::{Serialize_repr, Deserialize_repr};
14
15use std::cmp::Eq;
16use std::collections::HashMap;
17use std::default::Default;
18use std::hash::Hash;
19
20fn deserialize_nonoptional_vec<'de, D: Deserializer<'de>, T: DeserializeOwned>(
21    d: D,
22) -> Result<Vec<T>, D::Error> {
23    serde::Deserialize::deserialize(d).map(|x: Option<_>| x.unwrap_or(Vec::new()))
24}
25
26fn deserialize_nonoptional_map<'de, D: Deserializer<'de>, T: DeserializeOwned>(
27    d: D,
28) -> Result<HashMap<String, T>, D::Error> {
29    serde::Deserialize::deserialize(d).map(|x: Option<_>| x.unwrap_or(HashMap::new()))
30}
31
32#[cfg(feature = "time")]
33pub type BollardDate = time::OffsetDateTime;
34#[cfg(all(feature = "chrono", not(feature = "time")))]
35pub type BollardDate = chrono::DateTime<chrono::Utc>;
36#[cfg(not(any(feature = "chrono", feature = "time")))]
37pub type BollardDate = String;
38
39#[cfg(feature = "time")]
40fn deserialize_timestamp<'de, D: Deserializer<'de>>(
41    d: D
42) -> Result<Option<BollardDate>, D::Error> {
43    let opt: Option<String> = serde::Deserialize::deserialize(d)?;
44    if let Some(s) = opt {
45        Ok(Some(
46            time::OffsetDateTime::parse(&s, &time::format_description::well_known::Rfc3339)
47                .map_err(|e| serde::de::Error::custom(format!("{:?}", e)))?,
48        ))
49    } else {
50        Ok(None)
51    }
52}
53
54#[cfg(not(feature = "time"))]
55fn deserialize_timestamp<'de, D: Deserializer<'de>>(
56    d: D
57) -> Result<Option<BollardDate>, D::Error> {
58    serde::Deserialize::deserialize(d)
59}
60
61#[cfg(feature = "time")]
62fn serialize_timestamp<S: Serializer>(date: &Option<BollardDate>, s: S) -> Result<S::Ok, S::Error> {
63    match date {
64        Some(inner) => Ok(s.serialize_str(&inner.format(&time::format_description::well_known::Rfc3339)
65                                          .map_err(|e| serde::ser::Error::custom(format!("{:?}", e)))?)?),
66        None => Ok(s.serialize_str("")?)
67    }
68}
69
70#[cfg(not(feature = "time"))]
71fn serialize_timestamp<S: Serializer>(date: &Option<BollardDate>, s: S) -> Result<S::Ok, S::Error> {
72    match date {
73        Some(inner) => s.serialize_some(inner),
74        None => s.serialize_none()
75    }
76}
77
78#[cfg(feature = "buildkit")]
79fn deserialize_buildinfo_aux<'de, D: Deserializer<'de>>(
80    d: D,
81) -> Result<crate::moby::buildkit::v1::StatusResponse, D::Error> {
82    let aux: String = serde::Deserialize::deserialize(d)?;
83    let raw = base64::Engine::decode(&base64::engine::general_purpose::STANDARD, &aux)
84        .map_err(|e| serde::de::Error::custom(format!("{:?}", e)))?;
85    let buf = bytes::BytesMut::from(&raw[..]);
86
87    let res = crate::moby::buildkit::v1::StatusResponse::decode(buf)
88        .map_err(|e| serde::de::Error::custom(format!("{:?}", e)))?;
89    Ok(res)
90}
91
92#[cfg(feature = "buildkit")]
93#[derive(Debug, Clone, PartialEq, Deserialize)]
94#[serde(untagged)]
95pub enum BuildInfoAux {
96    #[serde(deserialize_with = "deserialize_buildinfo_aux")]
97    BuildKit(crate::moby::buildkit::v1::StatusResponse),
98    Default(ImageId)
99}
100
101
102/// Address represents an IPv4 or IPv6 IP address.
103#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
104pub struct Address {
105    /// IP address.
106    #[serde(rename = "Addr")]
107    #[serde(skip_serializing_if = "Option::is_none")]
108    pub addr: Option<String>,
109
110    /// Mask length of the IP address.
111    #[serde(rename = "PrefixLen")]
112    #[serde(skip_serializing_if = "Option::is_none")]
113    pub prefix_len: Option<i64>,
114
115}
116
117#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
118pub struct AuthConfig {
119    #[serde(rename = "username")]
120    #[serde(skip_serializing_if = "Option::is_none")]
121    pub username: Option<String>,
122
123    #[serde(rename = "password")]
124    #[serde(skip_serializing_if = "Option::is_none")]
125    pub password: Option<String>,
126
127    #[serde(rename = "email")]
128    #[serde(skip_serializing_if = "Option::is_none")]
129    pub email: Option<String>,
130
131    #[serde(rename = "serveraddress")]
132    #[serde(skip_serializing_if = "Option::is_none")]
133    pub serveraddress: Option<String>,
134
135}
136
137/// Volume configuration
138#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
139pub struct Body {
140    #[serde(rename = "Spec")]
141    #[serde(skip_serializing_if = "Option::is_none")]
142    pub spec: Option<ClusterVolumeSpec>,
143
144}
145
146/// BuildCache contains information about a build cache record. 
147#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
148pub struct BuildCache {
149    /// Unique ID of the build cache record. 
150    #[serde(rename = "ID")]
151    #[serde(skip_serializing_if = "Option::is_none")]
152    pub id: Option<String>,
153
154    /// ID of the parent build cache record.  > **Deprecated**: This field is deprecated, and omitted if empty. 
155    #[serde(rename = "Parent")]
156    #[serde(skip_serializing_if = "Option::is_none")]
157    pub parent: Option<String>,
158
159    /// List of parent build cache record IDs. 
160    #[serde(rename = "Parents")]
161    #[serde(skip_serializing_if = "Option::is_none")]
162    pub parents: Option<Vec<String>>,
163
164    /// Cache record type. 
165    #[serde(rename = "Type")]
166    #[serde(skip_serializing_if = "Option::is_none")]
167    pub typ: Option<BuildCacheTypeEnum>,
168
169    /// Description of the build-step that produced the build cache. 
170    #[serde(rename = "Description")]
171    #[serde(skip_serializing_if = "Option::is_none")]
172    pub description: Option<String>,
173
174    /// Indicates if the build cache is in use. 
175    #[serde(rename = "InUse")]
176    #[serde(skip_serializing_if = "Option::is_none")]
177    pub in_use: Option<bool>,
178
179    /// Indicates if the build cache is shared. 
180    #[serde(rename = "Shared")]
181    #[serde(skip_serializing_if = "Option::is_none")]
182    pub shared: Option<bool>,
183
184    /// Amount of disk space used by the build cache (in bytes). 
185    #[serde(rename = "Size")]
186    #[serde(skip_serializing_if = "Option::is_none")]
187    pub size: Option<i64>,
188
189    /// Date and time at which the build cache was created in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
190    #[serde(rename = "CreatedAt")]
191    #[serde(skip_serializing_if = "Option::is_none")]
192    #[serde(
193        default,
194        deserialize_with = "deserialize_timestamp",
195        serialize_with = "serialize_timestamp"
196    )]
197    pub created_at: Option<BollardDate>,
198
199    /// 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. 
200    #[serde(rename = "LastUsedAt")]
201    #[serde(skip_serializing_if = "Option::is_none")]
202    #[serde(
203        default,
204        deserialize_with = "deserialize_timestamp",
205        serialize_with = "serialize_timestamp"
206    )]
207    pub last_used_at: Option<BollardDate>,
208
209    #[serde(rename = "UsageCount")]
210    #[serde(skip_serializing_if = "Option::is_none")]
211    pub usage_count: Option<i64>,
212
213}
214
215#[allow(non_camel_case_types)]
216#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
217pub enum BuildCacheTypeEnum { 
218    #[serde(rename = "")]
219    EMPTY,
220    #[serde(rename = "internal")]
221    INTERNAL,
222    #[serde(rename = "frontend")]
223    FRONTEND,
224    #[serde(rename = "source.local")]
225    SOURCE_LOCAL,
226    #[serde(rename = "source.git.checkout")]
227    SOURCE_GIT_CHECKOUT,
228    #[serde(rename = "exec.cachemount")]
229    EXEC_CACHEMOUNT,
230    #[serde(rename = "regular")]
231    REGULAR,
232}
233
234impl ::std::fmt::Display for BuildCacheTypeEnum {
235    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
236        match *self { 
237            BuildCacheTypeEnum::EMPTY => write!(f, ""),
238            BuildCacheTypeEnum::INTERNAL => write!(f, "{}", "internal"),
239            BuildCacheTypeEnum::FRONTEND => write!(f, "{}", "frontend"),
240            BuildCacheTypeEnum::SOURCE_LOCAL => write!(f, "{}", "source.local"),
241            BuildCacheTypeEnum::SOURCE_GIT_CHECKOUT => write!(f, "{}", "source.git.checkout"),
242            BuildCacheTypeEnum::EXEC_CACHEMOUNT => write!(f, "{}", "exec.cachemount"),
243            BuildCacheTypeEnum::REGULAR => write!(f, "{}", "regular"),
244
245        }
246    }
247}
248
249impl ::std::str::FromStr for BuildCacheTypeEnum {
250    type Err = String;
251    fn from_str(s: &str) -> Result<Self, Self::Err> {
252        match s { 
253            "" => Ok(BuildCacheTypeEnum::EMPTY),
254            "internal" => Ok(BuildCacheTypeEnum::INTERNAL),
255            "frontend" => Ok(BuildCacheTypeEnum::FRONTEND),
256            "source.local" => Ok(BuildCacheTypeEnum::SOURCE_LOCAL),
257            "source.git.checkout" => Ok(BuildCacheTypeEnum::SOURCE_GIT_CHECKOUT),
258            "exec.cachemount" => Ok(BuildCacheTypeEnum::EXEC_CACHEMOUNT),
259            "regular" => Ok(BuildCacheTypeEnum::REGULAR),
260            x => Err(format!("Invalid enum type: {}", x)),
261        }
262    }
263}
264
265impl ::std::convert::AsRef<str> for BuildCacheTypeEnum {
266    fn as_ref(&self) -> &str {
267        match self { 
268            BuildCacheTypeEnum::EMPTY => "",
269            BuildCacheTypeEnum::INTERNAL => "internal",
270            BuildCacheTypeEnum::FRONTEND => "frontend",
271            BuildCacheTypeEnum::SOURCE_LOCAL => "source.local",
272            BuildCacheTypeEnum::SOURCE_GIT_CHECKOUT => "source.git.checkout",
273            BuildCacheTypeEnum::EXEC_CACHEMOUNT => "exec.cachemount",
274            BuildCacheTypeEnum::REGULAR => "regular",
275        }
276    }
277}
278
279#[derive(Debug, Clone, Default, PartialEq, Deserialize)]
280pub struct BuildInfo {
281    #[serde(rename = "id")]
282    #[serde(skip_serializing_if = "Option::is_none")]
283    pub id: Option<String>,
284
285    #[serde(rename = "stream")]
286    #[serde(skip_serializing_if = "Option::is_none")]
287    pub stream: Option<String>,
288
289    /// errors encountered during the operation.   > **Deprecated**: This field is deprecated since API v1.4, and will be omitted in a future API version. Use the information in errorDetail instead.
290    #[serde(rename = "error")]
291    #[serde(skip_serializing_if = "Option::is_none")]
292    pub error: Option<String>,
293
294    #[serde(rename = "errorDetail")]
295    #[serde(skip_serializing_if = "Option::is_none")]
296    pub error_detail: Option<ErrorDetail>,
297
298    #[serde(rename = "status")]
299    #[serde(skip_serializing_if = "Option::is_none")]
300    pub status: Option<String>,
301
302    /// Progress is a pre-formatted presentation of progressDetail.   > **Deprecated**: This field is deprecated since API v1.8, and will be omitted in a future API version. Use the information in progressDetail instead.
303    #[serde(rename = "progress")]
304    #[serde(skip_serializing_if = "Option::is_none")]
305    pub progress: Option<String>,
306
307    #[serde(rename = "progressDetail")]
308    #[serde(skip_serializing_if = "Option::is_none")]
309    pub progress_detail: Option<ProgressDetail>,
310
311    #[serde(rename = "aux")]
312    #[serde(skip_serializing_if = "Option::is_none")]
313    #[cfg(feature = "buildkit")]
314    pub aux: Option<BuildInfoAux>,
315
316    #[serde(rename = "aux")]
317    #[serde(skip_serializing_if = "Option::is_none")]
318    #[cfg(not(feature = "buildkit"))]
319    pub aux: Option<ImageId>,
320    
321}
322
323#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
324pub struct BuildPruneResponse {
325    #[serde(rename = "CachesDeleted")]
326    #[serde(skip_serializing_if = "Option::is_none")]
327    pub caches_deleted: Option<Vec<String>>,
328
329    /// Disk space reclaimed in bytes
330    #[serde(rename = "SpaceReclaimed")]
331    #[serde(skip_serializing_if = "Option::is_none")]
332    pub space_reclaimed: Option<i64>,
333
334}
335
336/// Kind of change  Can be one of:  - `0`: Modified (\"C\") - `1`: Added (\"A\") - `2`: Deleted (\"D\") 
337/// Enumeration of values.
338/// Since this enum's variants do not hold data, we can easily define them them as `#[repr(C)]`
339/// which helps with FFI.
340#[allow(non_camel_case_types)]
341#[repr(i32)]
342#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize_repr, Deserialize_repr, Eq, Ord)]
343pub enum ChangeType { 
344    _0 = 0,
345    _1 = 1,
346    _2 = 2,
347}
348
349impl ::std::fmt::Display for ChangeType {
350    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
351        match *self { 
352            ChangeType::_0 => write!(f, "{}", 0),
353            ChangeType::_1 => write!(f, "{}", 1),
354            ChangeType::_2 => write!(f, "{}", 2),
355        }
356    }
357}
358
359impl std::default::Default for ChangeType {
360    fn default() -> Self { 
361        ChangeType::_0
362    }
363}
364
365/// ClusterInfo represents information about the swarm as is returned by the \"/info\" endpoint. Join-tokens are not included. 
366#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
367pub struct ClusterInfo {
368    /// The ID of the swarm.
369    #[serde(rename = "ID")]
370    #[serde(skip_serializing_if = "Option::is_none")]
371    pub id: Option<String>,
372
373    #[serde(rename = "Version")]
374    #[serde(skip_serializing_if = "Option::is_none")]
375    pub version: Option<ObjectVersion>,
376
377    /// Date and time at which the swarm was initialised in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
378    #[serde(rename = "CreatedAt")]
379    #[serde(skip_serializing_if = "Option::is_none")]
380    #[serde(
381        default,
382        deserialize_with = "deserialize_timestamp",
383        serialize_with = "serialize_timestamp"
384    )]
385    pub created_at: Option<BollardDate>,
386
387    /// Date and time at which the swarm was last updated in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
388    #[serde(rename = "UpdatedAt")]
389    #[serde(skip_serializing_if = "Option::is_none")]
390    #[serde(
391        default,
392        deserialize_with = "deserialize_timestamp",
393        serialize_with = "serialize_timestamp"
394    )]
395    pub updated_at: Option<BollardDate>,
396
397    #[serde(rename = "Spec")]
398    #[serde(skip_serializing_if = "Option::is_none")]
399    pub spec: Option<SwarmSpec>,
400
401    #[serde(rename = "TLSInfo")]
402    #[serde(skip_serializing_if = "Option::is_none")]
403    pub tls_info: Option<TlsInfo>,
404
405    /// Whether there is currently a root CA rotation in progress for the swarm 
406    #[serde(rename = "RootRotationInProgress")]
407    #[serde(skip_serializing_if = "Option::is_none")]
408    pub root_rotation_in_progress: Option<bool>,
409
410    /// 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. 
411    #[serde(rename = "DataPathPort")]
412    #[serde(skip_serializing_if = "Option::is_none")]
413    pub data_path_port: Option<u32>,
414
415    /// Default Address Pool specifies default subnet pools for global scope networks. 
416    #[serde(rename = "DefaultAddrPool")]
417    #[serde(skip_serializing_if = "Option::is_none")]
418    pub default_addr_pool: Option<Vec<String>>,
419
420    /// SubnetSize specifies the subnet size of the networks created from the default subnet pool. 
421    #[serde(rename = "SubnetSize")]
422    #[serde(skip_serializing_if = "Option::is_none")]
423    pub subnet_size: Option<u32>,
424
425}
426
427/// Options and information specific to, and only present on, Swarm CSI cluster volumes. 
428#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
429pub struct ClusterVolume {
430    /// The Swarm ID of this volume. Because cluster volumes are Swarm objects, they have an ID, unlike non-cluster volumes. This ID can be used to refer to the Volume instead of the name. 
431    #[serde(rename = "ID")]
432    #[serde(skip_serializing_if = "Option::is_none")]
433    pub id: Option<String>,
434
435    #[serde(rename = "Version")]
436    #[serde(skip_serializing_if = "Option::is_none")]
437    pub version: Option<ObjectVersion>,
438
439    #[serde(rename = "CreatedAt")]
440    #[serde(skip_serializing_if = "Option::is_none")]
441    #[serde(
442        default,
443        deserialize_with = "deserialize_timestamp",
444        serialize_with = "serialize_timestamp"
445    )]
446    pub created_at: Option<BollardDate>,
447
448    #[serde(rename = "UpdatedAt")]
449    #[serde(skip_serializing_if = "Option::is_none")]
450    #[serde(
451        default,
452        deserialize_with = "deserialize_timestamp",
453        serialize_with = "serialize_timestamp"
454    )]
455    pub updated_at: Option<BollardDate>,
456
457    #[serde(rename = "Spec")]
458    #[serde(skip_serializing_if = "Option::is_none")]
459    pub spec: Option<ClusterVolumeSpec>,
460
461    #[serde(rename = "Info")]
462    #[serde(skip_serializing_if = "Option::is_none")]
463    pub info: Option<ClusterVolumeInfo>,
464
465    /// The status of the volume as it pertains to its publishing and use on specific nodes 
466    #[serde(rename = "PublishStatus")]
467    #[serde(skip_serializing_if = "Option::is_none")]
468    pub publish_status: Option<Vec<ClusterVolumePublishStatus>>,
469
470}
471
472/// Information about the global status of the volume. 
473#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
474pub struct ClusterVolumeInfo {
475    /// The capacity of the volume in bytes. A value of 0 indicates that the capacity is unknown. 
476    #[serde(rename = "CapacityBytes")]
477    #[serde(skip_serializing_if = "Option::is_none")]
478    pub capacity_bytes: Option<i64>,
479
480    /// A map of strings to strings returned from the storage plugin when the volume is created. 
481    #[serde(rename = "VolumeContext")]
482    #[serde(skip_serializing_if = "Option::is_none")]
483    pub volume_context: Option<HashMap<String, String>>,
484
485    /// The ID of the volume as returned by the CSI storage plugin. This is distinct from the volume's ID as provided by Docker. This ID is never used by the user when communicating with Docker to refer to this volume. If the ID is blank, then the Volume has not been successfully created in the plugin yet. 
486    #[serde(rename = "VolumeID")]
487    #[serde(skip_serializing_if = "Option::is_none")]
488    pub volume_id: Option<String>,
489
490    /// The topology this volume is actually accessible from. 
491    #[serde(rename = "AccessibleTopology")]
492    #[serde(skip_serializing_if = "Option::is_none")]
493    pub accessible_topology: Option<Vec<Topology>>,
494
495}
496
497#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
498pub struct ClusterVolumePublishStatus {
499    /// The ID of the Swarm node the volume is published on. 
500    #[serde(rename = "NodeID")]
501    #[serde(skip_serializing_if = "Option::is_none")]
502    pub node_id: Option<String>,
503
504    /// The published state of the volume. * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. * `published` The volume is published successfully to the node. * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. 
505    #[serde(rename = "State")]
506    #[serde(skip_serializing_if = "Option::is_none")]
507    pub state: Option<ClusterVolumePublishStatusStateEnum>,
508
509    /// A map of strings to strings returned by the CSI controller plugin when a volume is published. 
510    #[serde(rename = "PublishContext")]
511    #[serde(skip_serializing_if = "Option::is_none")]
512    pub publish_context: Option<HashMap<String, String>>,
513
514}
515
516#[allow(non_camel_case_types)]
517#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
518pub enum ClusterVolumePublishStatusStateEnum { 
519    #[serde(rename = "")]
520    EMPTY,
521    #[serde(rename = "pending-publish")]
522    PENDING_PUBLISH,
523    #[serde(rename = "published")]
524    PUBLISHED,
525    #[serde(rename = "pending-node-unpublish")]
526    PENDING_NODE_UNPUBLISH,
527    #[serde(rename = "pending-controller-unpublish")]
528    PENDING_CONTROLLER_UNPUBLISH,
529}
530
531impl ::std::fmt::Display for ClusterVolumePublishStatusStateEnum {
532    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
533        match *self { 
534            ClusterVolumePublishStatusStateEnum::EMPTY => write!(f, ""),
535            ClusterVolumePublishStatusStateEnum::PENDING_PUBLISH => write!(f, "{}", "pending-publish"),
536            ClusterVolumePublishStatusStateEnum::PUBLISHED => write!(f, "{}", "published"),
537            ClusterVolumePublishStatusStateEnum::PENDING_NODE_UNPUBLISH => write!(f, "{}", "pending-node-unpublish"),
538            ClusterVolumePublishStatusStateEnum::PENDING_CONTROLLER_UNPUBLISH => write!(f, "{}", "pending-controller-unpublish"),
539
540        }
541    }
542}
543
544impl ::std::str::FromStr for ClusterVolumePublishStatusStateEnum {
545    type Err = String;
546    fn from_str(s: &str) -> Result<Self, Self::Err> {
547        match s { 
548            "" => Ok(ClusterVolumePublishStatusStateEnum::EMPTY),
549            "pending-publish" => Ok(ClusterVolumePublishStatusStateEnum::PENDING_PUBLISH),
550            "published" => Ok(ClusterVolumePublishStatusStateEnum::PUBLISHED),
551            "pending-node-unpublish" => Ok(ClusterVolumePublishStatusStateEnum::PENDING_NODE_UNPUBLISH),
552            "pending-controller-unpublish" => Ok(ClusterVolumePublishStatusStateEnum::PENDING_CONTROLLER_UNPUBLISH),
553            x => Err(format!("Invalid enum type: {}", x)),
554        }
555    }
556}
557
558impl ::std::convert::AsRef<str> for ClusterVolumePublishStatusStateEnum {
559    fn as_ref(&self) -> &str {
560        match self { 
561            ClusterVolumePublishStatusStateEnum::EMPTY => "",
562            ClusterVolumePublishStatusStateEnum::PENDING_PUBLISH => "pending-publish",
563            ClusterVolumePublishStatusStateEnum::PUBLISHED => "published",
564            ClusterVolumePublishStatusStateEnum::PENDING_NODE_UNPUBLISH => "pending-node-unpublish",
565            ClusterVolumePublishStatusStateEnum::PENDING_CONTROLLER_UNPUBLISH => "pending-controller-unpublish",
566        }
567    }
568}
569
570/// Cluster-specific options used to create the volume. 
571#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
572pub struct ClusterVolumeSpec {
573    /// Group defines the volume group of this volume. Volumes belonging to the same group can be referred to by group name when creating Services.  Referring to a volume by group instructs Swarm to treat volumes in that group interchangeably for the purpose of scheduling. Volumes with an empty string for a group technically all belong to the same, emptystring group. 
574    #[serde(rename = "Group")]
575    #[serde(skip_serializing_if = "Option::is_none")]
576    pub group: Option<String>,
577
578    #[serde(rename = "AccessMode")]
579    #[serde(skip_serializing_if = "Option::is_none")]
580    pub access_mode: Option<ClusterVolumeSpecAccessMode>,
581
582}
583
584/// Defines how the volume is used by tasks. 
585#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
586pub struct ClusterVolumeSpecAccessMode {
587    /// The set of nodes this volume can be used on at one time. - `single` The volume may only be scheduled to one node at a time. - `multi` the volume may be scheduled to any supported number of nodes at a time. 
588    #[serde(rename = "Scope")]
589    #[serde(skip_serializing_if = "Option::is_none")]
590    pub scope: Option<ClusterVolumeSpecAccessModeScopeEnum>,
591
592    /// The number and way that different tasks can use this volume at one time. - `none` The volume may only be used by one task at a time. - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. - `all` The volume may have any number of readers and writers. 
593    #[serde(rename = "Sharing")]
594    #[serde(skip_serializing_if = "Option::is_none")]
595    pub sharing: Option<ClusterVolumeSpecAccessModeSharingEnum>,
596
597    /// Options for using this volume as a Mount-type volume.      Either MountVolume or BlockVolume, but not both, must be     present.   properties:     FsType:       type: \"string\"       description: |         Specifies the filesystem type for the mount volume.         Optional.     MountFlags:       type: \"array\"       description: |         Flags to pass when mounting the volume. Optional.       items:         type: \"string\" BlockVolume:   type: \"object\"   description: |     Options for using this volume as a Block-type volume.     Intentionally empty. 
598    #[serde(rename = "MountVolume")]
599    #[serde(skip_serializing_if = "Option::is_none")]
600    pub mount_volume: Option<HashMap<(), ()>>,
601
602    /// Swarm Secrets that are passed to the CSI storage plugin when operating on this volume. 
603    #[serde(rename = "Secrets")]
604    #[serde(skip_serializing_if = "Option::is_none")]
605    pub secrets: Option<Vec<ClusterVolumeSpecAccessModeSecrets>>,
606
607    #[serde(rename = "AccessibilityRequirements")]
608    #[serde(skip_serializing_if = "Option::is_none")]
609    pub accessibility_requirements: Option<ClusterVolumeSpecAccessModeAccessibilityRequirements>,
610
611    #[serde(rename = "CapacityRange")]
612    #[serde(skip_serializing_if = "Option::is_none")]
613    pub capacity_range: Option<ClusterVolumeSpecAccessModeCapacityRange>,
614
615    /// The availability of the volume for use in tasks. - `active` The volume is fully available for scheduling on the cluster - `pause` No new workloads should use the volume, but existing workloads are not stopped. - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. 
616    #[serde(rename = "Availability")]
617    #[serde(skip_serializing_if = "Option::is_none")]
618    pub availability: Option<ClusterVolumeSpecAccessModeAvailabilityEnum>,
619
620}
621
622#[allow(non_camel_case_types)]
623#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
624pub enum ClusterVolumeSpecAccessModeScopeEnum { 
625    #[serde(rename = "")]
626    EMPTY,
627    #[serde(rename = "single")]
628    SINGLE,
629    #[serde(rename = "multi")]
630    MULTI,
631}
632
633impl ::std::fmt::Display for ClusterVolumeSpecAccessModeScopeEnum {
634    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
635        match *self { 
636            ClusterVolumeSpecAccessModeScopeEnum::EMPTY => write!(f, ""),
637            ClusterVolumeSpecAccessModeScopeEnum::SINGLE => write!(f, "{}", "single"),
638            ClusterVolumeSpecAccessModeScopeEnum::MULTI => write!(f, "{}", "multi"),
639
640        }
641    }
642}
643
644impl ::std::str::FromStr for ClusterVolumeSpecAccessModeScopeEnum {
645    type Err = String;
646    fn from_str(s: &str) -> Result<Self, Self::Err> {
647        match s { 
648            "" => Ok(ClusterVolumeSpecAccessModeScopeEnum::EMPTY),
649            "single" => Ok(ClusterVolumeSpecAccessModeScopeEnum::SINGLE),
650            "multi" => Ok(ClusterVolumeSpecAccessModeScopeEnum::MULTI),
651            x => Err(format!("Invalid enum type: {}", x)),
652        }
653    }
654}
655
656impl ::std::convert::AsRef<str> for ClusterVolumeSpecAccessModeScopeEnum {
657    fn as_ref(&self) -> &str {
658        match self { 
659            ClusterVolumeSpecAccessModeScopeEnum::EMPTY => "",
660            ClusterVolumeSpecAccessModeScopeEnum::SINGLE => "single",
661            ClusterVolumeSpecAccessModeScopeEnum::MULTI => "multi",
662        }
663    }
664}
665
666#[allow(non_camel_case_types)]
667#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
668pub enum ClusterVolumeSpecAccessModeSharingEnum { 
669    #[serde(rename = "")]
670    EMPTY,
671    #[serde(rename = "none")]
672    NONE,
673    #[serde(rename = "readonly")]
674    READONLY,
675    #[serde(rename = "onewriter")]
676    ONEWRITER,
677    #[serde(rename = "all")]
678    ALL,
679}
680
681impl ::std::fmt::Display for ClusterVolumeSpecAccessModeSharingEnum {
682    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
683        match *self { 
684            ClusterVolumeSpecAccessModeSharingEnum::EMPTY => write!(f, ""),
685            ClusterVolumeSpecAccessModeSharingEnum::NONE => write!(f, "{}", "none"),
686            ClusterVolumeSpecAccessModeSharingEnum::READONLY => write!(f, "{}", "readonly"),
687            ClusterVolumeSpecAccessModeSharingEnum::ONEWRITER => write!(f, "{}", "onewriter"),
688            ClusterVolumeSpecAccessModeSharingEnum::ALL => write!(f, "{}", "all"),
689
690        }
691    }
692}
693
694impl ::std::str::FromStr for ClusterVolumeSpecAccessModeSharingEnum {
695    type Err = String;
696    fn from_str(s: &str) -> Result<Self, Self::Err> {
697        match s { 
698            "" => Ok(ClusterVolumeSpecAccessModeSharingEnum::EMPTY),
699            "none" => Ok(ClusterVolumeSpecAccessModeSharingEnum::NONE),
700            "readonly" => Ok(ClusterVolumeSpecAccessModeSharingEnum::READONLY),
701            "onewriter" => Ok(ClusterVolumeSpecAccessModeSharingEnum::ONEWRITER),
702            "all" => Ok(ClusterVolumeSpecAccessModeSharingEnum::ALL),
703            x => Err(format!("Invalid enum type: {}", x)),
704        }
705    }
706}
707
708impl ::std::convert::AsRef<str> for ClusterVolumeSpecAccessModeSharingEnum {
709    fn as_ref(&self) -> &str {
710        match self { 
711            ClusterVolumeSpecAccessModeSharingEnum::EMPTY => "",
712            ClusterVolumeSpecAccessModeSharingEnum::NONE => "none",
713            ClusterVolumeSpecAccessModeSharingEnum::READONLY => "readonly",
714            ClusterVolumeSpecAccessModeSharingEnum::ONEWRITER => "onewriter",
715            ClusterVolumeSpecAccessModeSharingEnum::ALL => "all",
716        }
717    }
718}
719
720#[allow(non_camel_case_types)]
721#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
722pub enum ClusterVolumeSpecAccessModeAvailabilityEnum { 
723    #[serde(rename = "")]
724    EMPTY,
725    #[serde(rename = "active")]
726    ACTIVE,
727    #[serde(rename = "pause")]
728    PAUSE,
729    #[serde(rename = "drain")]
730    DRAIN,
731}
732
733impl ::std::fmt::Display for ClusterVolumeSpecAccessModeAvailabilityEnum {
734    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
735        match *self { 
736            ClusterVolumeSpecAccessModeAvailabilityEnum::EMPTY => write!(f, ""),
737            ClusterVolumeSpecAccessModeAvailabilityEnum::ACTIVE => write!(f, "{}", "active"),
738            ClusterVolumeSpecAccessModeAvailabilityEnum::PAUSE => write!(f, "{}", "pause"),
739            ClusterVolumeSpecAccessModeAvailabilityEnum::DRAIN => write!(f, "{}", "drain"),
740
741        }
742    }
743}
744
745impl ::std::str::FromStr for ClusterVolumeSpecAccessModeAvailabilityEnum {
746    type Err = String;
747    fn from_str(s: &str) -> Result<Self, Self::Err> {
748        match s { 
749            "" => Ok(ClusterVolumeSpecAccessModeAvailabilityEnum::EMPTY),
750            "active" => Ok(ClusterVolumeSpecAccessModeAvailabilityEnum::ACTIVE),
751            "pause" => Ok(ClusterVolumeSpecAccessModeAvailabilityEnum::PAUSE),
752            "drain" => Ok(ClusterVolumeSpecAccessModeAvailabilityEnum::DRAIN),
753            x => Err(format!("Invalid enum type: {}", x)),
754        }
755    }
756}
757
758impl ::std::convert::AsRef<str> for ClusterVolumeSpecAccessModeAvailabilityEnum {
759    fn as_ref(&self) -> &str {
760        match self { 
761            ClusterVolumeSpecAccessModeAvailabilityEnum::EMPTY => "",
762            ClusterVolumeSpecAccessModeAvailabilityEnum::ACTIVE => "active",
763            ClusterVolumeSpecAccessModeAvailabilityEnum::PAUSE => "pause",
764            ClusterVolumeSpecAccessModeAvailabilityEnum::DRAIN => "drain",
765        }
766    }
767}
768
769/// Requirements for the accessible topology of the volume. These fields are optional. For an in-depth description of what these fields mean, see the CSI specification. 
770#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
771pub struct ClusterVolumeSpecAccessModeAccessibilityRequirements {
772    /// A list of required topologies, at least one of which the volume must be accessible from. 
773    #[serde(rename = "Requisite")]
774    #[serde(skip_serializing_if = "Option::is_none")]
775    pub requisite: Option<Vec<Topology>>,
776
777    /// A list of topologies that the volume should attempt to be provisioned in. 
778    #[serde(rename = "Preferred")]
779    #[serde(skip_serializing_if = "Option::is_none")]
780    pub preferred: Option<Vec<Topology>>,
781
782}
783
784/// The desired capacity that the volume should be created with. If empty, the plugin will decide the capacity. 
785#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
786pub struct ClusterVolumeSpecAccessModeCapacityRange {
787    /// The volume must be at least this big. The value of 0 indicates an unspecified minimum 
788    #[serde(rename = "RequiredBytes")]
789    #[serde(skip_serializing_if = "Option::is_none")]
790    pub required_bytes: Option<i64>,
791
792    /// The volume must not be bigger than this. The value of 0 indicates an unspecified maximum. 
793    #[serde(rename = "LimitBytes")]
794    #[serde(skip_serializing_if = "Option::is_none")]
795    pub limit_bytes: Option<i64>,
796
797}
798
799/// One cluster volume secret entry. Defines a key-value pair that is passed to the plugin. 
800#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
801pub struct ClusterVolumeSpecAccessModeSecrets {
802    /// Key is the name of the key of the key-value pair passed to the plugin. 
803    #[serde(rename = "Key")]
804    #[serde(skip_serializing_if = "Option::is_none")]
805    pub key: Option<String>,
806
807    /// Secret is the swarm Secret object from which to read data. This can be a Secret name or ID. The Secret data is retrieved by swarm and used as the value of the key-value pair passed to the plugin. 
808    #[serde(rename = "Secret")]
809    #[serde(skip_serializing_if = "Option::is_none")]
810    pub secret: Option<String>,
811
812}
813
814/// 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`. 
815#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
816pub struct Commit {
817    /// Actual commit ID of external tool.
818    #[serde(rename = "ID")]
819    #[serde(skip_serializing_if = "Option::is_none")]
820    pub id: Option<String>,
821
822    /// Commit ID of external tool expected by dockerd as set at build time.  **Deprecated**: This field is deprecated and will be omitted in a API v1.49. 
823    #[serde(rename = "Expected")]
824    #[serde(skip_serializing_if = "Option::is_none")]
825    pub expected: Option<String>,
826
827}
828
829#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
830pub struct Config {
831    #[serde(rename = "ID")]
832    #[serde(skip_serializing_if = "Option::is_none")]
833    pub id: Option<String>,
834
835    #[serde(rename = "Version")]
836    #[serde(skip_serializing_if = "Option::is_none")]
837    pub version: Option<ObjectVersion>,
838
839    #[serde(rename = "CreatedAt")]
840    #[serde(skip_serializing_if = "Option::is_none")]
841    #[serde(
842        default,
843        deserialize_with = "deserialize_timestamp",
844        serialize_with = "serialize_timestamp"
845    )]
846    pub created_at: Option<BollardDate>,
847
848    #[serde(rename = "UpdatedAt")]
849    #[serde(skip_serializing_if = "Option::is_none")]
850    #[serde(
851        default,
852        deserialize_with = "deserialize_timestamp",
853        serialize_with = "serialize_timestamp"
854    )]
855    pub updated_at: Option<BollardDate>,
856
857    #[serde(rename = "Spec")]
858    #[serde(skip_serializing_if = "Option::is_none")]
859    pub spec: Option<ConfigSpec>,
860
861}
862
863/// The config-only network source to provide the configuration for this network. 
864#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
865pub struct ConfigReference {
866    /// The name of the config-only network that provides the network's configuration. The specified network must be an existing config-only network. Only network names are allowed, not network IDs. 
867    #[serde(rename = "Network")]
868    #[serde(skip_serializing_if = "Option::is_none")]
869    pub network: Option<String>,
870
871}
872
873#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
874pub struct ConfigSpec {
875    /// User-defined name of the config.
876    #[serde(rename = "Name")]
877    #[serde(skip_serializing_if = "Option::is_none")]
878    pub name: Option<String>,
879
880    /// User-defined key/value metadata.
881    #[serde(rename = "Labels")]
882    #[serde(skip_serializing_if = "Option::is_none")]
883    pub labels: Option<HashMap<String, String>>,
884
885    /// Data is the data to store as a config, formatted as a Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). 
886    #[serde(rename = "Data")]
887    #[serde(skip_serializing_if = "Option::is_none")]
888    pub data: Option<String>,
889
890    /// 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. 
891    #[serde(rename = "Templating")]
892    #[serde(skip_serializing_if = "Option::is_none")]
893    pub templating: Option<Driver>,
894
895}
896
897/// Blkio stats entry.  This type is Linux-specific and omitted for Windows containers. 
898#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
899pub struct ContainerBlkioStatEntry {
900    #[serde(rename = "major")]
901    #[serde(skip_serializing_if = "Option::is_none")]
902    pub major: Option<u64>,
903
904    #[serde(rename = "minor")]
905    #[serde(skip_serializing_if = "Option::is_none")]
906    pub minor: Option<u64>,
907
908    #[serde(rename = "op")]
909    #[serde(skip_serializing_if = "Option::is_none")]
910    pub op: Option<String>,
911
912    #[serde(rename = "value")]
913    #[serde(skip_serializing_if = "Option::is_none")]
914    pub value: Option<u64>,
915
916}
917
918/// BlkioStats stores all IO service stats for data read and write.  This type is Linux-specific and holds many fields that are specific to cgroups v1. On a cgroup v2 host, all fields other than `io_service_bytes_recursive` are omitted or `null`.  This type is only populated on Linux and omitted for Windows containers. 
919#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
920pub struct ContainerBlkioStats {
921    #[serde(rename = "io_service_bytes_recursive")]
922    #[serde(skip_serializing_if = "Option::is_none")]
923    pub io_service_bytes_recursive: Option<Vec<ContainerBlkioStatEntry>>,
924
925    /// This field is only available when using Linux containers with cgroups v1. It is omitted or `null` when using cgroups v2. 
926    #[serde(rename = "io_serviced_recursive")]
927    #[serde(skip_serializing_if = "Option::is_none")]
928    pub io_serviced_recursive: Option<Vec<ContainerBlkioStatEntry>>,
929
930    /// This field is only available when using Linux containers with cgroups v1. It is omitted or `null` when using cgroups v2. 
931    #[serde(rename = "io_queue_recursive")]
932    #[serde(skip_serializing_if = "Option::is_none")]
933    pub io_queue_recursive: Option<Vec<ContainerBlkioStatEntry>>,
934
935    /// This field is only available when using Linux containers with cgroups v1. It is omitted or `null` when using cgroups v2. 
936    #[serde(rename = "io_service_time_recursive")]
937    #[serde(skip_serializing_if = "Option::is_none")]
938    pub io_service_time_recursive: Option<Vec<ContainerBlkioStatEntry>>,
939
940    /// This field is only available when using Linux containers with cgroups v1. It is omitted or `null` when using cgroups v2. 
941    #[serde(rename = "io_wait_time_recursive")]
942    #[serde(skip_serializing_if = "Option::is_none")]
943    pub io_wait_time_recursive: Option<Vec<ContainerBlkioStatEntry>>,
944
945    /// This field is only available when using Linux containers with cgroups v1. It is omitted or `null` when using cgroups v2. 
946    #[serde(rename = "io_merged_recursive")]
947    #[serde(skip_serializing_if = "Option::is_none")]
948    pub io_merged_recursive: Option<Vec<ContainerBlkioStatEntry>>,
949
950    /// This field is only available when using Linux containers with cgroups v1. It is omitted or `null` when using cgroups v2. 
951    #[serde(rename = "io_time_recursive")]
952    #[serde(skip_serializing_if = "Option::is_none")]
953    pub io_time_recursive: Option<Vec<ContainerBlkioStatEntry>>,
954
955    /// This field is only available when using Linux containers with cgroups v1. It is omitted or `null` when using cgroups v2. 
956    #[serde(rename = "sectors_recursive")]
957    #[serde(skip_serializing_if = "Option::is_none")]
958    pub sectors_recursive: Option<Vec<ContainerBlkioStatEntry>>,
959
960}
961
962/// Configuration for a container that is portable between hosts. 
963#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
964pub struct ContainerConfig {
965    /// The hostname to use for the container, as a valid RFC 1123 hostname. 
966    #[serde(rename = "Hostname")]
967    #[serde(skip_serializing_if = "Option::is_none")]
968    pub hostname: Option<String>,
969
970    /// The domain name to use for the container. 
971    #[serde(rename = "Domainname")]
972    #[serde(skip_serializing_if = "Option::is_none")]
973    pub domainname: Option<String>,
974
975    /// Commands run as this user inside the container. If omitted, commands run as the user specified in the image the container was started from.  Can be either user-name or UID, and optional group-name or GID, separated by a colon (`<user-name|UID>[<:group-name|GID>]`).
976    #[serde(rename = "User")]
977    #[serde(skip_serializing_if = "Option::is_none")]
978    pub user: Option<String>,
979
980    /// Whether to attach to `stdin`.
981    #[serde(rename = "AttachStdin")]
982    #[serde(skip_serializing_if = "Option::is_none")]
983    pub attach_stdin: Option<bool>,
984
985    /// Whether to attach to `stdout`.
986    #[serde(rename = "AttachStdout")]
987    #[serde(skip_serializing_if = "Option::is_none")]
988    pub attach_stdout: Option<bool>,
989
990    /// Whether to attach to `stderr`.
991    #[serde(rename = "AttachStderr")]
992    #[serde(skip_serializing_if = "Option::is_none")]
993    pub attach_stderr: Option<bool>,
994
995    /// An object mapping ports to an empty object in the form:  `{\"<port>/<tcp|udp|sctp>\": {}}` 
996    #[serde(rename = "ExposedPorts")]
997    #[serde(skip_serializing_if = "Option::is_none")]
998    pub exposed_ports: Option<HashMap<String, HashMap<(), ()>>>,
999
1000    /// Attach standard streams to a TTY, including `stdin` if it is not closed. 
1001    #[serde(rename = "Tty")]
1002    #[serde(skip_serializing_if = "Option::is_none")]
1003    pub tty: Option<bool>,
1004
1005    /// Open `stdin`
1006    #[serde(rename = "OpenStdin")]
1007    #[serde(skip_serializing_if = "Option::is_none")]
1008    pub open_stdin: Option<bool>,
1009
1010    /// Close `stdin` after one attached client disconnects
1011    #[serde(rename = "StdinOnce")]
1012    #[serde(skip_serializing_if = "Option::is_none")]
1013    pub stdin_once: Option<bool>,
1014
1015    /// 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. 
1016    #[serde(rename = "Env")]
1017    #[serde(skip_serializing_if = "Option::is_none")]
1018    pub env: Option<Vec<String>>,
1019
1020    /// Command to run specified as a string or an array of strings. 
1021    #[serde(rename = "Cmd")]
1022    #[serde(skip_serializing_if = "Option::is_none")]
1023    pub cmd: Option<Vec<String>>,
1024
1025    #[serde(rename = "Healthcheck")]
1026    #[serde(skip_serializing_if = "Option::is_none")]
1027    pub healthcheck: Option<HealthConfig>,
1028
1029    /// Command is already escaped (Windows only)
1030    #[serde(rename = "ArgsEscaped")]
1031    #[serde(skip_serializing_if = "Option::is_none")]
1032    pub args_escaped: Option<bool>,
1033
1034    /// The name (or reference) of the image to use when creating the container, or which was used when the container was created. 
1035    #[serde(rename = "Image")]
1036    #[serde(skip_serializing_if = "Option::is_none")]
1037    pub image: Option<String>,
1038
1039    /// An object mapping mount point paths inside the container to empty objects. 
1040    #[serde(rename = "Volumes")]
1041    #[serde(skip_serializing_if = "Option::is_none")]
1042    pub volumes: Option<HashMap<String, HashMap<(), ()>>>,
1043
1044    /// The working directory for commands to run in.
1045    #[serde(rename = "WorkingDir")]
1046    #[serde(skip_serializing_if = "Option::is_none")]
1047    pub working_dir: Option<String>,
1048
1049    /// 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`). 
1050    #[serde(rename = "Entrypoint")]
1051    #[serde(skip_serializing_if = "Option::is_none")]
1052    pub entrypoint: Option<Vec<String>>,
1053
1054    /// Disable networking for the container.
1055    #[serde(rename = "NetworkDisabled")]
1056    #[serde(skip_serializing_if = "Option::is_none")]
1057    pub network_disabled: Option<bool>,
1058
1059    /// MAC address of the container.  Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. 
1060    #[serde(rename = "MacAddress")]
1061    #[serde(skip_serializing_if = "Option::is_none")]
1062    pub mac_address: Option<String>,
1063
1064    /// `ONBUILD` metadata that were defined in the image's `Dockerfile`. 
1065    #[serde(rename = "OnBuild")]
1066    #[serde(skip_serializing_if = "Option::is_none")]
1067    pub on_build: Option<Vec<String>>,
1068
1069    /// User-defined key/value metadata.
1070    #[serde(rename = "Labels")]
1071    #[serde(skip_serializing_if = "Option::is_none")]
1072    pub labels: Option<HashMap<String, String>>,
1073
1074    /// Signal to stop a container as a string or unsigned integer. 
1075    #[serde(rename = "StopSignal")]
1076    #[serde(skip_serializing_if = "Option::is_none")]
1077    pub stop_signal: Option<String>,
1078
1079    /// Timeout to stop a container in seconds.
1080    #[serde(rename = "StopTimeout")]
1081    #[serde(skip_serializing_if = "Option::is_none")]
1082    pub stop_timeout: Option<i64>,
1083
1084    /// Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. 
1085    #[serde(rename = "Shell")]
1086    #[serde(skip_serializing_if = "Option::is_none")]
1087    pub shell: Option<Vec<String>>,
1088
1089}
1090
1091/// CPU related info of the container 
1092#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1093pub struct ContainerCpuStats {
1094    #[serde(rename = "cpu_usage")]
1095    #[serde(skip_serializing_if = "Option::is_none")]
1096    pub cpu_usage: Option<ContainerCpuUsage>,
1097
1098    /// System Usage.  This field is Linux-specific and omitted for Windows containers. 
1099    #[serde(rename = "system_cpu_usage")]
1100    #[serde(skip_serializing_if = "Option::is_none")]
1101    pub system_cpu_usage: Option<u64>,
1102
1103    /// Number of online CPUs.  This field is Linux-specific and omitted for Windows containers. 
1104    #[serde(rename = "online_cpus")]
1105    #[serde(skip_serializing_if = "Option::is_none")]
1106    pub online_cpus: Option<u32>,
1107
1108    #[serde(rename = "throttling_data")]
1109    #[serde(skip_serializing_if = "Option::is_none")]
1110    pub throttling_data: Option<ContainerThrottlingData>,
1111
1112}
1113
1114/// All CPU stats aggregated since container inception. 
1115#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1116pub struct ContainerCpuUsage {
1117    /// Total CPU time consumed in nanoseconds (Linux) or 100's of nanoseconds (Windows). 
1118    #[serde(rename = "total_usage")]
1119    #[serde(skip_serializing_if = "Option::is_none")]
1120    pub total_usage: Option<u64>,
1121
1122    /// Total CPU time (in nanoseconds) consumed per core (Linux).  This field is Linux-specific when using cgroups v1. It is omitted when using cgroups v2 and Windows containers. 
1123    #[serde(rename = "percpu_usage")]
1124    #[serde(skip_serializing_if = "Option::is_none")]
1125    pub percpu_usage: Option<Vec<i32>>,
1126
1127    /// Time (in nanoseconds) spent by tasks of the cgroup in kernel mode (Linux), or time spent (in 100's of nanoseconds) by all container processes in kernel mode (Windows).  Not populated for Windows containers using Hyper-V isolation. 
1128    #[serde(rename = "usage_in_kernelmode")]
1129    #[serde(skip_serializing_if = "Option::is_none")]
1130    pub usage_in_kernelmode: Option<u64>,
1131
1132    /// Time (in nanoseconds) spent by tasks of the cgroup in user mode (Linux), or time spent (in 100's of nanoseconds) by all container processes in kernel mode (Windows).  Not populated for Windows containers using Hyper-V isolation. 
1133    #[serde(rename = "usage_in_usermode")]
1134    #[serde(skip_serializing_if = "Option::is_none")]
1135    pub usage_in_usermode: Option<u64>,
1136
1137}
1138
1139#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1140pub struct ContainerCreateBody {
1141    /// The hostname to use for the container, as a valid RFC 1123 hostname. 
1142    #[serde(rename = "Hostname")]
1143    #[serde(skip_serializing_if = "Option::is_none")]
1144    pub hostname: Option<String>,
1145
1146    /// The domain name to use for the container. 
1147    #[serde(rename = "Domainname")]
1148    #[serde(skip_serializing_if = "Option::is_none")]
1149    pub domainname: Option<String>,
1150
1151    /// Commands run as this user inside the container. If omitted, commands run as the user specified in the image the container was started from.  Can be either user-name or UID, and optional group-name or GID, separated by a colon (`<user-name|UID>[<:group-name|GID>]`).
1152    #[serde(rename = "User")]
1153    #[serde(skip_serializing_if = "Option::is_none")]
1154    pub user: Option<String>,
1155
1156    /// Whether to attach to `stdin`.
1157    #[serde(rename = "AttachStdin")]
1158    #[serde(skip_serializing_if = "Option::is_none")]
1159    pub attach_stdin: Option<bool>,
1160
1161    /// Whether to attach to `stdout`.
1162    #[serde(rename = "AttachStdout")]
1163    #[serde(skip_serializing_if = "Option::is_none")]
1164    pub attach_stdout: Option<bool>,
1165
1166    /// Whether to attach to `stderr`.
1167    #[serde(rename = "AttachStderr")]
1168    #[serde(skip_serializing_if = "Option::is_none")]
1169    pub attach_stderr: Option<bool>,
1170
1171    /// An object mapping ports to an empty object in the form:  `{\"<port>/<tcp|udp|sctp>\": {}}` 
1172    #[serde(rename = "ExposedPorts")]
1173    #[serde(skip_serializing_if = "Option::is_none")]
1174    pub exposed_ports: Option<HashMap<String, HashMap<(), ()>>>,
1175
1176    /// Attach standard streams to a TTY, including `stdin` if it is not closed. 
1177    #[serde(rename = "Tty")]
1178    #[serde(skip_serializing_if = "Option::is_none")]
1179    pub tty: Option<bool>,
1180
1181    /// Open `stdin`
1182    #[serde(rename = "OpenStdin")]
1183    #[serde(skip_serializing_if = "Option::is_none")]
1184    pub open_stdin: Option<bool>,
1185
1186    /// Close `stdin` after one attached client disconnects
1187    #[serde(rename = "StdinOnce")]
1188    #[serde(skip_serializing_if = "Option::is_none")]
1189    pub stdin_once: Option<bool>,
1190
1191    /// 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. 
1192    #[serde(rename = "Env")]
1193    #[serde(skip_serializing_if = "Option::is_none")]
1194    pub env: Option<Vec<String>>,
1195
1196    /// Command to run specified as a string or an array of strings. 
1197    #[serde(rename = "Cmd")]
1198    #[serde(skip_serializing_if = "Option::is_none")]
1199    pub cmd: Option<Vec<String>>,
1200
1201    #[serde(rename = "Healthcheck")]
1202    #[serde(skip_serializing_if = "Option::is_none")]
1203    pub healthcheck: Option<HealthConfig>,
1204
1205    /// Command is already escaped (Windows only)
1206    #[serde(rename = "ArgsEscaped")]
1207    #[serde(skip_serializing_if = "Option::is_none")]
1208    pub args_escaped: Option<bool>,
1209
1210    /// The name (or reference) of the image to use when creating the container, or which was used when the container was created. 
1211    #[serde(rename = "Image")]
1212    #[serde(skip_serializing_if = "Option::is_none")]
1213    pub image: Option<String>,
1214
1215    /// An object mapping mount point paths inside the container to empty objects. 
1216    #[serde(rename = "Volumes")]
1217    #[serde(skip_serializing_if = "Option::is_none")]
1218    pub volumes: Option<HashMap<String, HashMap<(), ()>>>,
1219
1220    /// The working directory for commands to run in.
1221    #[serde(rename = "WorkingDir")]
1222    #[serde(skip_serializing_if = "Option::is_none")]
1223    pub working_dir: Option<String>,
1224
1225    /// 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`). 
1226    #[serde(rename = "Entrypoint")]
1227    #[serde(skip_serializing_if = "Option::is_none")]
1228    pub entrypoint: Option<Vec<String>>,
1229
1230    /// Disable networking for the container.
1231    #[serde(rename = "NetworkDisabled")]
1232    #[serde(skip_serializing_if = "Option::is_none")]
1233    pub network_disabled: Option<bool>,
1234
1235    /// MAC address of the container.  Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. 
1236    #[serde(rename = "MacAddress")]
1237    #[serde(skip_serializing_if = "Option::is_none")]
1238    pub mac_address: Option<String>,
1239
1240    /// `ONBUILD` metadata that were defined in the image's `Dockerfile`. 
1241    #[serde(rename = "OnBuild")]
1242    #[serde(skip_serializing_if = "Option::is_none")]
1243    pub on_build: Option<Vec<String>>,
1244
1245    /// User-defined key/value metadata.
1246    #[serde(rename = "Labels")]
1247    #[serde(skip_serializing_if = "Option::is_none")]
1248    pub labels: Option<HashMap<String, String>>,
1249
1250    /// Signal to stop a container as a string or unsigned integer. 
1251    #[serde(rename = "StopSignal")]
1252    #[serde(skip_serializing_if = "Option::is_none")]
1253    pub stop_signal: Option<String>,
1254
1255    /// Timeout to stop a container in seconds.
1256    #[serde(rename = "StopTimeout")]
1257    #[serde(skip_serializing_if = "Option::is_none")]
1258    pub stop_timeout: Option<i64>,
1259
1260    /// Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. 
1261    #[serde(rename = "Shell")]
1262    #[serde(skip_serializing_if = "Option::is_none")]
1263    pub shell: Option<Vec<String>>,
1264
1265    #[serde(rename = "HostConfig")]
1266    #[serde(skip_serializing_if = "Option::is_none")]
1267    pub host_config: Option<HostConfig>,
1268
1269    #[serde(rename = "NetworkingConfig")]
1270    #[serde(skip_serializing_if = "Option::is_none")]
1271    pub networking_config: Option<NetworkingConfig>,
1272
1273}
1274
1275/// OK response to ContainerCreate operation
1276#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1277pub struct ContainerCreateResponse {
1278    /// The ID of the created container
1279    #[serde(rename = "Id")]
1280    pub id: String,
1281
1282    /// Warnings encountered when creating the container
1283    #[serde(rename = "Warnings")]
1284    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
1285    pub warnings: Vec<String>,
1286
1287}
1288
1289#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1290pub struct ContainerInspectResponse {
1291    /// The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes).
1292    #[serde(rename = "Id")]
1293    #[serde(skip_serializing_if = "Option::is_none")]
1294    pub id: Option<String>,
1295
1296    /// Date and time at which the container was created, formatted in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.
1297    #[serde(rename = "Created")]
1298    #[serde(skip_serializing_if = "Option::is_none")]
1299    #[serde(
1300        default,
1301        deserialize_with = "deserialize_timestamp",
1302        serialize_with = "serialize_timestamp"
1303    )]
1304    pub created: Option<BollardDate>,
1305
1306    /// The path to the command being run
1307    #[serde(rename = "Path")]
1308    #[serde(skip_serializing_if = "Option::is_none")]
1309    pub path: Option<String>,
1310
1311    /// The arguments to the command being run
1312    #[serde(rename = "Args")]
1313    #[serde(skip_serializing_if = "Option::is_none")]
1314    pub args: Option<Vec<String>>,
1315
1316    #[serde(rename = "State")]
1317    #[serde(skip_serializing_if = "Option::is_none")]
1318    pub state: Option<ContainerState>,
1319
1320    /// The ID (digest) of the image that this container was created from.
1321    #[serde(rename = "Image")]
1322    #[serde(skip_serializing_if = "Option::is_none")]
1323    pub image: Option<String>,
1324
1325    /// Location of the `/etc/resolv.conf` generated for the container on the host.  This file is managed through the docker daemon, and should not be accessed or modified by other tools.
1326    #[serde(rename = "ResolvConfPath")]
1327    #[serde(skip_serializing_if = "Option::is_none")]
1328    pub resolv_conf_path: Option<String>,
1329
1330    /// Location of the `/etc/hostname` generated for the container on the host.  This file is managed through the docker daemon, and should not be accessed or modified by other tools.
1331    #[serde(rename = "HostnamePath")]
1332    #[serde(skip_serializing_if = "Option::is_none")]
1333    pub hostname_path: Option<String>,
1334
1335    /// Location of the `/etc/hosts` generated for the container on the host.  This file is managed through the docker daemon, and should not be accessed or modified by other tools.
1336    #[serde(rename = "HostsPath")]
1337    #[serde(skip_serializing_if = "Option::is_none")]
1338    pub hosts_path: Option<String>,
1339
1340    /// Location of the file used to buffer the container's logs. Depending on the logging-driver used for the container, this field may be omitted.  This file is managed through the docker daemon, and should not be accessed or modified by other tools.
1341    #[serde(rename = "LogPath")]
1342    #[serde(skip_serializing_if = "Option::is_none")]
1343    pub log_path: Option<String>,
1344
1345    /// The name associated with this container.  For historic reasons, the name may be prefixed with a forward-slash (`/`).
1346    #[serde(rename = "Name")]
1347    #[serde(skip_serializing_if = "Option::is_none")]
1348    pub name: Option<String>,
1349
1350    /// Number of times the container was restarted since it was created, or since daemon was started.
1351    #[serde(rename = "RestartCount")]
1352    #[serde(skip_serializing_if = "Option::is_none")]
1353    pub restart_count: Option<i64>,
1354
1355    /// The storage-driver used for the container's filesystem (graph-driver or snapshotter).
1356    #[serde(rename = "Driver")]
1357    #[serde(skip_serializing_if = "Option::is_none")]
1358    pub driver: Option<String>,
1359
1360    /// The platform (operating system) for which the container was created.  This field was introduced for the experimental \"LCOW\" (Linux Containers On Windows) features, which has been removed. In most cases, this field is equal to the host's operating system (`linux` or `windows`).
1361    #[serde(rename = "Platform")]
1362    #[serde(skip_serializing_if = "Option::is_none")]
1363    pub platform: Option<String>,
1364
1365    /// OCI descriptor of the platform-specific manifest of the image the container was created from.  Note: Only available if the daemon provides a multi-platform image store.
1366    #[serde(rename = "ImageManifestDescriptor")]
1367    #[serde(skip_serializing_if = "Option::is_none")]
1368    pub image_manifest_descriptor: Option<OciDescriptor>,
1369
1370    /// SELinux mount label set for the container.
1371    #[serde(rename = "MountLabel")]
1372    #[serde(skip_serializing_if = "Option::is_none")]
1373    pub mount_label: Option<String>,
1374
1375    /// SELinux process label set for the container.
1376    #[serde(rename = "ProcessLabel")]
1377    #[serde(skip_serializing_if = "Option::is_none")]
1378    pub process_label: Option<String>,
1379
1380    /// The AppArmor profile set for the container.
1381    #[serde(rename = "AppArmorProfile")]
1382    #[serde(skip_serializing_if = "Option::is_none")]
1383    pub app_armor_profile: Option<String>,
1384
1385    /// IDs of exec instances that are running in the container.
1386    #[serde(rename = "ExecIDs")]
1387    #[serde(skip_serializing_if = "Option::is_none")]
1388    pub exec_ids: Option<Vec<String>>,
1389
1390    #[serde(rename = "HostConfig")]
1391    #[serde(skip_serializing_if = "Option::is_none")]
1392    pub host_config: Option<HostConfig>,
1393
1394    #[serde(rename = "GraphDriver")]
1395    #[serde(skip_serializing_if = "Option::is_none")]
1396    pub graph_driver: Option<DriverData>,
1397
1398    /// The size of files that have been created or changed by this container.  This field is omitted by default, and only set when size is requested in the API request.
1399    #[serde(rename = "SizeRw")]
1400    #[serde(skip_serializing_if = "Option::is_none")]
1401    pub size_rw: Option<i64>,
1402
1403    /// The total size of all files in the read-only layers from the image that the container uses. These layers can be shared between containers.  This field is omitted by default, and only set when size is requested in the API request.
1404    #[serde(rename = "SizeRootFs")]
1405    #[serde(skip_serializing_if = "Option::is_none")]
1406    pub size_root_fs: Option<i64>,
1407
1408    /// List of mounts used by the container.
1409    #[serde(rename = "Mounts")]
1410    #[serde(skip_serializing_if = "Option::is_none")]
1411    pub mounts: Option<Vec<MountPoint>>,
1412
1413    #[serde(rename = "Config")]
1414    #[serde(skip_serializing_if = "Option::is_none")]
1415    pub config: Option<ContainerConfig>,
1416
1417    #[serde(rename = "NetworkSettings")]
1418    #[serde(skip_serializing_if = "Option::is_none")]
1419    pub network_settings: Option<NetworkSettings>,
1420
1421}
1422
1423/// Aggregates all memory stats since container inception on Linux. Windows returns stats for commit and private working set only. 
1424#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1425pub struct ContainerMemoryStats {
1426    /// Current `res_counter` usage for memory.  This field is Linux-specific and omitted for Windows containers. 
1427    #[serde(rename = "usage")]
1428    #[serde(skip_serializing_if = "Option::is_none")]
1429    pub usage: Option<u64>,
1430
1431    /// Maximum usage ever recorded.  This field is Linux-specific and only supported on cgroups v1. It is omitted when using cgroups v2 and for Windows containers. 
1432    #[serde(rename = "max_usage")]
1433    #[serde(skip_serializing_if = "Option::is_none")]
1434    pub max_usage: Option<u64>,
1435
1436    /// All the stats exported via memory.stat. when using cgroups v2.  This field is Linux-specific and omitted for Windows containers. 
1437    #[serde(rename = "stats")]
1438    #[serde(skip_serializing_if = "Option::is_none")]
1439    pub stats: Option<HashMap<String, i32>>,
1440
1441    /// Number of times memory usage hits limits.  This field is Linux-specific and only supported on cgroups v1. It is omitted when using cgroups v2 and for Windows containers. 
1442    #[serde(rename = "failcnt")]
1443    #[serde(skip_serializing_if = "Option::is_none")]
1444    pub failcnt: Option<u64>,
1445
1446    /// This field is Linux-specific and omitted for Windows containers. 
1447    #[serde(rename = "limit")]
1448    #[serde(skip_serializing_if = "Option::is_none")]
1449    pub limit: Option<u64>,
1450
1451    /// Committed bytes.  This field is Windows-specific and omitted for Linux containers. 
1452    #[serde(rename = "commitbytes")]
1453    #[serde(skip_serializing_if = "Option::is_none")]
1454    pub commitbytes: Option<u64>,
1455
1456    /// Peak committed bytes.  This field is Windows-specific and omitted for Linux containers. 
1457    #[serde(rename = "commitpeakbytes")]
1458    #[serde(skip_serializing_if = "Option::is_none")]
1459    pub commitpeakbytes: Option<u64>,
1460
1461    /// Private working set.  This field is Windows-specific and omitted for Linux containers. 
1462    #[serde(rename = "privateworkingset")]
1463    #[serde(skip_serializing_if = "Option::is_none")]
1464    pub privateworkingset: Option<u64>,
1465
1466}
1467
1468/// Aggregates the network stats of one container 
1469#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1470pub struct ContainerNetworkStats {
1471    /// Bytes received. Windows and Linux. 
1472    #[serde(rename = "rx_bytes")]
1473    #[serde(skip_serializing_if = "Option::is_none")]
1474    pub rx_bytes: Option<u64>,
1475
1476    /// Packets received. Windows and Linux. 
1477    #[serde(rename = "rx_packets")]
1478    #[serde(skip_serializing_if = "Option::is_none")]
1479    pub rx_packets: Option<u64>,
1480
1481    /// Received errors. Not used on Windows.  This field is Linux-specific and always zero for Windows containers. 
1482    #[serde(rename = "rx_errors")]
1483    #[serde(skip_serializing_if = "Option::is_none")]
1484    pub rx_errors: Option<u64>,
1485
1486    /// Incoming packets dropped. Windows and Linux. 
1487    #[serde(rename = "rx_dropped")]
1488    #[serde(skip_serializing_if = "Option::is_none")]
1489    pub rx_dropped: Option<u64>,
1490
1491    /// Bytes sent. Windows and Linux. 
1492    #[serde(rename = "tx_bytes")]
1493    #[serde(skip_serializing_if = "Option::is_none")]
1494    pub tx_bytes: Option<u64>,
1495
1496    /// Packets sent. Windows and Linux. 
1497    #[serde(rename = "tx_packets")]
1498    #[serde(skip_serializing_if = "Option::is_none")]
1499    pub tx_packets: Option<u64>,
1500
1501    /// Sent errors. Not used on Windows.  This field is Linux-specific and always zero for Windows containers. 
1502    #[serde(rename = "tx_errors")]
1503    #[serde(skip_serializing_if = "Option::is_none")]
1504    pub tx_errors: Option<u64>,
1505
1506    /// Outgoing packets dropped. Windows and Linux. 
1507    #[serde(rename = "tx_dropped")]
1508    #[serde(skip_serializing_if = "Option::is_none")]
1509    pub tx_dropped: Option<u64>,
1510
1511    /// Endpoint ID. Not used on Linux.  This field is Windows-specific and omitted for Linux containers. 
1512    #[serde(rename = "endpoint_id")]
1513    #[serde(skip_serializing_if = "Option::is_none")]
1514    pub endpoint_id: Option<String>,
1515
1516    /// Instance ID. Not used on Linux.  This field is Windows-specific and omitted for Linux containers. 
1517    #[serde(rename = "instance_id")]
1518    #[serde(skip_serializing_if = "Option::is_none")]
1519    pub instance_id: Option<String>,
1520
1521}
1522
1523/// PidsStats contains Linux-specific stats of a container's process-IDs (PIDs).  This type is Linux-specific and omitted for Windows containers. 
1524#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1525pub struct ContainerPidsStats {
1526    /// Current is the number of PIDs in the cgroup. 
1527    #[serde(rename = "current")]
1528    #[serde(skip_serializing_if = "Option::is_none")]
1529    pub current: Option<u64>,
1530
1531    /// Limit is the hard limit on the number of pids in the cgroup. A \"Limit\" of 0 means that there is no limit. 
1532    #[serde(rename = "limit")]
1533    #[serde(skip_serializing_if = "Option::is_none")]
1534    pub limit: Option<u64>,
1535
1536}
1537
1538#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1539pub struct ContainerPruneResponse {
1540    /// Container IDs that were deleted
1541    #[serde(rename = "ContainersDeleted")]
1542    #[serde(skip_serializing_if = "Option::is_none")]
1543    pub containers_deleted: Option<Vec<String>>,
1544
1545    /// Disk space reclaimed in bytes
1546    #[serde(rename = "SpaceReclaimed")]
1547    #[serde(skip_serializing_if = "Option::is_none")]
1548    pub space_reclaimed: Option<i64>,
1549
1550}
1551
1552/// ContainerState stores container's running state. It's part of ContainerJSONBase and will be returned by the \"inspect\" command. 
1553#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1554pub struct ContainerState {
1555    /// String representation of the container state. Can be one of \"created\", \"running\", \"paused\", \"restarting\", \"removing\", \"exited\", or \"dead\". 
1556    #[serde(rename = "Status")]
1557    #[serde(skip_serializing_if = "Option::is_none")]
1558    pub status: Option<ContainerStateStatusEnum>,
1559
1560    /// 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\". 
1561    #[serde(rename = "Running")]
1562    #[serde(skip_serializing_if = "Option::is_none")]
1563    pub running: Option<bool>,
1564
1565    /// Whether this container is paused.
1566    #[serde(rename = "Paused")]
1567    #[serde(skip_serializing_if = "Option::is_none")]
1568    pub paused: Option<bool>,
1569
1570    /// Whether this container is restarting.
1571    #[serde(rename = "Restarting")]
1572    #[serde(skip_serializing_if = "Option::is_none")]
1573    pub restarting: Option<bool>,
1574
1575    /// Whether a process within this container has been killed because it ran out of memory since the container was last started. 
1576    #[serde(rename = "OOMKilled")]
1577    #[serde(skip_serializing_if = "Option::is_none")]
1578    pub oom_killed: Option<bool>,
1579
1580    #[serde(rename = "Dead")]
1581    #[serde(skip_serializing_if = "Option::is_none")]
1582    pub dead: Option<bool>,
1583
1584    /// The process ID of this container
1585    #[serde(rename = "Pid")]
1586    #[serde(skip_serializing_if = "Option::is_none")]
1587    pub pid: Option<i64>,
1588
1589    /// The last exit code of this container
1590    #[serde(rename = "ExitCode")]
1591    #[serde(skip_serializing_if = "Option::is_none")]
1592    pub exit_code: Option<i64>,
1593
1594    #[serde(rename = "Error")]
1595    #[serde(skip_serializing_if = "Option::is_none")]
1596    pub error: Option<String>,
1597
1598    /// The time when this container was last started.
1599    #[serde(rename = "StartedAt")]
1600    #[serde(skip_serializing_if = "Option::is_none")]
1601    pub started_at: Option<String>,
1602
1603    /// The time when this container last exited.
1604    #[serde(rename = "FinishedAt")]
1605    #[serde(skip_serializing_if = "Option::is_none")]
1606    pub finished_at: Option<String>,
1607
1608    #[serde(rename = "Health")]
1609    #[serde(skip_serializing_if = "Option::is_none")]
1610    pub health: Option<Health>,
1611
1612}
1613
1614#[allow(non_camel_case_types)]
1615#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
1616pub enum ContainerStateStatusEnum { 
1617    #[serde(rename = "")]
1618    EMPTY,
1619    #[serde(rename = "created")]
1620    CREATED,
1621    #[serde(rename = "running")]
1622    RUNNING,
1623    #[serde(rename = "paused")]
1624    PAUSED,
1625    #[serde(rename = "restarting")]
1626    RESTARTING,
1627    #[serde(rename = "removing")]
1628    REMOVING,
1629    #[serde(rename = "exited")]
1630    EXITED,
1631    #[serde(rename = "dead")]
1632    DEAD,
1633}
1634
1635impl ::std::fmt::Display for ContainerStateStatusEnum {
1636    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
1637        match *self { 
1638            ContainerStateStatusEnum::EMPTY => write!(f, ""),
1639            ContainerStateStatusEnum::CREATED => write!(f, "{}", "created"),
1640            ContainerStateStatusEnum::RUNNING => write!(f, "{}", "running"),
1641            ContainerStateStatusEnum::PAUSED => write!(f, "{}", "paused"),
1642            ContainerStateStatusEnum::RESTARTING => write!(f, "{}", "restarting"),
1643            ContainerStateStatusEnum::REMOVING => write!(f, "{}", "removing"),
1644            ContainerStateStatusEnum::EXITED => write!(f, "{}", "exited"),
1645            ContainerStateStatusEnum::DEAD => write!(f, "{}", "dead"),
1646
1647        }
1648    }
1649}
1650
1651impl ::std::str::FromStr for ContainerStateStatusEnum {
1652    type Err = String;
1653    fn from_str(s: &str) -> Result<Self, Self::Err> {
1654        match s { 
1655            "" => Ok(ContainerStateStatusEnum::EMPTY),
1656            "created" => Ok(ContainerStateStatusEnum::CREATED),
1657            "running" => Ok(ContainerStateStatusEnum::RUNNING),
1658            "paused" => Ok(ContainerStateStatusEnum::PAUSED),
1659            "restarting" => Ok(ContainerStateStatusEnum::RESTARTING),
1660            "removing" => Ok(ContainerStateStatusEnum::REMOVING),
1661            "exited" => Ok(ContainerStateStatusEnum::EXITED),
1662            "dead" => Ok(ContainerStateStatusEnum::DEAD),
1663            x => Err(format!("Invalid enum type: {}", x)),
1664        }
1665    }
1666}
1667
1668impl ::std::convert::AsRef<str> for ContainerStateStatusEnum {
1669    fn as_ref(&self) -> &str {
1670        match self { 
1671            ContainerStateStatusEnum::EMPTY => "",
1672            ContainerStateStatusEnum::CREATED => "created",
1673            ContainerStateStatusEnum::RUNNING => "running",
1674            ContainerStateStatusEnum::PAUSED => "paused",
1675            ContainerStateStatusEnum::RESTARTING => "restarting",
1676            ContainerStateStatusEnum::REMOVING => "removing",
1677            ContainerStateStatusEnum::EXITED => "exited",
1678            ContainerStateStatusEnum::DEAD => "dead",
1679        }
1680    }
1681}
1682
1683/// Statistics sample for a container. 
1684#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1685pub struct ContainerStatsResponse {
1686    /// Name of the container
1687    #[serde(rename = "name")]
1688    #[serde(skip_serializing_if = "Option::is_none")]
1689    pub name: Option<String>,
1690
1691    /// ID of the container
1692    #[serde(rename = "id")]
1693    #[serde(skip_serializing_if = "Option::is_none")]
1694    pub id: Option<String>,
1695
1696    /// Date and time at which this sample was collected. The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) with nano-seconds. 
1697    #[serde(rename = "read")]
1698    #[serde(skip_serializing_if = "Option::is_none")]
1699    #[serde(
1700        default,
1701        deserialize_with = "deserialize_timestamp",
1702        serialize_with = "serialize_timestamp"
1703    )]
1704    pub read: Option<BollardDate>,
1705
1706    /// Date and time at which this first sample was collected. This field is not propagated if the \"one-shot\" option is set. If the \"one-shot\" option is set, this field may be omitted, empty, or set to a default date (`0001-01-01T00:00:00Z`).  The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) with nano-seconds. 
1707    #[serde(rename = "preread")]
1708    #[serde(skip_serializing_if = "Option::is_none")]
1709    #[serde(
1710        default,
1711        deserialize_with = "deserialize_timestamp",
1712        serialize_with = "serialize_timestamp"
1713    )]
1714    pub preread: Option<BollardDate>,
1715
1716    #[serde(rename = "pids_stats")]
1717    #[serde(skip_serializing_if = "Option::is_none")]
1718    pub pids_stats: Option<ContainerPidsStats>,
1719
1720    #[serde(rename = "blkio_stats")]
1721    #[serde(skip_serializing_if = "Option::is_none")]
1722    pub blkio_stats: Option<ContainerBlkioStats>,
1723
1724    /// The number of processors on the system.  This field is Windows-specific and always zero for Linux containers. 
1725    #[serde(rename = "num_procs")]
1726    #[serde(skip_serializing_if = "Option::is_none")]
1727    pub num_procs: Option<u32>,
1728
1729    #[serde(rename = "storage_stats")]
1730    #[serde(skip_serializing_if = "Option::is_none")]
1731    pub storage_stats: Option<ContainerStorageStats>,
1732
1733    #[serde(rename = "cpu_stats")]
1734    #[serde(skip_serializing_if = "Option::is_none")]
1735    pub cpu_stats: Option<ContainerCpuStats>,
1736
1737    #[serde(rename = "precpu_stats")]
1738    #[serde(skip_serializing_if = "Option::is_none")]
1739    pub precpu_stats: Option<ContainerCpuStats>,
1740
1741    #[serde(rename = "memory_stats")]
1742    #[serde(skip_serializing_if = "Option::is_none")]
1743    pub memory_stats: Option<ContainerMemoryStats>,
1744
1745    /// Network statistics for the container per interface.  This field is omitted if the container has no networking enabled. 
1746    #[serde(rename = "networks")]
1747    #[serde(skip_serializing_if = "Option::is_none")]
1748    pub networks: Option<ContainerNetworkStats>,
1749
1750}
1751
1752/// represents the status of a container.
1753#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1754pub struct ContainerStatus {
1755    #[serde(rename = "ContainerID")]
1756    #[serde(skip_serializing_if = "Option::is_none")]
1757    pub container_id: Option<String>,
1758
1759    #[serde(rename = "PID")]
1760    #[serde(skip_serializing_if = "Option::is_none")]
1761    pub pid: Option<i64>,
1762
1763    #[serde(rename = "ExitCode")]
1764    #[serde(skip_serializing_if = "Option::is_none")]
1765    pub exit_code: Option<i64>,
1766
1767}
1768
1769/// StorageStats is the disk I/O stats for read/write on Windows.  This type is Windows-specific and omitted for Linux containers. 
1770#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1771pub struct ContainerStorageStats {
1772    #[serde(rename = "read_count_normalized")]
1773    #[serde(skip_serializing_if = "Option::is_none")]
1774    pub read_count_normalized: Option<u64>,
1775
1776    #[serde(rename = "read_size_bytes")]
1777    #[serde(skip_serializing_if = "Option::is_none")]
1778    pub read_size_bytes: Option<u64>,
1779
1780    #[serde(rename = "write_count_normalized")]
1781    #[serde(skip_serializing_if = "Option::is_none")]
1782    pub write_count_normalized: Option<u64>,
1783
1784    #[serde(rename = "write_size_bytes")]
1785    #[serde(skip_serializing_if = "Option::is_none")]
1786    pub write_size_bytes: Option<u64>,
1787
1788}
1789
1790#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1791pub struct ContainerSummary {
1792    /// The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes).
1793    #[serde(rename = "Id")]
1794    #[serde(skip_serializing_if = "Option::is_none")]
1795    pub id: Option<String>,
1796
1797    /// The names associated with this container. Most containers have a single name, but when using legacy \"links\", the container can have multiple names.  For historic reasons, names are prefixed with a forward-slash (`/`).
1798    #[serde(rename = "Names")]
1799    #[serde(skip_serializing_if = "Option::is_none")]
1800    pub names: Option<Vec<String>>,
1801
1802    /// The name or ID of the image used to create the container.  This field shows the image reference as was specified when creating the container, which can be in its canonical form (e.g., `docker.io/library/ubuntu:latest` or `docker.io/library/ubuntu@sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`), short form (e.g., `ubuntu:latest`)), or the ID(-prefix) of the image (e.g., `72297848456d`).  The content of this field can be updated at runtime if the image used to create the container is untagged, in which case the field is updated to contain the the image ID (digest) it was resolved to in its canonical, non-truncated form (e.g., `sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`).
1803    #[serde(rename = "Image")]
1804    #[serde(skip_serializing_if = "Option::is_none")]
1805    pub image: Option<String>,
1806
1807    /// The ID (digest) of the image that this container was created from.
1808    #[serde(rename = "ImageID")]
1809    #[serde(skip_serializing_if = "Option::is_none")]
1810    pub image_id: Option<String>,
1811
1812    /// OCI descriptor of the platform-specific manifest of the image the container was created from.  Note: Only available if the daemon provides a multi-platform image store.  This field is not populated in the `GET /system/df` endpoint. 
1813    #[serde(rename = "ImageManifestDescriptor")]
1814    #[serde(skip_serializing_if = "Option::is_none")]
1815    pub image_manifest_descriptor: Option<OciDescriptor>,
1816
1817    /// Command to run when starting the container
1818    #[serde(rename = "Command")]
1819    #[serde(skip_serializing_if = "Option::is_none")]
1820    pub command: Option<String>,
1821
1822    /// Date and time at which the container was created as a Unix timestamp (number of seconds since EPOCH).
1823    #[serde(rename = "Created")]
1824    #[serde(skip_serializing_if = "Option::is_none")]
1825    pub created: Option<i64>,
1826
1827    /// Port-mappings for the container.
1828    #[serde(rename = "Ports")]
1829    #[serde(skip_serializing_if = "Option::is_none")]
1830    pub ports: Option<Vec<Port>>,
1831
1832    /// The size of files that have been created or changed by this container.  This field is omitted by default, and only set when size is requested in the API request.
1833    #[serde(rename = "SizeRw")]
1834    #[serde(skip_serializing_if = "Option::is_none")]
1835    pub size_rw: Option<i64>,
1836
1837    /// The total size of all files in the read-only layers from the image that the container uses. These layers can be shared between containers.  This field is omitted by default, and only set when size is requested in the API request.
1838    #[serde(rename = "SizeRootFs")]
1839    #[serde(skip_serializing_if = "Option::is_none")]
1840    pub size_root_fs: Option<i64>,
1841
1842    /// User-defined key/value metadata.
1843    #[serde(rename = "Labels")]
1844    #[serde(skip_serializing_if = "Option::is_none")]
1845    pub labels: Option<HashMap<String, String>>,
1846
1847    /// The state of this container. 
1848    #[serde(rename = "State")]
1849    #[serde(skip_serializing_if = "Option::is_none")]
1850    pub state: Option<ContainerSummaryStateEnum>,
1851
1852    /// Additional human-readable status of this container (e.g. `Exit 0`)
1853    #[serde(rename = "Status")]
1854    #[serde(skip_serializing_if = "Option::is_none")]
1855    pub status: Option<String>,
1856
1857    #[serde(rename = "HostConfig")]
1858    #[serde(skip_serializing_if = "Option::is_none")]
1859    pub host_config: Option<ContainerSummaryHostConfig>,
1860
1861    #[serde(rename = "NetworkSettings")]
1862    #[serde(skip_serializing_if = "Option::is_none")]
1863    pub network_settings: Option<ContainerSummaryNetworkSettings>,
1864
1865    /// List of mounts used by the container.
1866    #[serde(rename = "Mounts")]
1867    #[serde(skip_serializing_if = "Option::is_none")]
1868    pub mounts: Option<Vec<MountPoint>>,
1869
1870}
1871
1872#[allow(non_camel_case_types)]
1873#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
1874pub enum ContainerSummaryStateEnum { 
1875    #[serde(rename = "")]
1876    EMPTY,
1877    #[serde(rename = "created")]
1878    CREATED,
1879    #[serde(rename = "running")]
1880    RUNNING,
1881    #[serde(rename = "paused")]
1882    PAUSED,
1883    #[serde(rename = "restarting")]
1884    RESTARTING,
1885    #[serde(rename = "exited")]
1886    EXITED,
1887    #[serde(rename = "removing")]
1888    REMOVING,
1889    #[serde(rename = "dead")]
1890    DEAD,
1891}
1892
1893impl ::std::fmt::Display for ContainerSummaryStateEnum {
1894    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
1895        match *self { 
1896            ContainerSummaryStateEnum::EMPTY => write!(f, ""),
1897            ContainerSummaryStateEnum::CREATED => write!(f, "{}", "created"),
1898            ContainerSummaryStateEnum::RUNNING => write!(f, "{}", "running"),
1899            ContainerSummaryStateEnum::PAUSED => write!(f, "{}", "paused"),
1900            ContainerSummaryStateEnum::RESTARTING => write!(f, "{}", "restarting"),
1901            ContainerSummaryStateEnum::EXITED => write!(f, "{}", "exited"),
1902            ContainerSummaryStateEnum::REMOVING => write!(f, "{}", "removing"),
1903            ContainerSummaryStateEnum::DEAD => write!(f, "{}", "dead"),
1904
1905        }
1906    }
1907}
1908
1909impl ::std::str::FromStr for ContainerSummaryStateEnum {
1910    type Err = String;
1911    fn from_str(s: &str) -> Result<Self, Self::Err> {
1912        match s { 
1913            "" => Ok(ContainerSummaryStateEnum::EMPTY),
1914            "created" => Ok(ContainerSummaryStateEnum::CREATED),
1915            "running" => Ok(ContainerSummaryStateEnum::RUNNING),
1916            "paused" => Ok(ContainerSummaryStateEnum::PAUSED),
1917            "restarting" => Ok(ContainerSummaryStateEnum::RESTARTING),
1918            "exited" => Ok(ContainerSummaryStateEnum::EXITED),
1919            "removing" => Ok(ContainerSummaryStateEnum::REMOVING),
1920            "dead" => Ok(ContainerSummaryStateEnum::DEAD),
1921            x => Err(format!("Invalid enum type: {}", x)),
1922        }
1923    }
1924}
1925
1926impl ::std::convert::AsRef<str> for ContainerSummaryStateEnum {
1927    fn as_ref(&self) -> &str {
1928        match self { 
1929            ContainerSummaryStateEnum::EMPTY => "",
1930            ContainerSummaryStateEnum::CREATED => "created",
1931            ContainerSummaryStateEnum::RUNNING => "running",
1932            ContainerSummaryStateEnum::PAUSED => "paused",
1933            ContainerSummaryStateEnum::RESTARTING => "restarting",
1934            ContainerSummaryStateEnum::EXITED => "exited",
1935            ContainerSummaryStateEnum::REMOVING => "removing",
1936            ContainerSummaryStateEnum::DEAD => "dead",
1937        }
1938    }
1939}
1940
1941/// Summary of host-specific runtime information of the container. This is a reduced set of information in the container's \"HostConfig\" as available in the container \"inspect\" response.
1942#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1943pub struct ContainerSummaryHostConfig {
1944    /// Networking mode (`host`, `none`, `container:<id>`) or name of the primary network the container is using.  This field is primarily for backward compatibility. The container can be connected to multiple networks for which information can be found in the `NetworkSettings.Networks` field, which enumerates settings per network.
1945    #[serde(rename = "NetworkMode")]
1946    #[serde(skip_serializing_if = "Option::is_none")]
1947    pub network_mode: Option<String>,
1948
1949    /// Arbitrary key-value metadata attached to the container.
1950    #[serde(rename = "Annotations")]
1951    #[serde(skip_serializing_if = "Option::is_none")]
1952    pub annotations: Option<HashMap<String, String>>,
1953
1954}
1955
1956/// Summary of the container's network settings
1957#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1958pub struct ContainerSummaryNetworkSettings {
1959    /// Summary of network-settings for each network the container is attached to.
1960    #[serde(rename = "Networks")]
1961    #[serde(skip_serializing_if = "Option::is_none")]
1962    pub networks: Option<HashMap<String, EndpointSettings>>,
1963
1964}
1965
1966/// CPU throttling stats of the container.  This type is Linux-specific and omitted for Windows containers. 
1967#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1968pub struct ContainerThrottlingData {
1969    /// Number of periods with throttling active. 
1970    #[serde(rename = "periods")]
1971    #[serde(skip_serializing_if = "Option::is_none")]
1972    pub periods: Option<u64>,
1973
1974    /// Number of periods when the container hit its throttling limit. 
1975    #[serde(rename = "throttled_periods")]
1976    #[serde(skip_serializing_if = "Option::is_none")]
1977    pub throttled_periods: Option<u64>,
1978
1979    /// Aggregated time (in nanoseconds) the container was throttled for. 
1980    #[serde(rename = "throttled_time")]
1981    #[serde(skip_serializing_if = "Option::is_none")]
1982    pub throttled_time: Option<u64>,
1983
1984}
1985
1986/// Container \"top\" response.
1987#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1988pub struct ContainerTopResponse {
1989    /// The ps column titles
1990    #[serde(rename = "Titles")]
1991    #[serde(skip_serializing_if = "Option::is_none")]
1992    pub titles: Option<Vec<String>>,
1993
1994    /// Each process running in the container, where each process is an array of values corresponding to the titles.
1995    #[serde(rename = "Processes")]
1996    #[serde(skip_serializing_if = "Option::is_none")]
1997    pub processes: Option<Vec<Vec<String>>>,
1998
1999}
2000
2001#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2002pub struct ContainerUpdateBody {
2003    /// An integer value representing this container's relative CPU weight versus other containers. 
2004    #[serde(rename = "CpuShares")]
2005    #[serde(skip_serializing_if = "Option::is_none")]
2006    pub cpu_shares: Option<i64>,
2007
2008    /// Memory limit in bytes.
2009    #[serde(rename = "Memory")]
2010    #[serde(skip_serializing_if = "Option::is_none")]
2011    pub memory: Option<i64>,
2012
2013    /// 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. 
2014    #[serde(rename = "CgroupParent")]
2015    #[serde(skip_serializing_if = "Option::is_none")]
2016    pub cgroup_parent: Option<String>,
2017
2018    /// Block IO weight (relative weight).
2019    #[serde(rename = "BlkioWeight")]
2020    #[serde(skip_serializing_if = "Option::is_none")]
2021    pub blkio_weight: Option<u16>,
2022
2023    /// Block IO weight (relative device weight) in the form:  ``` [{\"Path\": \"device_path\", \"Weight\": weight}] ``` 
2024    #[serde(rename = "BlkioWeightDevice")]
2025    #[serde(skip_serializing_if = "Option::is_none")]
2026    pub blkio_weight_device: Option<Vec<ResourcesBlkioWeightDevice>>,
2027
2028    /// Limit read rate (bytes per second) from a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
2029    #[serde(rename = "BlkioDeviceReadBps")]
2030    #[serde(skip_serializing_if = "Option::is_none")]
2031    pub blkio_device_read_bps: Option<Vec<ThrottleDevice>>,
2032
2033    /// Limit write rate (bytes per second) to a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
2034    #[serde(rename = "BlkioDeviceWriteBps")]
2035    #[serde(skip_serializing_if = "Option::is_none")]
2036    pub blkio_device_write_bps: Option<Vec<ThrottleDevice>>,
2037
2038    /// Limit read rate (IO per second) from a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
2039    #[serde(rename = "BlkioDeviceReadIOps")]
2040    #[serde(skip_serializing_if = "Option::is_none")]
2041    pub blkio_device_read_iops: Option<Vec<ThrottleDevice>>,
2042
2043    /// Limit write rate (IO per second) to a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
2044    #[serde(rename = "BlkioDeviceWriteIOps")]
2045    #[serde(skip_serializing_if = "Option::is_none")]
2046    pub blkio_device_write_iops: Option<Vec<ThrottleDevice>>,
2047
2048    /// The length of a CPU period in microseconds.
2049    #[serde(rename = "CpuPeriod")]
2050    #[serde(skip_serializing_if = "Option::is_none")]
2051    pub cpu_period: Option<i64>,
2052
2053    /// Microseconds of CPU time that the container can get in a CPU period. 
2054    #[serde(rename = "CpuQuota")]
2055    #[serde(skip_serializing_if = "Option::is_none")]
2056    pub cpu_quota: Option<i64>,
2057
2058    /// The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. 
2059    #[serde(rename = "CpuRealtimePeriod")]
2060    #[serde(skip_serializing_if = "Option::is_none")]
2061    pub cpu_realtime_period: Option<i64>,
2062
2063    /// The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. 
2064    #[serde(rename = "CpuRealtimeRuntime")]
2065    #[serde(skip_serializing_if = "Option::is_none")]
2066    pub cpu_realtime_runtime: Option<i64>,
2067
2068    /// CPUs in which to allow execution (e.g., `0-3`, `0,1`). 
2069    #[serde(rename = "CpusetCpus")]
2070    #[serde(skip_serializing_if = "Option::is_none")]
2071    pub cpuset_cpus: Option<String>,
2072
2073    /// Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. 
2074    #[serde(rename = "CpusetMems")]
2075    #[serde(skip_serializing_if = "Option::is_none")]
2076    pub cpuset_mems: Option<String>,
2077
2078    /// A list of devices to add to the container.
2079    #[serde(rename = "Devices")]
2080    #[serde(skip_serializing_if = "Option::is_none")]
2081    pub devices: Option<Vec<DeviceMapping>>,
2082
2083    /// a list of cgroup rules to apply to the container
2084    #[serde(rename = "DeviceCgroupRules")]
2085    #[serde(skip_serializing_if = "Option::is_none")]
2086    pub device_cgroup_rules: Option<Vec<String>>,
2087
2088    /// A list of requests for devices to be sent to device drivers. 
2089    #[serde(rename = "DeviceRequests")]
2090    #[serde(skip_serializing_if = "Option::is_none")]
2091    pub device_requests: Option<Vec<DeviceRequest>>,
2092
2093    /// Hard limit for kernel TCP buffer memory (in bytes). Depending on the OCI runtime in use, this option may be ignored. It is no longer supported by the default (runc) runtime.  This field is omitted when empty. 
2094    #[serde(rename = "KernelMemoryTCP")]
2095    #[serde(skip_serializing_if = "Option::is_none")]
2096    pub kernel_memory_tcp: Option<i64>,
2097
2098    /// Memory soft limit in bytes.
2099    #[serde(rename = "MemoryReservation")]
2100    #[serde(skip_serializing_if = "Option::is_none")]
2101    pub memory_reservation: Option<i64>,
2102
2103    /// Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. 
2104    #[serde(rename = "MemorySwap")]
2105    #[serde(skip_serializing_if = "Option::is_none")]
2106    pub memory_swap: Option<i64>,
2107
2108    /// Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. 
2109    #[serde(rename = "MemorySwappiness")]
2110    #[serde(skip_serializing_if = "Option::is_none")]
2111    pub memory_swappiness: Option<i64>,
2112
2113    /// CPU quota in units of 10<sup>-9</sup> CPUs.
2114    #[serde(rename = "NanoCpus")]
2115    #[serde(skip_serializing_if = "Option::is_none")]
2116    pub nano_cpus: Option<i64>,
2117
2118    /// Disable OOM Killer for the container.
2119    #[serde(rename = "OomKillDisable")]
2120    #[serde(skip_serializing_if = "Option::is_none")]
2121    pub oom_kill_disable: Option<bool>,
2122
2123    /// 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. 
2124    #[serde(rename = "Init")]
2125    #[serde(skip_serializing_if = "Option::is_none")]
2126    pub init: Option<bool>,
2127
2128    /// Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` to not change. 
2129    #[serde(rename = "PidsLimit")]
2130    #[serde(skip_serializing_if = "Option::is_none")]
2131    pub pids_limit: Option<i64>,
2132
2133    /// A list of resource limits to set in the container. For example:  ``` {\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048} ``` 
2134    #[serde(rename = "Ulimits")]
2135    #[serde(skip_serializing_if = "Option::is_none")]
2136    pub ulimits: Option<Vec<ResourcesUlimits>>,
2137
2138    /// 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. 
2139    #[serde(rename = "CpuCount")]
2140    #[serde(skip_serializing_if = "Option::is_none")]
2141    pub cpu_count: Option<i64>,
2142
2143    /// 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. 
2144    #[serde(rename = "CpuPercent")]
2145    #[serde(skip_serializing_if = "Option::is_none")]
2146    pub cpu_percent: Option<i64>,
2147
2148    /// Maximum IOps for the container system drive (Windows only)
2149    #[serde(rename = "IOMaximumIOps")]
2150    #[serde(skip_serializing_if = "Option::is_none")]
2151    pub io_maximum_iops: Option<i64>,
2152
2153    /// Maximum IO in bytes per second for the container system drive (Windows only). 
2154    #[serde(rename = "IOMaximumBandwidth")]
2155    #[serde(skip_serializing_if = "Option::is_none")]
2156    pub io_maximum_bandwidth: Option<i64>,
2157
2158    #[serde(rename = "RestartPolicy")]
2159    #[serde(skip_serializing_if = "Option::is_none")]
2160    pub restart_policy: Option<RestartPolicy>,
2161
2162}
2163
2164/// Response for a successful container-update.
2165#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2166pub struct ContainerUpdateResponse {
2167    /// Warnings encountered when updating the container.
2168    #[serde(rename = "Warnings")]
2169    #[serde(skip_serializing_if = "Option::is_none")]
2170    pub warnings: Option<Vec<String>>,
2171
2172}
2173
2174/// container waiting error, if any
2175#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2176pub struct ContainerWaitExitError {
2177    /// Details of an error
2178    #[serde(rename = "Message")]
2179    #[serde(skip_serializing_if = "Option::is_none")]
2180    pub message: Option<String>,
2181
2182}
2183
2184/// OK response to ContainerWait operation
2185#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2186pub struct ContainerWaitResponse {
2187    /// Exit code of the container
2188    #[serde(rename = "StatusCode")]
2189    pub status_code: i64,
2190
2191    #[serde(rename = "Error")]
2192    #[serde(skip_serializing_if = "Option::is_none")]
2193    pub error: Option<ContainerWaitExitError>,
2194
2195}
2196
2197/// Information for connecting to the containerd instance that is used by the daemon. This is included for debugging purposes only. 
2198#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2199pub struct ContainerdInfo {
2200    /// The address of the containerd socket.
2201    #[serde(rename = "Address")]
2202    #[serde(skip_serializing_if = "Option::is_none")]
2203    pub address: Option<String>,
2204
2205    #[serde(rename = "Namespaces")]
2206    #[serde(skip_serializing_if = "Option::is_none")]
2207    pub namespaces: Option<ContainerdInfoNamespaces>,
2208
2209}
2210
2211/// The namespaces that the daemon uses for running containers and plugins in containerd. These namespaces can be configured in the daemon configuration, and are considered to be used exclusively by the daemon, Tampering with the containerd instance may cause unexpected behavior.  As these namespaces are considered to be exclusively accessed by the daemon, it is not recommended to change these values, or to change them to a value that is used by other systems, such as cri-containerd. 
2212#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2213pub struct ContainerdInfoNamespaces {
2214    /// The default containerd namespace used for containers managed by the daemon.  The default namespace for containers is \"moby\", but will be suffixed with the `<uid>.<gid>` of the remapped `root` if user-namespaces are enabled and the containerd image-store is used. 
2215    #[serde(rename = "Containers")]
2216    #[serde(skip_serializing_if = "Option::is_none")]
2217    pub containers: Option<String>,
2218
2219    /// The default containerd namespace used for plugins managed by the daemon.  The default namespace for plugins is \"plugins.moby\", but will be suffixed with the `<uid>.<gid>` of the remapped `root` if user-namespaces are enabled and the containerd image-store is used. 
2220    #[serde(rename = "Plugins")]
2221    #[serde(skip_serializing_if = "Option::is_none")]
2222    pub plugins: Option<String>,
2223
2224}
2225
2226#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2227pub struct CreateImageInfo {
2228    #[serde(rename = "id")]
2229    #[serde(skip_serializing_if = "Option::is_none")]
2230    pub id: Option<String>,
2231
2232    /// errors encountered during the operation.   > **Deprecated**: This field is deprecated since API v1.4, and will be omitted in a future API version. Use the information in errorDetail instead.
2233    #[serde(rename = "error")]
2234    #[serde(skip_serializing_if = "Option::is_none")]
2235    pub error: Option<String>,
2236
2237    #[serde(rename = "errorDetail")]
2238    #[serde(skip_serializing_if = "Option::is_none")]
2239    pub error_detail: Option<ErrorDetail>,
2240
2241    #[serde(rename = "status")]
2242    #[serde(skip_serializing_if = "Option::is_none")]
2243    pub status: Option<String>,
2244
2245    /// Progress is a pre-formatted presentation of progressDetail.   > **Deprecated**: This field is deprecated since API v1.8, and will be omitted in a future API version. Use the information in progressDetail instead.
2246    #[serde(rename = "progress")]
2247    #[serde(skip_serializing_if = "Option::is_none")]
2248    pub progress: Option<String>,
2249
2250    #[serde(rename = "progressDetail")]
2251    #[serde(skip_serializing_if = "Option::is_none")]
2252    pub progress_detail: Option<ProgressDetail>,
2253
2254}
2255
2256/// A device mapping between the host and container
2257#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2258pub struct DeviceMapping {
2259    #[serde(rename = "PathOnHost")]
2260    #[serde(skip_serializing_if = "Option::is_none")]
2261    pub path_on_host: Option<String>,
2262
2263    #[serde(rename = "PathInContainer")]
2264    #[serde(skip_serializing_if = "Option::is_none")]
2265    pub path_in_container: Option<String>,
2266
2267    #[serde(rename = "CgroupPermissions")]
2268    #[serde(skip_serializing_if = "Option::is_none")]
2269    pub cgroup_permissions: Option<String>,
2270
2271}
2272
2273/// A request for devices to be sent to device drivers
2274#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2275pub struct DeviceRequest {
2276    #[serde(rename = "Driver")]
2277    #[serde(skip_serializing_if = "Option::is_none")]
2278    pub driver: Option<String>,
2279
2280    #[serde(rename = "Count")]
2281    #[serde(skip_serializing_if = "Option::is_none")]
2282    pub count: Option<i64>,
2283
2284    #[serde(rename = "DeviceIDs")]
2285    #[serde(skip_serializing_if = "Option::is_none")]
2286    pub device_ids: Option<Vec<String>>,
2287
2288    /// A list of capabilities; an OR list of AND lists of capabilities. 
2289    #[serde(rename = "Capabilities")]
2290    #[serde(skip_serializing_if = "Option::is_none")]
2291    pub capabilities: Option<Vec<Vec<String>>>,
2292
2293    /// Driver-specific options, specified as a key/value pairs. These options are passed directly to the driver. 
2294    #[serde(rename = "Options")]
2295    #[serde(skip_serializing_if = "Option::is_none")]
2296    pub options: Option<HashMap<String, String>>,
2297
2298}
2299
2300/// Describes the result obtained from contacting the registry to retrieve image metadata. 
2301#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2302pub struct DistributionInspect {
2303    #[serde(rename = "Descriptor")]
2304    pub descriptor: OciDescriptor,
2305
2306    /// An array containing all platforms supported by the image. 
2307    #[serde(rename = "Platforms")]
2308    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
2309    pub platforms: Vec<OciPlatform>,
2310
2311}
2312
2313/// Driver represents a driver (network, logging, secrets).
2314#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2315pub struct Driver {
2316    /// Name of the driver.
2317    #[serde(rename = "Name")]
2318    pub name: String,
2319
2320    /// Key/value map of driver-specific options.
2321    #[serde(rename = "Options")]
2322    #[serde(skip_serializing_if = "Option::is_none")]
2323    pub options: Option<HashMap<String, String>>,
2324
2325}
2326
2327/// Information about the storage driver used to store the container's and image's filesystem. 
2328#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2329pub struct DriverData {
2330    /// Name of the storage driver.
2331    #[serde(rename = "Name")]
2332    pub name: String,
2333
2334    /// Low-level storage metadata, provided as key/value pairs.  This information is driver-specific, and depends on the storage-driver in use, and should be used for informational purposes only. 
2335    #[serde(rename = "Data")]
2336    #[serde(deserialize_with = "deserialize_nonoptional_map")]
2337    pub data: HashMap<String, String>,
2338
2339}
2340
2341/// EndpointIPAMConfig represents an endpoint's IPAM configuration. 
2342#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2343pub struct EndpointIpamConfig {
2344    #[serde(rename = "IPv4Address")]
2345    #[serde(skip_serializing_if = "Option::is_none")]
2346    pub ipv4_address: Option<String>,
2347
2348    #[serde(rename = "IPv6Address")]
2349    #[serde(skip_serializing_if = "Option::is_none")]
2350    pub ipv6_address: Option<String>,
2351
2352    #[serde(rename = "LinkLocalIPs")]
2353    #[serde(skip_serializing_if = "Option::is_none")]
2354    pub link_local_ips: Option<Vec<String>>,
2355
2356}
2357
2358#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2359pub struct EndpointPortConfig {
2360    #[serde(rename = "Name")]
2361    #[serde(skip_serializing_if = "Option::is_none")]
2362    pub name: Option<String>,
2363
2364    #[serde(rename = "Protocol")]
2365    #[serde(skip_serializing_if = "Option::is_none")]
2366    pub protocol: Option<EndpointPortConfigProtocolEnum>,
2367
2368    /// The port inside the container.
2369    #[serde(rename = "TargetPort")]
2370    #[serde(skip_serializing_if = "Option::is_none")]
2371    pub target_port: Option<i64>,
2372
2373    /// The port on the swarm hosts.
2374    #[serde(rename = "PublishedPort")]
2375    #[serde(skip_serializing_if = "Option::is_none")]
2376    pub published_port: Option<i64>,
2377
2378    /// 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. 
2379    #[serde(rename = "PublishMode")]
2380    #[serde(skip_serializing_if = "Option::is_none")]
2381    pub publish_mode: Option<EndpointPortConfigPublishModeEnum>,
2382
2383}
2384
2385#[allow(non_camel_case_types)]
2386#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
2387pub enum EndpointPortConfigProtocolEnum { 
2388    #[serde(rename = "")]
2389    EMPTY,
2390    #[serde(rename = "tcp")]
2391    TCP,
2392    #[serde(rename = "udp")]
2393    UDP,
2394    #[serde(rename = "sctp")]
2395    SCTP,
2396}
2397
2398impl ::std::fmt::Display for EndpointPortConfigProtocolEnum {
2399    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
2400        match *self { 
2401            EndpointPortConfigProtocolEnum::EMPTY => write!(f, ""),
2402            EndpointPortConfigProtocolEnum::TCP => write!(f, "{}", "tcp"),
2403            EndpointPortConfigProtocolEnum::UDP => write!(f, "{}", "udp"),
2404            EndpointPortConfigProtocolEnum::SCTP => write!(f, "{}", "sctp"),
2405
2406        }
2407    }
2408}
2409
2410impl ::std::str::FromStr for EndpointPortConfigProtocolEnum {
2411    type Err = String;
2412    fn from_str(s: &str) -> Result<Self, Self::Err> {
2413        match s { 
2414            "" => Ok(EndpointPortConfigProtocolEnum::EMPTY),
2415            "tcp" => Ok(EndpointPortConfigProtocolEnum::TCP),
2416            "udp" => Ok(EndpointPortConfigProtocolEnum::UDP),
2417            "sctp" => Ok(EndpointPortConfigProtocolEnum::SCTP),
2418            x => Err(format!("Invalid enum type: {}", x)),
2419        }
2420    }
2421}
2422
2423impl ::std::convert::AsRef<str> for EndpointPortConfigProtocolEnum {
2424    fn as_ref(&self) -> &str {
2425        match self { 
2426            EndpointPortConfigProtocolEnum::EMPTY => "",
2427            EndpointPortConfigProtocolEnum::TCP => "tcp",
2428            EndpointPortConfigProtocolEnum::UDP => "udp",
2429            EndpointPortConfigProtocolEnum::SCTP => "sctp",
2430        }
2431    }
2432}
2433
2434#[allow(non_camel_case_types)]
2435#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
2436pub enum EndpointPortConfigPublishModeEnum { 
2437    #[serde(rename = "")]
2438    EMPTY,
2439    #[serde(rename = "ingress")]
2440    INGRESS,
2441    #[serde(rename = "host")]
2442    HOST,
2443}
2444
2445impl ::std::fmt::Display for EndpointPortConfigPublishModeEnum {
2446    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
2447        match *self { 
2448            EndpointPortConfigPublishModeEnum::EMPTY => write!(f, ""),
2449            EndpointPortConfigPublishModeEnum::INGRESS => write!(f, "{}", "ingress"),
2450            EndpointPortConfigPublishModeEnum::HOST => write!(f, "{}", "host"),
2451
2452        }
2453    }
2454}
2455
2456impl ::std::str::FromStr for EndpointPortConfigPublishModeEnum {
2457    type Err = String;
2458    fn from_str(s: &str) -> Result<Self, Self::Err> {
2459        match s { 
2460            "" => Ok(EndpointPortConfigPublishModeEnum::EMPTY),
2461            "ingress" => Ok(EndpointPortConfigPublishModeEnum::INGRESS),
2462            "host" => Ok(EndpointPortConfigPublishModeEnum::HOST),
2463            x => Err(format!("Invalid enum type: {}", x)),
2464        }
2465    }
2466}
2467
2468impl ::std::convert::AsRef<str> for EndpointPortConfigPublishModeEnum {
2469    fn as_ref(&self) -> &str {
2470        match self { 
2471            EndpointPortConfigPublishModeEnum::EMPTY => "",
2472            EndpointPortConfigPublishModeEnum::INGRESS => "ingress",
2473            EndpointPortConfigPublishModeEnum::HOST => "host",
2474        }
2475    }
2476}
2477
2478/// Configuration for a network endpoint.
2479#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2480pub struct EndpointSettings {
2481    #[serde(rename = "IPAMConfig")]
2482    #[serde(skip_serializing_if = "Option::is_none")]
2483    pub ipam_config: Option<EndpointIpamConfig>,
2484
2485    #[serde(rename = "Links")]
2486    #[serde(skip_serializing_if = "Option::is_none")]
2487    pub links: Option<Vec<String>>,
2488
2489    /// MAC address for the endpoint on this network. The network driver might ignore this parameter. 
2490    #[serde(rename = "MacAddress")]
2491    #[serde(skip_serializing_if = "Option::is_none")]
2492    pub mac_address: Option<String>,
2493
2494    #[serde(rename = "Aliases")]
2495    #[serde(skip_serializing_if = "Option::is_none")]
2496    pub aliases: Option<Vec<String>>,
2497
2498    /// DriverOpts is a mapping of driver options and values. These options are passed directly to the driver and are driver specific. 
2499    #[serde(rename = "DriverOpts")]
2500    #[serde(skip_serializing_if = "Option::is_none")]
2501    pub driver_opts: Option<HashMap<String, String>>,
2502
2503    /// This property determines which endpoint will provide the default gateway for a container. The endpoint with the highest priority will be used. If multiple endpoints have the same priority, endpoints are lexicographically sorted based on their network name, and the one that sorts first is picked. 
2504    #[serde(rename = "GwPriority")]
2505    #[serde(skip_serializing_if = "Option::is_none")]
2506    pub gw_priority: Option<f64>,
2507
2508    /// Unique ID of the network. 
2509    #[serde(rename = "NetworkID")]
2510    #[serde(skip_serializing_if = "Option::is_none")]
2511    pub network_id: Option<String>,
2512
2513    /// Unique ID for the service endpoint in a Sandbox. 
2514    #[serde(rename = "EndpointID")]
2515    #[serde(skip_serializing_if = "Option::is_none")]
2516    pub endpoint_id: Option<String>,
2517
2518    /// Gateway address for this network. 
2519    #[serde(rename = "Gateway")]
2520    #[serde(skip_serializing_if = "Option::is_none")]
2521    pub gateway: Option<String>,
2522
2523    /// IPv4 address. 
2524    #[serde(rename = "IPAddress")]
2525    #[serde(skip_serializing_if = "Option::is_none")]
2526    pub ip_address: Option<String>,
2527
2528    /// Mask length of the IPv4 address. 
2529    #[serde(rename = "IPPrefixLen")]
2530    #[serde(skip_serializing_if = "Option::is_none")]
2531    pub ip_prefix_len: Option<i64>,
2532
2533    /// IPv6 gateway address. 
2534    #[serde(rename = "IPv6Gateway")]
2535    #[serde(skip_serializing_if = "Option::is_none")]
2536    pub ipv6_gateway: Option<String>,
2537
2538    /// Global IPv6 address. 
2539    #[serde(rename = "GlobalIPv6Address")]
2540    #[serde(skip_serializing_if = "Option::is_none")]
2541    pub global_ipv6_address: Option<String>,
2542
2543    /// Mask length of the global IPv6 address. 
2544    #[serde(rename = "GlobalIPv6PrefixLen")]
2545    #[serde(skip_serializing_if = "Option::is_none")]
2546    pub global_ipv6_prefix_len: Option<i64>,
2547
2548    /// List of all DNS names an endpoint has on a specific network. This list is based on the container name, network aliases, container short ID, and hostname.  These DNS names are non-fully qualified but can contain several dots. You can get fully qualified DNS names by appending `.<network-name>`. For instance, if container name is `my.ctr` and the network is named `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be `my.ctr.testnet`. 
2549    #[serde(rename = "DNSNames")]
2550    #[serde(skip_serializing_if = "Option::is_none")]
2551    pub dns_names: Option<Vec<String>>,
2552
2553}
2554
2555/// Properties that can be configured to access and load balance a service.
2556#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2557pub struct EndpointSpec {
2558    /// The mode of resolution to use for internal load balancing between tasks. 
2559    #[serde(rename = "Mode")]
2560    #[serde(skip_serializing_if = "Option::is_none")]
2561    pub mode: Option<EndpointSpecModeEnum>,
2562
2563    /// List of exposed ports that this service is accessible on from the outside. Ports can only be provided if `vip` resolution mode is used. 
2564    #[serde(rename = "Ports")]
2565    #[serde(skip_serializing_if = "Option::is_none")]
2566    pub ports: Option<Vec<EndpointPortConfig>>,
2567
2568}
2569
2570#[allow(non_camel_case_types)]
2571#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
2572pub enum EndpointSpecModeEnum { 
2573    #[serde(rename = "")]
2574    EMPTY,
2575    #[serde(rename = "vip")]
2576    VIP,
2577    #[serde(rename = "dnsrr")]
2578    DNSRR,
2579}
2580
2581impl ::std::fmt::Display for EndpointSpecModeEnum {
2582    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
2583        match *self { 
2584            EndpointSpecModeEnum::EMPTY => write!(f, ""),
2585            EndpointSpecModeEnum::VIP => write!(f, "{}", "vip"),
2586            EndpointSpecModeEnum::DNSRR => write!(f, "{}", "dnsrr"),
2587
2588        }
2589    }
2590}
2591
2592impl ::std::str::FromStr for EndpointSpecModeEnum {
2593    type Err = String;
2594    fn from_str(s: &str) -> Result<Self, Self::Err> {
2595        match s { 
2596            "" => Ok(EndpointSpecModeEnum::EMPTY),
2597            "vip" => Ok(EndpointSpecModeEnum::VIP),
2598            "dnsrr" => Ok(EndpointSpecModeEnum::DNSRR),
2599            x => Err(format!("Invalid enum type: {}", x)),
2600        }
2601    }
2602}
2603
2604impl ::std::convert::AsRef<str> for EndpointSpecModeEnum {
2605    fn as_ref(&self) -> &str {
2606        match self { 
2607            EndpointSpecModeEnum::EMPTY => "",
2608            EndpointSpecModeEnum::VIP => "vip",
2609            EndpointSpecModeEnum::DNSRR => "dnsrr",
2610        }
2611    }
2612}
2613
2614/// EngineDescription provides information about an engine.
2615#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2616pub struct EngineDescription {
2617    #[serde(rename = "EngineVersion")]
2618    #[serde(skip_serializing_if = "Option::is_none")]
2619    pub engine_version: Option<String>,
2620
2621    #[serde(rename = "Labels")]
2622    #[serde(skip_serializing_if = "Option::is_none")]
2623    pub labels: Option<HashMap<String, String>>,
2624
2625    #[serde(rename = "Plugins")]
2626    #[serde(skip_serializing_if = "Option::is_none")]
2627    pub plugins: Option<Vec<EngineDescriptionPlugins>>,
2628
2629}
2630
2631#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2632pub struct EngineDescriptionPlugins {
2633    #[serde(rename = "Type")]
2634    #[serde(skip_serializing_if = "Option::is_none")]
2635    pub typ: Option<String>,
2636
2637    #[serde(rename = "Name")]
2638    #[serde(skip_serializing_if = "Option::is_none")]
2639    pub name: Option<String>,
2640
2641}
2642
2643#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2644pub struct ErrorDetail {
2645    #[serde(rename = "code")]
2646    #[serde(skip_serializing_if = "Option::is_none")]
2647    pub code: Option<i64>,
2648
2649    #[serde(rename = "message")]
2650    #[serde(skip_serializing_if = "Option::is_none")]
2651    pub message: Option<String>,
2652
2653}
2654
2655/// Represents an error.
2656#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2657pub struct ErrorResponse {
2658    /// The error message.
2659    #[serde(rename = "message")]
2660    pub message: String,
2661
2662}
2663
2664/// Actor describes something that generates events, like a container, network, or a volume. 
2665#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2666pub struct EventActor {
2667    /// The ID of the object emitting the event
2668    #[serde(rename = "ID")]
2669    #[serde(skip_serializing_if = "Option::is_none")]
2670    pub id: Option<String>,
2671
2672    /// Various key/value attributes of the object, depending on its type. 
2673    #[serde(rename = "Attributes")]
2674    #[serde(skip_serializing_if = "Option::is_none")]
2675    pub attributes: Option<HashMap<String, String>>,
2676
2677}
2678
2679/// EventMessage represents the information an event contains. 
2680#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2681pub struct EventMessage {
2682    /// The type of object emitting the event
2683    #[serde(rename = "Type")]
2684    #[serde(skip_serializing_if = "Option::is_none")]
2685    pub typ: Option<EventMessageTypeEnum>,
2686
2687    /// The type of event
2688    #[serde(rename = "Action")]
2689    #[serde(skip_serializing_if = "Option::is_none")]
2690    pub action: Option<String>,
2691
2692    #[serde(rename = "Actor")]
2693    #[serde(skip_serializing_if = "Option::is_none")]
2694    pub actor: Option<EventActor>,
2695
2696    /// Scope of the event. Engine events are `local` scope. Cluster (Swarm) events are `swarm` scope. 
2697    #[serde(rename = "scope")]
2698    #[serde(skip_serializing_if = "Option::is_none")]
2699    pub scope: Option<EventMessageScopeEnum>,
2700
2701    /// Timestamp of event
2702    #[serde(rename = "time")]
2703    #[serde(skip_serializing_if = "Option::is_none")]
2704    pub time: Option<i64>,
2705
2706    /// Timestamp of event, with nanosecond accuracy
2707    #[serde(rename = "timeNano")]
2708    #[serde(skip_serializing_if = "Option::is_none")]
2709    pub time_nano: Option<i64>,
2710
2711}
2712
2713#[allow(non_camel_case_types)]
2714#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
2715pub enum EventMessageTypeEnum { 
2716    #[serde(rename = "")]
2717    EMPTY,
2718    #[serde(rename = "builder")]
2719    BUILDER,
2720    #[serde(rename = "config")]
2721    CONFIG,
2722    #[serde(rename = "container")]
2723    CONTAINER,
2724    #[serde(rename = "daemon")]
2725    DAEMON,
2726    #[serde(rename = "image")]
2727    IMAGE,
2728    #[serde(rename = "network")]
2729    NETWORK,
2730    #[serde(rename = "node")]
2731    NODE,
2732    #[serde(rename = "plugin")]
2733    PLUGIN,
2734    #[serde(rename = "secret")]
2735    SECRET,
2736    #[serde(rename = "service")]
2737    SERVICE,
2738    #[serde(rename = "volume")]
2739    VOLUME,
2740}
2741
2742impl ::std::fmt::Display for EventMessageTypeEnum {
2743    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
2744        match *self { 
2745            EventMessageTypeEnum::EMPTY => write!(f, ""),
2746            EventMessageTypeEnum::BUILDER => write!(f, "{}", "builder"),
2747            EventMessageTypeEnum::CONFIG => write!(f, "{}", "config"),
2748            EventMessageTypeEnum::CONTAINER => write!(f, "{}", "container"),
2749            EventMessageTypeEnum::DAEMON => write!(f, "{}", "daemon"),
2750            EventMessageTypeEnum::IMAGE => write!(f, "{}", "image"),
2751            EventMessageTypeEnum::NETWORK => write!(f, "{}", "network"),
2752            EventMessageTypeEnum::NODE => write!(f, "{}", "node"),
2753            EventMessageTypeEnum::PLUGIN => write!(f, "{}", "plugin"),
2754            EventMessageTypeEnum::SECRET => write!(f, "{}", "secret"),
2755            EventMessageTypeEnum::SERVICE => write!(f, "{}", "service"),
2756            EventMessageTypeEnum::VOLUME => write!(f, "{}", "volume"),
2757
2758        }
2759    }
2760}
2761
2762impl ::std::str::FromStr for EventMessageTypeEnum {
2763    type Err = String;
2764    fn from_str(s: &str) -> Result<Self, Self::Err> {
2765        match s { 
2766            "" => Ok(EventMessageTypeEnum::EMPTY),
2767            "builder" => Ok(EventMessageTypeEnum::BUILDER),
2768            "config" => Ok(EventMessageTypeEnum::CONFIG),
2769            "container" => Ok(EventMessageTypeEnum::CONTAINER),
2770            "daemon" => Ok(EventMessageTypeEnum::DAEMON),
2771            "image" => Ok(EventMessageTypeEnum::IMAGE),
2772            "network" => Ok(EventMessageTypeEnum::NETWORK),
2773            "node" => Ok(EventMessageTypeEnum::NODE),
2774            "plugin" => Ok(EventMessageTypeEnum::PLUGIN),
2775            "secret" => Ok(EventMessageTypeEnum::SECRET),
2776            "service" => Ok(EventMessageTypeEnum::SERVICE),
2777            "volume" => Ok(EventMessageTypeEnum::VOLUME),
2778            x => Err(format!("Invalid enum type: {}", x)),
2779        }
2780    }
2781}
2782
2783impl ::std::convert::AsRef<str> for EventMessageTypeEnum {
2784    fn as_ref(&self) -> &str {
2785        match self { 
2786            EventMessageTypeEnum::EMPTY => "",
2787            EventMessageTypeEnum::BUILDER => "builder",
2788            EventMessageTypeEnum::CONFIG => "config",
2789            EventMessageTypeEnum::CONTAINER => "container",
2790            EventMessageTypeEnum::DAEMON => "daemon",
2791            EventMessageTypeEnum::IMAGE => "image",
2792            EventMessageTypeEnum::NETWORK => "network",
2793            EventMessageTypeEnum::NODE => "node",
2794            EventMessageTypeEnum::PLUGIN => "plugin",
2795            EventMessageTypeEnum::SECRET => "secret",
2796            EventMessageTypeEnum::SERVICE => "service",
2797            EventMessageTypeEnum::VOLUME => "volume",
2798        }
2799    }
2800}
2801
2802#[allow(non_camel_case_types)]
2803#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
2804pub enum EventMessageScopeEnum { 
2805    #[serde(rename = "")]
2806    EMPTY,
2807    #[serde(rename = "local")]
2808    LOCAL,
2809    #[serde(rename = "swarm")]
2810    SWARM,
2811}
2812
2813impl ::std::fmt::Display for EventMessageScopeEnum {
2814    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
2815        match *self { 
2816            EventMessageScopeEnum::EMPTY => write!(f, ""),
2817            EventMessageScopeEnum::LOCAL => write!(f, "{}", "local"),
2818            EventMessageScopeEnum::SWARM => write!(f, "{}", "swarm"),
2819
2820        }
2821    }
2822}
2823
2824impl ::std::str::FromStr for EventMessageScopeEnum {
2825    type Err = String;
2826    fn from_str(s: &str) -> Result<Self, Self::Err> {
2827        match s { 
2828            "" => Ok(EventMessageScopeEnum::EMPTY),
2829            "local" => Ok(EventMessageScopeEnum::LOCAL),
2830            "swarm" => Ok(EventMessageScopeEnum::SWARM),
2831            x => Err(format!("Invalid enum type: {}", x)),
2832        }
2833    }
2834}
2835
2836impl ::std::convert::AsRef<str> for EventMessageScopeEnum {
2837    fn as_ref(&self) -> &str {
2838        match self { 
2839            EventMessageScopeEnum::EMPTY => "",
2840            EventMessageScopeEnum::LOCAL => "local",
2841            EventMessageScopeEnum::SWARM => "swarm",
2842        }
2843    }
2844}
2845
2846#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2847pub struct ExecConfig {
2848    /// Attach to `stdin` of the exec command.
2849    #[serde(rename = "AttachStdin")]
2850    #[serde(skip_serializing_if = "Option::is_none")]
2851    pub attach_stdin: Option<bool>,
2852
2853    /// Attach to `stdout` of the exec command.
2854    #[serde(rename = "AttachStdout")]
2855    #[serde(skip_serializing_if = "Option::is_none")]
2856    pub attach_stdout: Option<bool>,
2857
2858    /// Attach to `stderr` of the exec command.
2859    #[serde(rename = "AttachStderr")]
2860    #[serde(skip_serializing_if = "Option::is_none")]
2861    pub attach_stderr: Option<bool>,
2862
2863    /// Initial console size, as an `[height, width]` array.
2864    #[serde(rename = "ConsoleSize")]
2865    #[serde(skip_serializing_if = "Option::is_none")]
2866    pub console_size: Option<Vec<i32>>,
2867
2868    /// 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 `_`. 
2869    #[serde(rename = "DetachKeys")]
2870    #[serde(skip_serializing_if = "Option::is_none")]
2871    pub detach_keys: Option<String>,
2872
2873    /// Allocate a pseudo-TTY.
2874    #[serde(rename = "Tty")]
2875    #[serde(skip_serializing_if = "Option::is_none")]
2876    pub tty: Option<bool>,
2877
2878    /// A list of environment variables in the form `[\"VAR=value\", ...]`. 
2879    #[serde(rename = "Env")]
2880    #[serde(skip_serializing_if = "Option::is_none")]
2881    pub env: Option<Vec<String>>,
2882
2883    /// Command to run, as a string or array of strings.
2884    #[serde(rename = "Cmd")]
2885    #[serde(skip_serializing_if = "Option::is_none")]
2886    pub cmd: Option<Vec<String>>,
2887
2888    /// Runs the exec process with extended privileges.
2889    #[serde(rename = "Privileged")]
2890    #[serde(skip_serializing_if = "Option::is_none")]
2891    pub privileged: Option<bool>,
2892
2893    /// The user, and optionally, group to run the exec process inside the container. Format is one of: `user`, `user:group`, `uid`, or `uid:gid`. 
2894    #[serde(rename = "User")]
2895    #[serde(skip_serializing_if = "Option::is_none")]
2896    pub user: Option<String>,
2897
2898    /// The working directory for the exec process inside the container. 
2899    #[serde(rename = "WorkingDir")]
2900    #[serde(skip_serializing_if = "Option::is_none")]
2901    pub working_dir: Option<String>,
2902
2903}
2904
2905#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2906pub struct ExecInspectResponse {
2907    #[serde(rename = "CanRemove")]
2908    #[serde(skip_serializing_if = "Option::is_none")]
2909    pub can_remove: Option<bool>,
2910
2911    #[serde(rename = "DetachKeys")]
2912    #[serde(skip_serializing_if = "Option::is_none")]
2913    pub detach_keys: Option<String>,
2914
2915    #[serde(rename = "ID")]
2916    #[serde(skip_serializing_if = "Option::is_none")]
2917    pub id: Option<String>,
2918
2919    #[serde(rename = "Running")]
2920    #[serde(skip_serializing_if = "Option::is_none")]
2921    pub running: Option<bool>,
2922
2923    #[serde(rename = "ExitCode")]
2924    #[serde(skip_serializing_if = "Option::is_none")]
2925    pub exit_code: Option<i64>,
2926
2927    #[serde(rename = "ProcessConfig")]
2928    #[serde(skip_serializing_if = "Option::is_none")]
2929    pub process_config: Option<ProcessConfig>,
2930
2931    #[serde(rename = "OpenStdin")]
2932    #[serde(skip_serializing_if = "Option::is_none")]
2933    pub open_stdin: Option<bool>,
2934
2935    #[serde(rename = "OpenStderr")]
2936    #[serde(skip_serializing_if = "Option::is_none")]
2937    pub open_stderr: Option<bool>,
2938
2939    #[serde(rename = "OpenStdout")]
2940    #[serde(skip_serializing_if = "Option::is_none")]
2941    pub open_stdout: Option<bool>,
2942
2943    #[serde(rename = "ContainerID")]
2944    #[serde(skip_serializing_if = "Option::is_none")]
2945    pub container_id: Option<String>,
2946
2947    /// The system process ID for the exec process.
2948    #[serde(rename = "Pid")]
2949    #[serde(skip_serializing_if = "Option::is_none")]
2950    pub pid: Option<i64>,
2951
2952}
2953
2954#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2955pub struct ExecStartConfig {
2956    /// Detach from the command.
2957    #[serde(rename = "Detach")]
2958    #[serde(skip_serializing_if = "Option::is_none")]
2959    pub detach: Option<bool>,
2960
2961    /// Allocate a pseudo-TTY.
2962    #[serde(rename = "Tty")]
2963    #[serde(skip_serializing_if = "Option::is_none")]
2964    pub tty: Option<bool>,
2965
2966    /// Initial console size, as an `[height, width]` array.
2967    #[serde(rename = "ConsoleSize")]
2968    #[serde(skip_serializing_if = "Option::is_none")]
2969    pub console_size: Option<Vec<i32>>,
2970
2971}
2972
2973/// Change in the container's filesystem. 
2974#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2975pub struct FilesystemChange {
2976    /// Path to file or directory that has changed. 
2977    #[serde(rename = "Path")]
2978    pub path: String,
2979
2980    #[serde(rename = "Kind")]
2981    pub kind: ChangeType,
2982
2983}
2984
2985/// User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`). 
2986
2987pub type GenericResources = GenericResourcesInner;
2988
2989#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2990pub struct GenericResourcesInner {
2991    #[serde(rename = "NamedResourceSpec")]
2992    #[serde(skip_serializing_if = "Option::is_none")]
2993    pub named_resource_spec: Option<GenericResourcesInnerNamedResourceSpec>,
2994
2995    #[serde(rename = "DiscreteResourceSpec")]
2996    #[serde(skip_serializing_if = "Option::is_none")]
2997    pub discrete_resource_spec: Option<GenericResourcesInnerDiscreteResourceSpec>,
2998
2999}
3000
3001#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3002pub struct GenericResourcesInnerDiscreteResourceSpec {
3003    #[serde(rename = "Kind")]
3004    #[serde(skip_serializing_if = "Option::is_none")]
3005    pub kind: Option<String>,
3006
3007    #[serde(rename = "Value")]
3008    #[serde(skip_serializing_if = "Option::is_none")]
3009    pub value: Option<i64>,
3010
3011}
3012
3013#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3014pub struct GenericResourcesInnerNamedResourceSpec {
3015    #[serde(rename = "Kind")]
3016    #[serde(skip_serializing_if = "Option::is_none")]
3017    pub kind: Option<String>,
3018
3019    #[serde(rename = "Value")]
3020    #[serde(skip_serializing_if = "Option::is_none")]
3021    pub value: Option<String>,
3022
3023}
3024
3025/// Health stores information about the container's healthcheck results. 
3026#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3027pub struct Health {
3028    /// 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 
3029    #[serde(rename = "Status")]
3030    #[serde(skip_serializing_if = "Option::is_none")]
3031    pub status: Option<HealthStatusEnum>,
3032
3033    /// FailingStreak is the number of consecutive failures
3034    #[serde(rename = "FailingStreak")]
3035    #[serde(skip_serializing_if = "Option::is_none")]
3036    pub failing_streak: Option<i64>,
3037
3038    /// Log contains the last few results (oldest first) 
3039    #[serde(rename = "Log")]
3040    #[serde(skip_serializing_if = "Option::is_none")]
3041    pub log: Option<Vec<HealthcheckResult>>,
3042
3043}
3044
3045#[allow(non_camel_case_types)]
3046#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
3047pub enum HealthStatusEnum { 
3048    #[serde(rename = "")]
3049    EMPTY,
3050    #[serde(rename = "none")]
3051    NONE,
3052    #[serde(rename = "starting")]
3053    STARTING,
3054    #[serde(rename = "healthy")]
3055    HEALTHY,
3056    #[serde(rename = "unhealthy")]
3057    UNHEALTHY,
3058}
3059
3060impl ::std::fmt::Display for HealthStatusEnum {
3061    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
3062        match *self { 
3063            HealthStatusEnum::EMPTY => write!(f, ""),
3064            HealthStatusEnum::NONE => write!(f, "{}", "none"),
3065            HealthStatusEnum::STARTING => write!(f, "{}", "starting"),
3066            HealthStatusEnum::HEALTHY => write!(f, "{}", "healthy"),
3067            HealthStatusEnum::UNHEALTHY => write!(f, "{}", "unhealthy"),
3068
3069        }
3070    }
3071}
3072
3073impl ::std::str::FromStr for HealthStatusEnum {
3074    type Err = String;
3075    fn from_str(s: &str) -> Result<Self, Self::Err> {
3076        match s { 
3077            "" => Ok(HealthStatusEnum::EMPTY),
3078            "none" => Ok(HealthStatusEnum::NONE),
3079            "starting" => Ok(HealthStatusEnum::STARTING),
3080            "healthy" => Ok(HealthStatusEnum::HEALTHY),
3081            "unhealthy" => Ok(HealthStatusEnum::UNHEALTHY),
3082            x => Err(format!("Invalid enum type: {}", x)),
3083        }
3084    }
3085}
3086
3087impl ::std::convert::AsRef<str> for HealthStatusEnum {
3088    fn as_ref(&self) -> &str {
3089        match self { 
3090            HealthStatusEnum::EMPTY => "",
3091            HealthStatusEnum::NONE => "none",
3092            HealthStatusEnum::STARTING => "starting",
3093            HealthStatusEnum::HEALTHY => "healthy",
3094            HealthStatusEnum::UNHEALTHY => "unhealthy",
3095        }
3096    }
3097}
3098
3099/// A test to perform to check that the container is healthy.
3100#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3101pub struct HealthConfig {
3102    /// 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 
3103    #[serde(rename = "Test")]
3104    #[serde(skip_serializing_if = "Option::is_none")]
3105    pub test: Option<Vec<String>>,
3106
3107    /// The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. 
3108    #[serde(rename = "Interval")]
3109    #[serde(skip_serializing_if = "Option::is_none")]
3110    pub interval: Option<i64>,
3111
3112    /// The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. 
3113    #[serde(rename = "Timeout")]
3114    #[serde(skip_serializing_if = "Option::is_none")]
3115    pub timeout: Option<i64>,
3116
3117    /// The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit. 
3118    #[serde(rename = "Retries")]
3119    #[serde(skip_serializing_if = "Option::is_none")]
3120    pub retries: Option<i64>,
3121
3122    /// 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. 
3123    #[serde(rename = "StartPeriod")]
3124    #[serde(skip_serializing_if = "Option::is_none")]
3125    pub start_period: Option<i64>,
3126
3127    /// The time to wait between checks in nanoseconds during the start period. It should be 0 or at least 1000000 (1 ms). 0 means inherit. 
3128    #[serde(rename = "StartInterval")]
3129    #[serde(skip_serializing_if = "Option::is_none")]
3130    pub start_interval: Option<i64>,
3131
3132}
3133
3134/// HealthcheckResult stores information about a single run of a healthcheck probe 
3135#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3136pub struct HealthcheckResult {
3137    /// Date and time at which this check started in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
3138    #[serde(rename = "Start")]
3139    #[serde(skip_serializing_if = "Option::is_none")]
3140    #[serde(
3141        default,
3142        deserialize_with = "deserialize_timestamp",
3143        serialize_with = "serialize_timestamp"
3144    )]
3145    pub start: Option<BollardDate>,
3146
3147    /// Date and time at which this check ended in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
3148    #[serde(rename = "End")]
3149    #[serde(skip_serializing_if = "Option::is_none")]
3150    #[serde(
3151        default,
3152        deserialize_with = "deserialize_timestamp",
3153        serialize_with = "serialize_timestamp"
3154    )]
3155    pub end: Option<BollardDate>,
3156
3157    /// ExitCode meanings:  - `0` healthy - `1` unhealthy - `2` reserved (considered unhealthy) - other values: error running probe 
3158    #[serde(rename = "ExitCode")]
3159    #[serde(skip_serializing_if = "Option::is_none")]
3160    pub exit_code: Option<i64>,
3161
3162    /// Output from last check
3163    #[serde(rename = "Output")]
3164    #[serde(skip_serializing_if = "Option::is_none")]
3165    pub output: Option<String>,
3166
3167}
3168
3169/// individual image layer information in response to ImageHistory operation
3170#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3171pub struct HistoryResponseItem {
3172    #[serde(rename = "Id")]
3173    pub id: String,
3174
3175    #[serde(rename = "Created")]
3176    pub created: i64,
3177
3178    #[serde(rename = "CreatedBy")]
3179    pub created_by: String,
3180
3181    #[serde(rename = "Tags")]
3182    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
3183    pub tags: Vec<String>,
3184
3185    #[serde(rename = "Size")]
3186    pub size: i64,
3187
3188    #[serde(rename = "Comment")]
3189    pub comment: String,
3190
3191}
3192
3193/// Container configuration that depends on the host we are running on
3194#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3195pub struct HostConfig {
3196    /// An integer value representing this container's relative CPU weight versus other containers. 
3197    #[serde(rename = "CpuShares")]
3198    #[serde(skip_serializing_if = "Option::is_none")]
3199    pub cpu_shares: Option<i64>,
3200
3201    /// Memory limit in bytes.
3202    #[serde(rename = "Memory")]
3203    #[serde(skip_serializing_if = "Option::is_none")]
3204    pub memory: Option<i64>,
3205
3206    /// 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. 
3207    #[serde(rename = "CgroupParent")]
3208    #[serde(skip_serializing_if = "Option::is_none")]
3209    pub cgroup_parent: Option<String>,
3210
3211    /// Block IO weight (relative weight).
3212    #[serde(rename = "BlkioWeight")]
3213    #[serde(skip_serializing_if = "Option::is_none")]
3214    pub blkio_weight: Option<u16>,
3215
3216    /// Block IO weight (relative device weight) in the form:  ``` [{\"Path\": \"device_path\", \"Weight\": weight}] ``` 
3217    #[serde(rename = "BlkioWeightDevice")]
3218    #[serde(skip_serializing_if = "Option::is_none")]
3219    pub blkio_weight_device: Option<Vec<ResourcesBlkioWeightDevice>>,
3220
3221    /// Limit read rate (bytes per second) from a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
3222    #[serde(rename = "BlkioDeviceReadBps")]
3223    #[serde(skip_serializing_if = "Option::is_none")]
3224    pub blkio_device_read_bps: Option<Vec<ThrottleDevice>>,
3225
3226    /// Limit write rate (bytes per second) to a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
3227    #[serde(rename = "BlkioDeviceWriteBps")]
3228    #[serde(skip_serializing_if = "Option::is_none")]
3229    pub blkio_device_write_bps: Option<Vec<ThrottleDevice>>,
3230
3231    /// Limit read rate (IO per second) from a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
3232    #[serde(rename = "BlkioDeviceReadIOps")]
3233    #[serde(skip_serializing_if = "Option::is_none")]
3234    pub blkio_device_read_iops: Option<Vec<ThrottleDevice>>,
3235
3236    /// Limit write rate (IO per second) to a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
3237    #[serde(rename = "BlkioDeviceWriteIOps")]
3238    #[serde(skip_serializing_if = "Option::is_none")]
3239    pub blkio_device_write_iops: Option<Vec<ThrottleDevice>>,
3240
3241    /// The length of a CPU period in microseconds.
3242    #[serde(rename = "CpuPeriod")]
3243    #[serde(skip_serializing_if = "Option::is_none")]
3244    pub cpu_period: Option<i64>,
3245
3246    /// Microseconds of CPU time that the container can get in a CPU period. 
3247    #[serde(rename = "CpuQuota")]
3248    #[serde(skip_serializing_if = "Option::is_none")]
3249    pub cpu_quota: Option<i64>,
3250
3251    /// The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. 
3252    #[serde(rename = "CpuRealtimePeriod")]
3253    #[serde(skip_serializing_if = "Option::is_none")]
3254    pub cpu_realtime_period: Option<i64>,
3255
3256    /// The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. 
3257    #[serde(rename = "CpuRealtimeRuntime")]
3258    #[serde(skip_serializing_if = "Option::is_none")]
3259    pub cpu_realtime_runtime: Option<i64>,
3260
3261    /// CPUs in which to allow execution (e.g., `0-3`, `0,1`). 
3262    #[serde(rename = "CpusetCpus")]
3263    #[serde(skip_serializing_if = "Option::is_none")]
3264    pub cpuset_cpus: Option<String>,
3265
3266    /// Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. 
3267    #[serde(rename = "CpusetMems")]
3268    #[serde(skip_serializing_if = "Option::is_none")]
3269    pub cpuset_mems: Option<String>,
3270
3271    /// A list of devices to add to the container.
3272    #[serde(rename = "Devices")]
3273    #[serde(skip_serializing_if = "Option::is_none")]
3274    pub devices: Option<Vec<DeviceMapping>>,
3275
3276    /// a list of cgroup rules to apply to the container
3277    #[serde(rename = "DeviceCgroupRules")]
3278    #[serde(skip_serializing_if = "Option::is_none")]
3279    pub device_cgroup_rules: Option<Vec<String>>,
3280
3281    /// A list of requests for devices to be sent to device drivers. 
3282    #[serde(rename = "DeviceRequests")]
3283    #[serde(skip_serializing_if = "Option::is_none")]
3284    pub device_requests: Option<Vec<DeviceRequest>>,
3285
3286    /// Hard limit for kernel TCP buffer memory (in bytes). Depending on the OCI runtime in use, this option may be ignored. It is no longer supported by the default (runc) runtime.  This field is omitted when empty. 
3287    #[serde(rename = "KernelMemoryTCP")]
3288    #[serde(skip_serializing_if = "Option::is_none")]
3289    pub kernel_memory_tcp: Option<i64>,
3290
3291    /// Memory soft limit in bytes.
3292    #[serde(rename = "MemoryReservation")]
3293    #[serde(skip_serializing_if = "Option::is_none")]
3294    pub memory_reservation: Option<i64>,
3295
3296    /// Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. 
3297    #[serde(rename = "MemorySwap")]
3298    #[serde(skip_serializing_if = "Option::is_none")]
3299    pub memory_swap: Option<i64>,
3300
3301    /// Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. 
3302    #[serde(rename = "MemorySwappiness")]
3303    #[serde(skip_serializing_if = "Option::is_none")]
3304    pub memory_swappiness: Option<i64>,
3305
3306    /// CPU quota in units of 10<sup>-9</sup> CPUs.
3307    #[serde(rename = "NanoCpus")]
3308    #[serde(skip_serializing_if = "Option::is_none")]
3309    pub nano_cpus: Option<i64>,
3310
3311    /// Disable OOM Killer for the container.
3312    #[serde(rename = "OomKillDisable")]
3313    #[serde(skip_serializing_if = "Option::is_none")]
3314    pub oom_kill_disable: Option<bool>,
3315
3316    /// 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. 
3317    #[serde(rename = "Init")]
3318    #[serde(skip_serializing_if = "Option::is_none")]
3319    pub init: Option<bool>,
3320
3321    /// Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` to not change. 
3322    #[serde(rename = "PidsLimit")]
3323    #[serde(skip_serializing_if = "Option::is_none")]
3324    pub pids_limit: Option<i64>,
3325
3326    /// A list of resource limits to set in the container. For example:  ``` {\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048} ``` 
3327    #[serde(rename = "Ulimits")]
3328    #[serde(skip_serializing_if = "Option::is_none")]
3329    pub ulimits: Option<Vec<ResourcesUlimits>>,
3330
3331    /// 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. 
3332    #[serde(rename = "CpuCount")]
3333    #[serde(skip_serializing_if = "Option::is_none")]
3334    pub cpu_count: Option<i64>,
3335
3336    /// 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. 
3337    #[serde(rename = "CpuPercent")]
3338    #[serde(skip_serializing_if = "Option::is_none")]
3339    pub cpu_percent: Option<i64>,
3340
3341    /// Maximum IOps for the container system drive (Windows only)
3342    #[serde(rename = "IOMaximumIOps")]
3343    #[serde(skip_serializing_if = "Option::is_none")]
3344    pub io_maximum_iops: Option<i64>,
3345
3346    /// Maximum IO in bytes per second for the container system drive (Windows only). 
3347    #[serde(rename = "IOMaximumBandwidth")]
3348    #[serde(skip_serializing_if = "Option::is_none")]
3349    pub io_maximum_bandwidth: Option<i64>,
3350
3351    /// 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`. 
3352    #[serde(rename = "Binds")]
3353    #[serde(skip_serializing_if = "Option::is_none")]
3354    pub binds: Option<Vec<String>>,
3355
3356    /// Path to a file where the container ID is written
3357    #[serde(rename = "ContainerIDFile")]
3358    #[serde(skip_serializing_if = "Option::is_none")]
3359    pub container_id_file: Option<String>,
3360
3361    #[serde(rename = "LogConfig")]
3362    #[serde(skip_serializing_if = "Option::is_none")]
3363    pub log_config: Option<HostConfigLogConfig>,
3364
3365    /// 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. 
3366    #[serde(rename = "NetworkMode")]
3367    #[serde(skip_serializing_if = "Option::is_none")]
3368    pub network_mode: Option<String>,
3369
3370    #[serde(rename = "PortBindings")]
3371    #[serde(skip_serializing_if = "Option::is_none")]
3372    pub port_bindings: Option<PortMap>,
3373
3374    #[serde(rename = "RestartPolicy")]
3375    #[serde(skip_serializing_if = "Option::is_none")]
3376    pub restart_policy: Option<RestartPolicy>,
3377
3378    /// Automatically remove the container when the container's process exits. This has no effect if `RestartPolicy` is set. 
3379    #[serde(rename = "AutoRemove")]
3380    #[serde(skip_serializing_if = "Option::is_none")]
3381    pub auto_remove: Option<bool>,
3382
3383    /// Driver that this container uses to mount volumes.
3384    #[serde(rename = "VolumeDriver")]
3385    #[serde(skip_serializing_if = "Option::is_none")]
3386    pub volume_driver: Option<String>,
3387
3388    /// A list of volumes to inherit from another container, specified in the form `<container name>[:<ro|rw>]`. 
3389    #[serde(rename = "VolumesFrom")]
3390    #[serde(skip_serializing_if = "Option::is_none")]
3391    pub volumes_from: Option<Vec<String>>,
3392
3393    /// Specification for mounts to be added to the container. 
3394    #[serde(rename = "Mounts")]
3395    #[serde(skip_serializing_if = "Option::is_none")]
3396    pub mounts: Option<Vec<Mount>>,
3397
3398    /// Initial console size, as an `[height, width]` array. 
3399    #[serde(rename = "ConsoleSize")]
3400    #[serde(skip_serializing_if = "Option::is_none")]
3401    pub console_size: Option<Vec<i32>>,
3402
3403    /// Arbitrary non-identifying metadata attached to container and provided to the runtime when the container is started. 
3404    #[serde(rename = "Annotations")]
3405    #[serde(skip_serializing_if = "Option::is_none")]
3406    pub annotations: Option<HashMap<String, String>>,
3407
3408    /// A list of kernel capabilities to add to the container. Conflicts with option 'Capabilities'. 
3409    #[serde(rename = "CapAdd")]
3410    #[serde(skip_serializing_if = "Option::is_none")]
3411    pub cap_add: Option<Vec<String>>,
3412
3413    /// A list of kernel capabilities to drop from the container. Conflicts with option 'Capabilities'. 
3414    #[serde(rename = "CapDrop")]
3415    #[serde(skip_serializing_if = "Option::is_none")]
3416    pub cap_drop: Option<Vec<String>>,
3417
3418    /// 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. 
3419    #[serde(rename = "CgroupnsMode")]
3420    #[serde(skip_serializing_if = "Option::is_none")]
3421    pub cgroupns_mode: Option<HostConfigCgroupnsModeEnum>,
3422
3423    /// A list of DNS servers for the container to use.
3424    #[serde(rename = "Dns")]
3425    #[serde(skip_serializing_if = "Option::is_none")]
3426    pub dns: Option<Vec<String>>,
3427
3428    /// A list of DNS options.
3429    #[serde(rename = "DnsOptions")]
3430    #[serde(skip_serializing_if = "Option::is_none")]
3431    pub dns_options: Option<Vec<String>>,
3432
3433    /// A list of DNS search domains.
3434    #[serde(rename = "DnsSearch")]
3435    #[serde(skip_serializing_if = "Option::is_none")]
3436    pub dns_search: Option<Vec<String>>,
3437
3438    /// A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `[\"hostname:IP\"]`. 
3439    #[serde(rename = "ExtraHosts")]
3440    #[serde(skip_serializing_if = "Option::is_none")]
3441    pub extra_hosts: Option<Vec<String>>,
3442
3443    /// A list of additional groups that the container process will run as. 
3444    #[serde(rename = "GroupAdd")]
3445    #[serde(skip_serializing_if = "Option::is_none")]
3446    pub group_add: Option<Vec<String>>,
3447
3448    /// 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. 
3449    #[serde(rename = "IpcMode")]
3450    #[serde(skip_serializing_if = "Option::is_none")]
3451    pub ipc_mode: Option<String>,
3452
3453    /// Cgroup to use for the container.
3454    #[serde(rename = "Cgroup")]
3455    #[serde(skip_serializing_if = "Option::is_none")]
3456    pub cgroup: Option<String>,
3457
3458    /// A list of links for the container in the form `container_name:alias`. 
3459    #[serde(rename = "Links")]
3460    #[serde(skip_serializing_if = "Option::is_none")]
3461    pub links: Option<Vec<String>>,
3462
3463    /// An integer value containing the score given to the container in order to tune OOM killer preferences. 
3464    #[serde(rename = "OomScoreAdj")]
3465    #[serde(skip_serializing_if = "Option::is_none")]
3466    pub oom_score_adj: Option<i64>,
3467
3468    /// 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 
3469    #[serde(rename = "PidMode")]
3470    #[serde(skip_serializing_if = "Option::is_none")]
3471    pub pid_mode: Option<String>,
3472
3473    /// Gives the container full access to the host.
3474    #[serde(rename = "Privileged")]
3475    #[serde(skip_serializing_if = "Option::is_none")]
3476    pub privileged: Option<bool>,
3477
3478    /// 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`. 
3479    #[serde(rename = "PublishAllPorts")]
3480    #[serde(skip_serializing_if = "Option::is_none")]
3481    pub publish_all_ports: Option<bool>,
3482
3483    /// Mount the container's root filesystem as read only.
3484    #[serde(rename = "ReadonlyRootfs")]
3485    #[serde(skip_serializing_if = "Option::is_none")]
3486    pub readonly_rootfs: Option<bool>,
3487
3488    /// A list of string values to customize labels for MLS systems, such as SELinux. 
3489    #[serde(rename = "SecurityOpt")]
3490    #[serde(skip_serializing_if = "Option::is_none")]
3491    pub security_opt: Option<Vec<String>>,
3492
3493    /// Storage driver options for this container, in the form `{\"size\": \"120G\"}`. 
3494    #[serde(rename = "StorageOpt")]
3495    #[serde(skip_serializing_if = "Option::is_none")]
3496    pub storage_opt: Option<HashMap<String, String>>,
3497
3498    /// 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\" } ``` 
3499    #[serde(rename = "Tmpfs")]
3500    #[serde(skip_serializing_if = "Option::is_none")]
3501    pub tmpfs: Option<HashMap<String, String>>,
3502
3503    /// UTS namespace to use for the container.
3504    #[serde(rename = "UTSMode")]
3505    #[serde(skip_serializing_if = "Option::is_none")]
3506    pub uts_mode: Option<String>,
3507
3508    /// Sets the usernamespace mode for the container when usernamespace remapping option is enabled. 
3509    #[serde(rename = "UsernsMode")]
3510    #[serde(skip_serializing_if = "Option::is_none")]
3511    pub userns_mode: Option<String>,
3512
3513    /// Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. 
3514    #[serde(rename = "ShmSize")]
3515    #[serde(skip_serializing_if = "Option::is_none")]
3516    pub shm_size: Option<i64>,
3517
3518    /// A list of kernel parameters (sysctls) to set in the container.  This field is omitted if not set.
3519    #[serde(rename = "Sysctls")]
3520    #[serde(skip_serializing_if = "Option::is_none")]
3521    pub sysctls: Option<HashMap<String, String>>,
3522
3523    /// Runtime to use with this container.
3524    #[serde(rename = "Runtime")]
3525    #[serde(skip_serializing_if = "Option::is_none")]
3526    pub runtime: Option<String>,
3527
3528    /// Isolation technology of the container. (Windows only) 
3529    #[serde(rename = "Isolation")]
3530    #[serde(skip_serializing_if = "Option::is_none")]
3531    pub isolation: Option<HostConfigIsolationEnum>,
3532
3533    /// The list of paths to be masked inside the container (this overrides the default set of paths). 
3534    #[serde(rename = "MaskedPaths")]
3535    #[serde(skip_serializing_if = "Option::is_none")]
3536    pub masked_paths: Option<Vec<String>>,
3537
3538    /// The list of paths to be set as read-only inside the container (this overrides the default set of paths). 
3539    #[serde(rename = "ReadonlyPaths")]
3540    #[serde(skip_serializing_if = "Option::is_none")]
3541    pub readonly_paths: Option<Vec<String>>,
3542
3543}
3544
3545#[allow(non_camel_case_types)]
3546#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
3547pub enum HostConfigCgroupnsModeEnum { 
3548    #[serde(rename = "")]
3549    EMPTY,
3550    #[serde(rename = "private")]
3551    PRIVATE,
3552    #[serde(rename = "host")]
3553    HOST,
3554}
3555
3556impl ::std::fmt::Display for HostConfigCgroupnsModeEnum {
3557    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
3558        match *self { 
3559            HostConfigCgroupnsModeEnum::EMPTY => write!(f, ""),
3560            HostConfigCgroupnsModeEnum::PRIVATE => write!(f, "{}", "private"),
3561            HostConfigCgroupnsModeEnum::HOST => write!(f, "{}", "host"),
3562
3563        }
3564    }
3565}
3566
3567impl ::std::str::FromStr for HostConfigCgroupnsModeEnum {
3568    type Err = String;
3569    fn from_str(s: &str) -> Result<Self, Self::Err> {
3570        match s { 
3571            "" => Ok(HostConfigCgroupnsModeEnum::EMPTY),
3572            "private" => Ok(HostConfigCgroupnsModeEnum::PRIVATE),
3573            "host" => Ok(HostConfigCgroupnsModeEnum::HOST),
3574            x => Err(format!("Invalid enum type: {}", x)),
3575        }
3576    }
3577}
3578
3579impl ::std::convert::AsRef<str> for HostConfigCgroupnsModeEnum {
3580    fn as_ref(&self) -> &str {
3581        match self { 
3582            HostConfigCgroupnsModeEnum::EMPTY => "",
3583            HostConfigCgroupnsModeEnum::PRIVATE => "private",
3584            HostConfigCgroupnsModeEnum::HOST => "host",
3585        }
3586    }
3587}
3588
3589#[allow(non_camel_case_types)]
3590#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
3591pub enum HostConfigIsolationEnum { 
3592    #[serde(rename = "default")]
3593    DEFAULT,
3594    #[serde(rename = "process")]
3595    PROCESS,
3596    #[serde(rename = "hyperv")]
3597    HYPERV,
3598    #[serde(rename = "")]
3599    EMPTY,
3600}
3601
3602impl ::std::fmt::Display for HostConfigIsolationEnum {
3603    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
3604        match *self { 
3605            HostConfigIsolationEnum::DEFAULT => write!(f, "{}", "default"),
3606            HostConfigIsolationEnum::PROCESS => write!(f, "{}", "process"),
3607            HostConfigIsolationEnum::HYPERV => write!(f, "{}", "hyperv"),
3608            HostConfigIsolationEnum::EMPTY => write!(f, "{}", ""),
3609
3610        }
3611    }
3612}
3613
3614impl ::std::str::FromStr for HostConfigIsolationEnum {
3615    type Err = String;
3616    fn from_str(s: &str) -> Result<Self, Self::Err> {
3617        match s { 
3618            "default" => Ok(HostConfigIsolationEnum::DEFAULT),
3619            "process" => Ok(HostConfigIsolationEnum::PROCESS),
3620            "hyperv" => Ok(HostConfigIsolationEnum::HYPERV),
3621            "" => Ok(HostConfigIsolationEnum::EMPTY),
3622            x => Err(format!("Invalid enum type: {}", x)),
3623        }
3624    }
3625}
3626
3627impl ::std::convert::AsRef<str> for HostConfigIsolationEnum {
3628    fn as_ref(&self) -> &str {
3629        match self { 
3630            HostConfigIsolationEnum::DEFAULT => "default",
3631            HostConfigIsolationEnum::PROCESS => "process",
3632            HostConfigIsolationEnum::HYPERV => "hyperv",
3633            HostConfigIsolationEnum::EMPTY => "",
3634        }
3635    }
3636}
3637
3638/// The logging configuration for this container
3639#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3640pub struct HostConfigLogConfig {
3641    /// Name of the logging driver used for the container or \"none\" if logging is disabled.
3642    #[serde(rename = "Type")]
3643    #[serde(skip_serializing_if = "Option::is_none")]
3644    pub typ: Option<String>,
3645
3646    /// Driver-specific configuration options for the logging driver.
3647    #[serde(rename = "Config")]
3648    #[serde(skip_serializing_if = "Option::is_none")]
3649    pub config: Option<HashMap<String, String>>,
3650
3651}
3652
3653/// Response to an API call that returns just an Id
3654#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3655#[serde(rename_all = "UPPERCASE")]
3656pub struct IdResponse {
3657    /// The id of the newly created object.
3658    
3659    pub id: String,
3660
3661}
3662
3663/// Configuration of the image. These fields are used as defaults when starting a container from the image. 
3664#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3665pub struct ImageConfig {
3666    /// The hostname to use for the container, as a valid RFC 1123 hostname.  <p><br /></p>  > **Deprecated**: this field is not part of the image specification and is > always empty. It must not be used, and will be removed in API v1.48. 
3667    #[serde(rename = "Hostname")]
3668    #[serde(skip_serializing_if = "Option::is_none")]
3669    pub hostname: Option<String>,
3670
3671    /// The domain name to use for the container.  <p><br /></p>  > **Deprecated**: this field is not part of the image specification and is > always empty. It must not be used, and will be removed in API v1.48. 
3672    #[serde(rename = "Domainname")]
3673    #[serde(skip_serializing_if = "Option::is_none")]
3674    pub domainname: Option<String>,
3675
3676    /// The user that commands are run as inside the container.
3677    #[serde(rename = "User")]
3678    #[serde(skip_serializing_if = "Option::is_none")]
3679    pub user: Option<String>,
3680
3681    /// Whether to attach to `stdin`.  <p><br /></p>  > **Deprecated**: this field is not part of the image specification and is > always false. It must not be used, and will be removed in API v1.48. 
3682    #[serde(rename = "AttachStdin")]
3683    #[serde(skip_serializing_if = "Option::is_none")]
3684    pub attach_stdin: Option<bool>,
3685
3686    /// Whether to attach to `stdout`.  <p><br /></p>  > **Deprecated**: this field is not part of the image specification and is > always false. It must not be used, and will be removed in API v1.48. 
3687    #[serde(rename = "AttachStdout")]
3688    #[serde(skip_serializing_if = "Option::is_none")]
3689    pub attach_stdout: Option<bool>,
3690
3691    /// Whether to attach to `stderr`.  <p><br /></p>  > **Deprecated**: this field is not part of the image specification and is > always false. It must not be used, and will be removed in API v1.48. 
3692    #[serde(rename = "AttachStderr")]
3693    #[serde(skip_serializing_if = "Option::is_none")]
3694    pub attach_stderr: Option<bool>,
3695
3696    /// An object mapping ports to an empty object in the form:  `{\"<port>/<tcp|udp|sctp>\": {}}` 
3697    #[serde(rename = "ExposedPorts")]
3698    #[serde(skip_serializing_if = "Option::is_none")]
3699    pub exposed_ports: Option<HashMap<String, HashMap<(), ()>>>,
3700
3701    /// Attach standard streams to a TTY, including `stdin` if it is not closed.  <p><br /></p>  > **Deprecated**: this field is not part of the image specification and is > always false. It must not be used, and will be removed in API v1.48. 
3702    #[serde(rename = "Tty")]
3703    #[serde(skip_serializing_if = "Option::is_none")]
3704    pub tty: Option<bool>,
3705
3706    /// Open `stdin`  <p><br /></p>  > **Deprecated**: this field is not part of the image specification and is > always false. It must not be used, and will be removed in API v1.48. 
3707    #[serde(rename = "OpenStdin")]
3708    #[serde(skip_serializing_if = "Option::is_none")]
3709    pub open_stdin: Option<bool>,
3710
3711    /// Close `stdin` after one attached client disconnects.  <p><br /></p>  > **Deprecated**: this field is not part of the image specification and is > always false. It must not be used, and will be removed in API v1.48. 
3712    #[serde(rename = "StdinOnce")]
3713    #[serde(skip_serializing_if = "Option::is_none")]
3714    pub stdin_once: Option<bool>,
3715
3716    /// 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. 
3717    #[serde(rename = "Env")]
3718    #[serde(skip_serializing_if = "Option::is_none")]
3719    pub env: Option<Vec<String>>,
3720
3721    /// Command to run specified as a string or an array of strings. 
3722    #[serde(rename = "Cmd")]
3723    #[serde(skip_serializing_if = "Option::is_none")]
3724    pub cmd: Option<Vec<String>>,
3725
3726    #[serde(rename = "Healthcheck")]
3727    #[serde(skip_serializing_if = "Option::is_none")]
3728    pub healthcheck: Option<HealthConfig>,
3729
3730    /// Command is already escaped (Windows only)
3731    #[serde(rename = "ArgsEscaped")]
3732    #[serde(skip_serializing_if = "Option::is_none")]
3733    pub args_escaped: Option<bool>,
3734
3735    /// The name (or reference) of the image to use when creating the container, or which was used when the container was created.  <p><br /></p>  > **Deprecated**: this field is not part of the image specification and is > always empty. It must not be used, and will be removed in API v1.48. 
3736    #[serde(rename = "Image")]
3737    #[serde(skip_serializing_if = "Option::is_none")]
3738    pub image: Option<String>,
3739
3740    /// An object mapping mount point paths inside the container to empty objects. 
3741    #[serde(rename = "Volumes")]
3742    #[serde(skip_serializing_if = "Option::is_none")]
3743    pub volumes: Option<HashMap<String, HashMap<(), ()>>>,
3744
3745    /// The working directory for commands to run in.
3746    #[serde(rename = "WorkingDir")]
3747    #[serde(skip_serializing_if = "Option::is_none")]
3748    pub working_dir: Option<String>,
3749
3750    /// 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`). 
3751    #[serde(rename = "Entrypoint")]
3752    #[serde(skip_serializing_if = "Option::is_none")]
3753    pub entrypoint: Option<Vec<String>>,
3754
3755    /// Disable networking for the container.  <p><br /></p>  > **Deprecated**: this field is not part of the image specification and is > always omitted. It must not be used, and will be removed in API v1.48. 
3756    #[serde(rename = "NetworkDisabled")]
3757    #[serde(skip_serializing_if = "Option::is_none")]
3758    pub network_disabled: Option<bool>,
3759
3760    /// MAC address of the container.  <p><br /></p>  > **Deprecated**: this field is not part of the image specification and is > always omitted. It must not be used, and will be removed in API v1.48. 
3761    #[serde(rename = "MacAddress")]
3762    #[serde(skip_serializing_if = "Option::is_none")]
3763    pub mac_address: Option<String>,
3764
3765    /// `ONBUILD` metadata that were defined in the image's `Dockerfile`. 
3766    #[serde(rename = "OnBuild")]
3767    #[serde(skip_serializing_if = "Option::is_none")]
3768    pub on_build: Option<Vec<String>>,
3769
3770    /// User-defined key/value metadata.
3771    #[serde(rename = "Labels")]
3772    #[serde(skip_serializing_if = "Option::is_none")]
3773    pub labels: Option<HashMap<String, String>>,
3774
3775    /// Signal to stop a container as a string or unsigned integer. 
3776    #[serde(rename = "StopSignal")]
3777    #[serde(skip_serializing_if = "Option::is_none")]
3778    pub stop_signal: Option<String>,
3779
3780    /// Timeout to stop a container in seconds.  <p><br /></p>  > **Deprecated**: this field is not part of the image specification and is > always omitted. It must not be used, and will be removed in API v1.48. 
3781    #[serde(rename = "StopTimeout")]
3782    #[serde(skip_serializing_if = "Option::is_none")]
3783    pub stop_timeout: Option<i64>,
3784
3785    /// Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. 
3786    #[serde(rename = "Shell")]
3787    #[serde(skip_serializing_if = "Option::is_none")]
3788    pub shell: Option<Vec<String>>,
3789
3790}
3791
3792#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3793pub struct ImageDeleteResponseItem {
3794    /// The image ID of an image that was untagged
3795    #[serde(rename = "Untagged")]
3796    #[serde(skip_serializing_if = "Option::is_none")]
3797    pub untagged: Option<String>,
3798
3799    /// The image ID of an image that was deleted
3800    #[serde(rename = "Deleted")]
3801    #[serde(skip_serializing_if = "Option::is_none")]
3802    pub deleted: Option<String>,
3803
3804}
3805
3806/// Image ID or Digest
3807#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3808pub struct ImageId {
3809    #[serde(rename = "ID")]
3810    #[serde(skip_serializing_if = "Option::is_none")]
3811    pub id: Option<String>,
3812
3813}
3814
3815/// Information about an image in the local image cache. 
3816#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3817pub struct ImageInspect {
3818    /// ID is the content-addressable ID of an image.  This identifier is a content-addressable digest calculated from the image's configuration (which includes the digests of layers used by the image).  Note that this digest differs from the `RepoDigests` below, which holds digests of image manifests that reference the image. 
3819    #[serde(rename = "Id")]
3820    #[serde(skip_serializing_if = "Option::is_none")]
3821    pub id: Option<String>,
3822
3823    /// Descriptor is an OCI descriptor of the image target. In case of a multi-platform image, this descriptor points to the OCI index or a manifest list.  This field is only present if the daemon provides a multi-platform image store.  WARNING: This is experimental and may change at any time without any backward compatibility. 
3824    #[serde(rename = "Descriptor")]
3825    #[serde(skip_serializing_if = "Option::is_none")]
3826    pub descriptor: Option<OciDescriptor>,
3827
3828    /// Manifests is a list of image manifests available in this image. It provides a more detailed view of the platform-specific image manifests or other image-attached data like build attestations.  Only available if the daemon provides a multi-platform image store and the `manifests` option is set in the inspect request.  WARNING: This is experimental and may change at any time without any backward compatibility. 
3829    #[serde(rename = "Manifests")]
3830    #[serde(skip_serializing_if = "Option::is_none")]
3831    pub manifests: Option<Vec<ImageManifestSummary>>,
3832
3833    /// List of image names/tags in the local image cache that reference this image.  Multiple image tags can refer to the same image, and this list may be empty if no tags reference the image, in which case the image is \"untagged\", in which case it can still be referenced by its ID. 
3834    #[serde(rename = "RepoTags")]
3835    #[serde(skip_serializing_if = "Option::is_none")]
3836    pub repo_tags: Option<Vec<String>>,
3837
3838    /// List of content-addressable digests of locally available image manifests that the image is referenced from. Multiple manifests can refer to the same image.  These digests are usually only available if the image was either pulled from a registry, or if the image was pushed to a registry, which is when the manifest is generated and its digest calculated. 
3839    #[serde(rename = "RepoDigests")]
3840    #[serde(skip_serializing_if = "Option::is_none")]
3841    pub repo_digests: Option<Vec<String>>,
3842
3843    /// ID of the parent image.  Depending on how the image was created, this field may be empty and is only set for images that were built/created locally. This field is empty if the image was pulled from an image registry. 
3844    #[serde(rename = "Parent")]
3845    #[serde(skip_serializing_if = "Option::is_none")]
3846    pub parent: Option<String>,
3847
3848    /// Optional message that was set when committing or importing the image. 
3849    #[serde(rename = "Comment")]
3850    #[serde(skip_serializing_if = "Option::is_none")]
3851    pub comment: Option<String>,
3852
3853    /// Date and time at which the image was created, formatted in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.  This information is only available if present in the image, and omitted otherwise. 
3854    #[serde(rename = "Created")]
3855    #[serde(skip_serializing_if = "Option::is_none")]
3856    #[serde(
3857        default,
3858        deserialize_with = "deserialize_timestamp",
3859        serialize_with = "serialize_timestamp"
3860    )]
3861    pub created: Option<BollardDate>,
3862
3863    /// The version of Docker that was used to build the image.  Depending on how the image was created, this field may be empty. 
3864    #[serde(rename = "DockerVersion")]
3865    #[serde(skip_serializing_if = "Option::is_none")]
3866    pub docker_version: Option<String>,
3867
3868    /// Name of the author that was specified when committing the image, or as specified through MAINTAINER (deprecated) in the Dockerfile. 
3869    #[serde(rename = "Author")]
3870    #[serde(skip_serializing_if = "Option::is_none")]
3871    pub author: Option<String>,
3872
3873    #[serde(rename = "Config")]
3874    #[serde(skip_serializing_if = "Option::is_none")]
3875    pub config: Option<ImageConfig>,
3876
3877    /// Hardware CPU architecture that the image runs on. 
3878    #[serde(rename = "Architecture")]
3879    #[serde(skip_serializing_if = "Option::is_none")]
3880    pub architecture: Option<String>,
3881
3882    /// CPU architecture variant (presently ARM-only). 
3883    #[serde(rename = "Variant")]
3884    #[serde(skip_serializing_if = "Option::is_none")]
3885    pub variant: Option<String>,
3886
3887    /// Operating System the image is built to run on. 
3888    #[serde(rename = "Os")]
3889    #[serde(skip_serializing_if = "Option::is_none")]
3890    pub os: Option<String>,
3891
3892    /// Operating System version the image is built to run on (especially for Windows). 
3893    #[serde(rename = "OsVersion")]
3894    #[serde(skip_serializing_if = "Option::is_none")]
3895    pub os_version: Option<String>,
3896
3897    /// Total size of the image including all layers it is composed of. 
3898    #[serde(rename = "Size")]
3899    #[serde(skip_serializing_if = "Option::is_none")]
3900    pub size: Option<i64>,
3901
3902    /// Total size of the image including all layers it is composed of.  Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. 
3903    #[serde(rename = "VirtualSize")]
3904    #[serde(skip_serializing_if = "Option::is_none")]
3905    pub virtual_size: Option<i64>,
3906
3907    #[serde(rename = "GraphDriver")]
3908    #[serde(skip_serializing_if = "Option::is_none")]
3909    pub graph_driver: Option<DriverData>,
3910
3911    #[serde(rename = "RootFS")]
3912    #[serde(skip_serializing_if = "Option::is_none")]
3913    pub root_fs: Option<ImageInspectRootFs>,
3914
3915    #[serde(rename = "Metadata")]
3916    #[serde(skip_serializing_if = "Option::is_none")]
3917    pub metadata: Option<ImageInspectMetadata>,
3918
3919}
3920
3921/// Additional metadata of the image in the local cache. This information is local to the daemon, and not part of the image itself. 
3922#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3923pub struct ImageInspectMetadata {
3924    /// Date and time at which the image was last tagged in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.  This information is only available if the image was tagged locally, and omitted otherwise. 
3925    #[serde(rename = "LastTagTime")]
3926    #[serde(skip_serializing_if = "Option::is_none")]
3927    #[serde(
3928        default,
3929        deserialize_with = "deserialize_timestamp",
3930        serialize_with = "serialize_timestamp"
3931    )]
3932    pub last_tag_time: Option<BollardDate>,
3933
3934}
3935
3936/// Information about the image's RootFS, including the layer IDs. 
3937#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3938pub struct ImageInspectRootFs {
3939    #[serde(rename = "Type")]
3940    pub typ: String,
3941
3942    #[serde(rename = "Layers")]
3943    #[serde(skip_serializing_if = "Option::is_none")]
3944    pub layers: Option<Vec<String>>,
3945
3946}
3947
3948/// ImageManifestSummary represents a summary of an image manifest. 
3949#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3950pub struct ImageManifestSummary {
3951    /// ID is the content-addressable ID of an image and is the same as the digest of the image manifest. 
3952    #[serde(rename = "ID")]
3953    pub id: String,
3954
3955    #[serde(rename = "Descriptor")]
3956    pub descriptor: OciDescriptor,
3957
3958    /// Indicates whether all the child content (image config, layers) is fully available locally.
3959    #[serde(rename = "Available")]
3960    pub available: bool,
3961
3962    #[serde(rename = "Size")]
3963    pub size: ImageManifestSummarySize,
3964
3965    /// The kind of the manifest.  kind         | description -------------|----------------------------------------------------------- image        | Image manifest that can be used to start a container. attestation  | Attestation manifest produced by the Buildkit builder for a specific image manifest. 
3966    #[serde(rename = "Kind")]
3967    #[serde(skip_serializing_if = "Option::is_none")]
3968    #[serde(with = "::serde_with::As::<::serde_with::NoneAsEmptyString>")]
3969    pub kind: Option<ImageManifestSummaryKindEnum>,
3970
3971    #[serde(rename = "ImageData")]
3972    #[serde(skip_serializing_if = "Option::is_none")]
3973    pub image_data: Option<ImageManifestSummaryImageData>,
3974
3975    #[serde(rename = "AttestationData")]
3976    #[serde(skip_serializing_if = "Option::is_none")]
3977    pub attestation_data: Option<ImageManifestSummaryAttestationData>,
3978
3979}
3980
3981#[allow(non_camel_case_types)]
3982#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
3983pub enum ImageManifestSummaryKindEnum { 
3984    #[serde(rename = "")]
3985    EMPTY,
3986    #[serde(rename = "image")]
3987    IMAGE,
3988    #[serde(rename = "attestation")]
3989    ATTESTATION,
3990    #[serde(rename = "unknown")]
3991    UNKNOWN,
3992}
3993
3994impl ::std::fmt::Display for ImageManifestSummaryKindEnum {
3995    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
3996        match *self { 
3997            ImageManifestSummaryKindEnum::EMPTY => write!(f, ""),
3998            ImageManifestSummaryKindEnum::IMAGE => write!(f, "{}", "image"),
3999            ImageManifestSummaryKindEnum::ATTESTATION => write!(f, "{}", "attestation"),
4000            ImageManifestSummaryKindEnum::UNKNOWN => write!(f, "{}", "unknown"),
4001
4002        }
4003    }
4004}
4005
4006impl ::std::str::FromStr for ImageManifestSummaryKindEnum {
4007    type Err = String;
4008    fn from_str(s: &str) -> Result<Self, Self::Err> {
4009        match s { 
4010            "" => Ok(ImageManifestSummaryKindEnum::EMPTY),
4011            "image" => Ok(ImageManifestSummaryKindEnum::IMAGE),
4012            "attestation" => Ok(ImageManifestSummaryKindEnum::ATTESTATION),
4013            "unknown" => Ok(ImageManifestSummaryKindEnum::UNKNOWN),
4014            x => Err(format!("Invalid enum type: {}", x)),
4015        }
4016    }
4017}
4018
4019impl ::std::convert::AsRef<str> for ImageManifestSummaryKindEnum {
4020    fn as_ref(&self) -> &str {
4021        match self { 
4022            ImageManifestSummaryKindEnum::EMPTY => "",
4023            ImageManifestSummaryKindEnum::IMAGE => "image",
4024            ImageManifestSummaryKindEnum::ATTESTATION => "attestation",
4025            ImageManifestSummaryKindEnum::UNKNOWN => "unknown",
4026        }
4027    }
4028}
4029
4030/// The image data for the attestation manifest. This field is only populated when Kind is \"attestation\". 
4031#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4032pub struct ImageManifestSummaryAttestationData {
4033    /// The digest of the image manifest that this attestation is for. 
4034    #[serde(rename = "For")]
4035    pub _for: String,
4036
4037}
4038
4039/// The image data for the image manifest. This field is only populated when Kind is \"image\". 
4040#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4041pub struct ImageManifestSummaryImageData {
4042    /// OCI platform of the image. This will be the platform specified in the manifest descriptor from the index/manifest list. If it's not available, it will be obtained from the image config. 
4043    #[serde(rename = "Platform")]
4044    pub platform: OciPlatform,
4045
4046    /// The IDs of the containers that are using this image. 
4047    #[serde(rename = "Containers")]
4048    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
4049    pub containers: Vec<String>,
4050
4051    #[serde(rename = "Size")]
4052    pub size: ImageManifestSummaryImageDataSize,
4053
4054}
4055
4056#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4057pub struct ImageManifestSummaryImageDataSize {
4058    /// Unpacked is the size (in bytes) of the locally unpacked (uncompressed) image content that's directly usable by the containers running this image. It's independent of the distributable content - e.g. the image might still have an unpacked data that's still used by some container even when the distributable/compressed content is already gone. 
4059    #[serde(rename = "Unpacked")]
4060    pub unpacked: i64,
4061
4062}
4063
4064#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4065pub struct ImageManifestSummarySize {
4066    /// Total is the total size (in bytes) of all the locally present data (both distributable and non-distributable) that's related to this manifest and its children. This equal to the sum of [Content] size AND all the sizes in the [Size] struct present in the Kind-specific data struct. For example, for an image kind (Kind == \"image\") this would include the size of the image content and unpacked image snapshots ([Size.Content] + [ImageData.Size.Unpacked]). 
4067    #[serde(rename = "Total")]
4068    pub total: i64,
4069
4070    /// Content is the size (in bytes) of all the locally present content in the content store (e.g. image config, layers) referenced by this manifest and its children. This only includes blobs in the content store. 
4071    #[serde(rename = "Content")]
4072    pub content: i64,
4073
4074}
4075
4076#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4077pub struct ImagePruneResponse {
4078    /// Images that were deleted
4079    #[serde(rename = "ImagesDeleted")]
4080    #[serde(skip_serializing_if = "Option::is_none")]
4081    pub images_deleted: Option<Vec<ImageDeleteResponseItem>>,
4082
4083    /// Disk space reclaimed in bytes
4084    #[serde(rename = "SpaceReclaimed")]
4085    #[serde(skip_serializing_if = "Option::is_none")]
4086    pub space_reclaimed: Option<i64>,
4087
4088}
4089
4090#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4091pub struct ImageSearchResponseItem {
4092    #[serde(rename = "description")]
4093    #[serde(skip_serializing_if = "Option::is_none")]
4094    pub description: Option<String>,
4095
4096    #[serde(rename = "is_official")]
4097    #[serde(skip_serializing_if = "Option::is_none")]
4098    pub is_official: Option<bool>,
4099
4100    /// Whether this repository has automated builds enabled.  <p><br /></p>  > **Deprecated**: This field is deprecated and will always be \"false\". 
4101    #[serde(rename = "is_automated")]
4102    #[serde(skip_serializing_if = "Option::is_none")]
4103    pub is_automated: Option<bool>,
4104
4105    #[serde(rename = "name")]
4106    #[serde(skip_serializing_if = "Option::is_none")]
4107    pub name: Option<String>,
4108
4109    #[serde(rename = "star_count")]
4110    #[serde(skip_serializing_if = "Option::is_none")]
4111    pub star_count: Option<i64>,
4112
4113}
4114
4115#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4116pub struct ImageSummary {
4117    /// ID is the content-addressable ID of an image.  This identifier is a content-addressable digest calculated from the image's configuration (which includes the digests of layers used by the image).  Note that this digest differs from the `RepoDigests` below, which holds digests of image manifests that reference the image. 
4118    #[serde(rename = "Id")]
4119    pub id: String,
4120
4121    /// ID of the parent image.  Depending on how the image was created, this field may be empty and is only set for images that were built/created locally. This field is empty if the image was pulled from an image registry. 
4122    #[serde(rename = "ParentId")]
4123    pub parent_id: String,
4124
4125    /// List of image names/tags in the local image cache that reference this image.  Multiple image tags can refer to the same image, and this list may be empty if no tags reference the image, in which case the image is \"untagged\", in which case it can still be referenced by its ID. 
4126    #[serde(rename = "RepoTags")]
4127    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
4128    pub repo_tags: Vec<String>,
4129
4130    /// List of content-addressable digests of locally available image manifests that the image is referenced from. Multiple manifests can refer to the same image.  These digests are usually only available if the image was either pulled from a registry, or if the image was pushed to a registry, which is when the manifest is generated and its digest calculated. 
4131    #[serde(rename = "RepoDigests")]
4132    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
4133    pub repo_digests: Vec<String>,
4134
4135    /// Date and time at which the image was created as a Unix timestamp (number of seconds since EPOCH). 
4136    #[serde(rename = "Created")]
4137    pub created: i64,
4138
4139    /// Total size of the image including all layers it is composed of. 
4140    #[serde(rename = "Size")]
4141    pub size: i64,
4142
4143    /// Total size of image layers that are shared between this image and other images.  This size is not calculated by default. `-1` indicates that the value has not been set / calculated. 
4144    #[serde(rename = "SharedSize")]
4145    pub shared_size: i64,
4146
4147    /// Total size of the image including all layers it is composed of.  Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead.
4148    #[serde(rename = "VirtualSize")]
4149    #[serde(skip_serializing_if = "Option::is_none")]
4150    pub virtual_size: Option<i64>,
4151
4152    /// User-defined key/value metadata.
4153    #[serde(rename = "Labels")]
4154    #[serde(deserialize_with = "deserialize_nonoptional_map")]
4155    pub labels: HashMap<String, String>,
4156
4157    /// Number of containers using this image. Includes both stopped and running containers.  This size is not calculated by default, and depends on which API endpoint is used. `-1` indicates that the value has not been set / calculated. 
4158    #[serde(rename = "Containers")]
4159    pub containers: i64,
4160
4161    /// Manifests is a list of manifests available in this image. It provides a more detailed view of the platform-specific image manifests or other image-attached data like build attestations.  WARNING: This is experimental and may change at any time without any backward compatibility. 
4162    #[serde(rename = "Manifests")]
4163    #[serde(skip_serializing_if = "Option::is_none")]
4164    pub manifests: Option<Vec<ImageManifestSummary>>,
4165
4166    /// Descriptor is an OCI descriptor of the image target. In case of a multi-platform image, this descriptor points to the OCI index or a manifest list.  This field is only present if the daemon provides a multi-platform image store.  WARNING: This is experimental and may change at any time without any backward compatibility. 
4167    #[serde(rename = "Descriptor")]
4168    #[serde(skip_serializing_if = "Option::is_none")]
4169    pub descriptor: Option<OciDescriptor>,
4170
4171}
4172
4173/// IndexInfo contains information about a registry.
4174#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4175pub struct IndexInfo {
4176    /// Name of the registry, such as \"docker.io\". 
4177    #[serde(rename = "Name")]
4178    #[serde(skip_serializing_if = "Option::is_none")]
4179    pub name: Option<String>,
4180
4181    /// List of mirrors, expressed as URIs. 
4182    #[serde(rename = "Mirrors")]
4183    #[serde(skip_serializing_if = "Option::is_none")]
4184    pub mirrors: Option<Vec<String>>,
4185
4186    /// 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. 
4187    #[serde(rename = "Secure")]
4188    #[serde(skip_serializing_if = "Option::is_none")]
4189    pub secure: Option<bool>,
4190
4191    /// Indicates whether this is an official registry (i.e., Docker Hub / docker.io) 
4192    #[serde(rename = "Official")]
4193    #[serde(skip_serializing_if = "Option::is_none")]
4194    pub official: Option<bool>,
4195
4196}
4197
4198#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4199pub struct Ipam {
4200    /// Name of the IPAM driver to use.
4201    #[serde(rename = "Driver")]
4202    #[serde(skip_serializing_if = "Option::is_none")]
4203    pub driver: Option<String>,
4204
4205    /// List of IPAM configuration options, specified as a map:  ``` {\"Subnet\": <CIDR>, \"IPRange\": <CIDR>, \"Gateway\": <IP address>, \"AuxAddress\": <device_name:IP address>} ``` 
4206    #[serde(rename = "Config")]
4207    #[serde(skip_serializing_if = "Option::is_none")]
4208    pub config: Option<Vec<IpamConfig>>,
4209
4210    /// Driver-specific options, specified as a map.
4211    #[serde(rename = "Options")]
4212    #[serde(skip_serializing_if = "Option::is_none")]
4213    pub options: Option<HashMap<String, String>>,
4214
4215}
4216
4217#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4218pub struct IpamConfig {
4219    #[serde(rename = "Subnet")]
4220    #[serde(skip_serializing_if = "Option::is_none")]
4221    pub subnet: Option<String>,
4222
4223    #[serde(rename = "IPRange")]
4224    #[serde(skip_serializing_if = "Option::is_none")]
4225    pub ip_range: Option<String>,
4226
4227    #[serde(rename = "Gateway")]
4228    #[serde(skip_serializing_if = "Option::is_none")]
4229    pub gateway: Option<String>,
4230
4231    #[serde(rename = "AuxiliaryAddresses")]
4232    #[serde(skip_serializing_if = "Option::is_none")]
4233    pub auxiliary_addresses: Option<HashMap<String, String>>,
4234
4235}
4236
4237/// JoinTokens contains the tokens workers and managers need to join the swarm. 
4238#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4239pub struct JoinTokens {
4240    /// The token workers can use to join the swarm. 
4241    #[serde(rename = "Worker")]
4242    #[serde(skip_serializing_if = "Option::is_none")]
4243    pub worker: Option<String>,
4244
4245    /// The token managers can use to join the swarm. 
4246    #[serde(rename = "Manager")]
4247    #[serde(skip_serializing_if = "Option::is_none")]
4248    pub manager: Option<String>,
4249
4250}
4251
4252/// An object describing a limit on resources which can be requested by a task. 
4253#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4254pub struct Limit {
4255    #[serde(rename = "NanoCPUs")]
4256    #[serde(skip_serializing_if = "Option::is_none")]
4257    pub nano_cpus: Option<i64>,
4258
4259    #[serde(rename = "MemoryBytes")]
4260    #[serde(skip_serializing_if = "Option::is_none")]
4261    pub memory_bytes: Option<i64>,
4262
4263    /// Limits the maximum number of PIDs in the container. Set `0` for unlimited. 
4264    #[serde(rename = "Pids")]
4265    #[serde(skip_serializing_if = "Option::is_none")]
4266    pub pids: Option<i64>,
4267
4268}
4269
4270/// Current local status of this node.
4271/// Enumeration of values.
4272/// Since this enum's variants do not hold data, we can easily define them them as `#[repr(C)]`
4273/// which helps with FFI.
4274#[allow(non_camel_case_types)]
4275#[repr(C)]
4276#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
4277pub enum LocalNodeState { 
4278    #[serde(rename = "")]
4279    EMPTY,
4280    #[serde(rename = "inactive")]
4281    INACTIVE,
4282    #[serde(rename = "pending")]
4283    PENDING,
4284    #[serde(rename = "active")]
4285    ACTIVE,
4286    #[serde(rename = "error")]
4287    ERROR,
4288    #[serde(rename = "locked")]
4289    LOCKED,
4290}
4291
4292impl ::std::fmt::Display for LocalNodeState {
4293    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
4294        match *self { 
4295            LocalNodeState::EMPTY => write!(f, "{}", ""),
4296            LocalNodeState::INACTIVE => write!(f, "{}", "inactive"),
4297            LocalNodeState::PENDING => write!(f, "{}", "pending"),
4298            LocalNodeState::ACTIVE => write!(f, "{}", "active"),
4299            LocalNodeState::ERROR => write!(f, "{}", "error"),
4300            LocalNodeState::LOCKED => write!(f, "{}", "locked"),
4301        }
4302    }
4303}
4304
4305impl ::std::str::FromStr for LocalNodeState {
4306    type Err = ();
4307    fn from_str(s: &str) -> Result<Self, Self::Err> {
4308        match s {
4309            "" => Ok(LocalNodeState::EMPTY),
4310            "inactive" => Ok(LocalNodeState::INACTIVE),
4311            "pending" => Ok(LocalNodeState::PENDING),
4312            "active" => Ok(LocalNodeState::ACTIVE),
4313            "error" => Ok(LocalNodeState::ERROR),
4314            "locked" => Ok(LocalNodeState::LOCKED),
4315            _ => Err(()),
4316        }
4317    }
4318}
4319
4320impl std::default::Default for LocalNodeState {
4321    fn default() -> Self { 
4322        LocalNodeState::EMPTY
4323    }
4324}
4325
4326/// ManagerStatus represents the status of a manager.  It provides the current status of a node's manager component, if the node is a manager. 
4327#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4328pub struct ManagerStatus {
4329    #[serde(rename = "Leader")]
4330    #[serde(skip_serializing_if = "Option::is_none")]
4331    pub leader: Option<bool>,
4332
4333    #[serde(rename = "Reachability")]
4334    #[serde(skip_serializing_if = "Option::is_none")]
4335    pub reachability: Option<Reachability>,
4336
4337    /// The IP address and port at which the manager is reachable. 
4338    #[serde(rename = "Addr")]
4339    #[serde(skip_serializing_if = "Option::is_none")]
4340    pub addr: Option<String>,
4341
4342}
4343
4344#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4345pub struct Mount {
4346    /// Container path.
4347    #[serde(rename = "Target")]
4348    #[serde(skip_serializing_if = "Option::is_none")]
4349    pub target: Option<String>,
4350
4351    /// Mount source (e.g. a volume name, a host path).
4352    #[serde(rename = "Source")]
4353    #[serde(skip_serializing_if = "Option::is_none")]
4354    pub source: Option<String>,
4355
4356    /// 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. - `image` Mounts an image. - `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. - `cluster` a Swarm cluster volume 
4357    #[serde(rename = "Type")]
4358    #[serde(skip_serializing_if = "Option::is_none")]
4359    pub typ: Option<MountTypeEnum>,
4360
4361    /// Whether the mount should be read-only.
4362    #[serde(rename = "ReadOnly")]
4363    #[serde(skip_serializing_if = "Option::is_none")]
4364    pub read_only: Option<bool>,
4365
4366    /// The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`.
4367    #[serde(rename = "Consistency")]
4368    #[serde(skip_serializing_if = "Option::is_none")]
4369    pub consistency: Option<String>,
4370
4371    #[serde(rename = "BindOptions")]
4372    #[serde(skip_serializing_if = "Option::is_none")]
4373    pub bind_options: Option<MountBindOptions>,
4374
4375    #[serde(rename = "VolumeOptions")]
4376    #[serde(skip_serializing_if = "Option::is_none")]
4377    pub volume_options: Option<MountVolumeOptions>,
4378
4379    #[serde(rename = "ImageOptions")]
4380    #[serde(skip_serializing_if = "Option::is_none")]
4381    pub image_options: Option<MountImageOptions>,
4382
4383    #[serde(rename = "TmpfsOptions")]
4384    #[serde(skip_serializing_if = "Option::is_none")]
4385    pub tmpfs_options: Option<MountTmpfsOptions>,
4386
4387}
4388
4389#[allow(non_camel_case_types)]
4390#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
4391pub enum MountTypeEnum { 
4392    #[serde(rename = "")]
4393    EMPTY,
4394    #[serde(rename = "bind")]
4395    BIND,
4396    #[serde(rename = "volume")]
4397    VOLUME,
4398    #[serde(rename = "image")]
4399    IMAGE,
4400    #[serde(rename = "tmpfs")]
4401    TMPFS,
4402    #[serde(rename = "npipe")]
4403    NPIPE,
4404    #[serde(rename = "cluster")]
4405    CLUSTER,
4406}
4407
4408impl ::std::fmt::Display for MountTypeEnum {
4409    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
4410        match *self { 
4411            MountTypeEnum::EMPTY => write!(f, ""),
4412            MountTypeEnum::BIND => write!(f, "{}", "bind"),
4413            MountTypeEnum::VOLUME => write!(f, "{}", "volume"),
4414            MountTypeEnum::IMAGE => write!(f, "{}", "image"),
4415            MountTypeEnum::TMPFS => write!(f, "{}", "tmpfs"),
4416            MountTypeEnum::NPIPE => write!(f, "{}", "npipe"),
4417            MountTypeEnum::CLUSTER => write!(f, "{}", "cluster"),
4418
4419        }
4420    }
4421}
4422
4423impl ::std::str::FromStr for MountTypeEnum {
4424    type Err = String;
4425    fn from_str(s: &str) -> Result<Self, Self::Err> {
4426        match s { 
4427            "" => Ok(MountTypeEnum::EMPTY),
4428            "bind" => Ok(MountTypeEnum::BIND),
4429            "volume" => Ok(MountTypeEnum::VOLUME),
4430            "image" => Ok(MountTypeEnum::IMAGE),
4431            "tmpfs" => Ok(MountTypeEnum::TMPFS),
4432            "npipe" => Ok(MountTypeEnum::NPIPE),
4433            "cluster" => Ok(MountTypeEnum::CLUSTER),
4434            x => Err(format!("Invalid enum type: {}", x)),
4435        }
4436    }
4437}
4438
4439impl ::std::convert::AsRef<str> for MountTypeEnum {
4440    fn as_ref(&self) -> &str {
4441        match self { 
4442            MountTypeEnum::EMPTY => "",
4443            MountTypeEnum::BIND => "bind",
4444            MountTypeEnum::VOLUME => "volume",
4445            MountTypeEnum::IMAGE => "image",
4446            MountTypeEnum::TMPFS => "tmpfs",
4447            MountTypeEnum::NPIPE => "npipe",
4448            MountTypeEnum::CLUSTER => "cluster",
4449        }
4450    }
4451}
4452
4453/// Optional configuration for the `bind` type.
4454#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4455pub struct MountBindOptions {
4456    /// A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.
4457    #[serde(rename = "Propagation")]
4458    #[serde(skip_serializing_if = "Option::is_none")]
4459    pub propagation: Option<MountBindOptionsPropagationEnum>,
4460
4461    /// Disable recursive bind mount.
4462    #[serde(rename = "NonRecursive")]
4463    #[serde(skip_serializing_if = "Option::is_none")]
4464    pub non_recursive: Option<bool>,
4465
4466    /// Create mount point on host if missing
4467    #[serde(rename = "CreateMountpoint")]
4468    #[serde(skip_serializing_if = "Option::is_none")]
4469    pub create_mountpoint: Option<bool>,
4470
4471    /// Make the mount non-recursively read-only, but still leave the mount recursive (unless NonRecursive is set to `true` in conjunction).  Added in v1.44, before that version all read-only mounts were non-recursive by default. To match the previous behaviour this will default to `true` for clients on versions prior to v1.44. 
4472    #[serde(rename = "ReadOnlyNonRecursive")]
4473    #[serde(skip_serializing_if = "Option::is_none")]
4474    pub read_only_non_recursive: Option<bool>,
4475
4476    /// Raise an error if the mount cannot be made recursively read-only.
4477    #[serde(rename = "ReadOnlyForceRecursive")]
4478    #[serde(skip_serializing_if = "Option::is_none")]
4479    pub read_only_force_recursive: Option<bool>,
4480
4481}
4482
4483#[allow(non_camel_case_types)]
4484#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
4485pub enum MountBindOptionsPropagationEnum { 
4486    #[serde(rename = "")]
4487    EMPTY,
4488    #[serde(rename = "private")]
4489    PRIVATE,
4490    #[serde(rename = "rprivate")]
4491    RPRIVATE,
4492    #[serde(rename = "shared")]
4493    SHARED,
4494    #[serde(rename = "rshared")]
4495    RSHARED,
4496    #[serde(rename = "slave")]
4497    SLAVE,
4498    #[serde(rename = "rslave")]
4499    RSLAVE,
4500}
4501
4502impl ::std::fmt::Display for MountBindOptionsPropagationEnum {
4503    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
4504        match *self { 
4505            MountBindOptionsPropagationEnum::EMPTY => write!(f, ""),
4506            MountBindOptionsPropagationEnum::PRIVATE => write!(f, "{}", "private"),
4507            MountBindOptionsPropagationEnum::RPRIVATE => write!(f, "{}", "rprivate"),
4508            MountBindOptionsPropagationEnum::SHARED => write!(f, "{}", "shared"),
4509            MountBindOptionsPropagationEnum::RSHARED => write!(f, "{}", "rshared"),
4510            MountBindOptionsPropagationEnum::SLAVE => write!(f, "{}", "slave"),
4511            MountBindOptionsPropagationEnum::RSLAVE => write!(f, "{}", "rslave"),
4512
4513        }
4514    }
4515}
4516
4517impl ::std::str::FromStr for MountBindOptionsPropagationEnum {
4518    type Err = String;
4519    fn from_str(s: &str) -> Result<Self, Self::Err> {
4520        match s { 
4521            "" => Ok(MountBindOptionsPropagationEnum::EMPTY),
4522            "private" => Ok(MountBindOptionsPropagationEnum::PRIVATE),
4523            "rprivate" => Ok(MountBindOptionsPropagationEnum::RPRIVATE),
4524            "shared" => Ok(MountBindOptionsPropagationEnum::SHARED),
4525            "rshared" => Ok(MountBindOptionsPropagationEnum::RSHARED),
4526            "slave" => Ok(MountBindOptionsPropagationEnum::SLAVE),
4527            "rslave" => Ok(MountBindOptionsPropagationEnum::RSLAVE),
4528            x => Err(format!("Invalid enum type: {}", x)),
4529        }
4530    }
4531}
4532
4533impl ::std::convert::AsRef<str> for MountBindOptionsPropagationEnum {
4534    fn as_ref(&self) -> &str {
4535        match self { 
4536            MountBindOptionsPropagationEnum::EMPTY => "",
4537            MountBindOptionsPropagationEnum::PRIVATE => "private",
4538            MountBindOptionsPropagationEnum::RPRIVATE => "rprivate",
4539            MountBindOptionsPropagationEnum::SHARED => "shared",
4540            MountBindOptionsPropagationEnum::RSHARED => "rshared",
4541            MountBindOptionsPropagationEnum::SLAVE => "slave",
4542            MountBindOptionsPropagationEnum::RSLAVE => "rslave",
4543        }
4544    }
4545}
4546
4547/// Optional configuration for the `image` type.
4548#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4549pub struct MountImageOptions {
4550    /// Source path inside the image. Must be relative without any back traversals.
4551    #[serde(rename = "Subpath")]
4552    #[serde(skip_serializing_if = "Option::is_none")]
4553    pub subpath: Option<String>,
4554
4555}
4556
4557/// MountPoint represents a mount point configuration inside the container. This is used for reporting the mountpoints in use by a container. 
4558#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4559pub struct MountPoint {
4560    /// The mount type:  - `bind` a mount of a file or directory from the host into the container. - `volume` a docker volume with the given `Name`. - `image` a docker image - `tmpfs` a `tmpfs`. - `npipe` a named pipe from the host into the container. - `cluster` a Swarm cluster volume 
4561    #[serde(rename = "Type")]
4562    #[serde(skip_serializing_if = "Option::is_none")]
4563    pub typ: Option<MountPointTypeEnum>,
4564
4565    /// Name is the name reference to the underlying data defined by `Source` e.g., the volume name. 
4566    #[serde(rename = "Name")]
4567    #[serde(skip_serializing_if = "Option::is_none")]
4568    pub name: Option<String>,
4569
4570    /// Source location of the mount.  For volumes, this contains the storage location of the volume (within `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains the source (host) part of the bind-mount. For `tmpfs` mount points, this field is empty. 
4571    #[serde(rename = "Source")]
4572    #[serde(skip_serializing_if = "Option::is_none")]
4573    pub source: Option<String>,
4574
4575    /// Destination is the path relative to the container root (`/`) where the `Source` is mounted inside the container. 
4576    #[serde(rename = "Destination")]
4577    #[serde(skip_serializing_if = "Option::is_none")]
4578    pub destination: Option<String>,
4579
4580    /// Driver is the volume driver used to create the volume (if it is a volume). 
4581    #[serde(rename = "Driver")]
4582    #[serde(skip_serializing_if = "Option::is_none")]
4583    pub driver: Option<String>,
4584
4585    /// Mode is a comma separated list of options supplied by the user when creating the bind/volume mount.  The default is platform-specific (`\"z\"` on Linux, empty on Windows). 
4586    #[serde(rename = "Mode")]
4587    #[serde(skip_serializing_if = "Option::is_none")]
4588    pub mode: Option<String>,
4589
4590    /// Whether the mount is mounted writable (read-write). 
4591    #[serde(rename = "RW")]
4592    #[serde(skip_serializing_if = "Option::is_none")]
4593    pub rw: Option<bool>,
4594
4595    /// Propagation describes how mounts are propagated from the host into the mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) for details. This field is not used on Windows. 
4596    #[serde(rename = "Propagation")]
4597    #[serde(skip_serializing_if = "Option::is_none")]
4598    pub propagation: Option<String>,
4599
4600}
4601
4602#[allow(non_camel_case_types)]
4603#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
4604pub enum MountPointTypeEnum { 
4605    #[serde(rename = "")]
4606    EMPTY,
4607    #[serde(rename = "bind")]
4608    BIND,
4609    #[serde(rename = "volume")]
4610    VOLUME,
4611    #[serde(rename = "image")]
4612    IMAGE,
4613    #[serde(rename = "tmpfs")]
4614    TMPFS,
4615    #[serde(rename = "npipe")]
4616    NPIPE,
4617    #[serde(rename = "cluster")]
4618    CLUSTER,
4619}
4620
4621impl ::std::fmt::Display for MountPointTypeEnum {
4622    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
4623        match *self { 
4624            MountPointTypeEnum::EMPTY => write!(f, ""),
4625            MountPointTypeEnum::BIND => write!(f, "{}", "bind"),
4626            MountPointTypeEnum::VOLUME => write!(f, "{}", "volume"),
4627            MountPointTypeEnum::IMAGE => write!(f, "{}", "image"),
4628            MountPointTypeEnum::TMPFS => write!(f, "{}", "tmpfs"),
4629            MountPointTypeEnum::NPIPE => write!(f, "{}", "npipe"),
4630            MountPointTypeEnum::CLUSTER => write!(f, "{}", "cluster"),
4631
4632        }
4633    }
4634}
4635
4636impl ::std::str::FromStr for MountPointTypeEnum {
4637    type Err = String;
4638    fn from_str(s: &str) -> Result<Self, Self::Err> {
4639        match s { 
4640            "" => Ok(MountPointTypeEnum::EMPTY),
4641            "bind" => Ok(MountPointTypeEnum::BIND),
4642            "volume" => Ok(MountPointTypeEnum::VOLUME),
4643            "image" => Ok(MountPointTypeEnum::IMAGE),
4644            "tmpfs" => Ok(MountPointTypeEnum::TMPFS),
4645            "npipe" => Ok(MountPointTypeEnum::NPIPE),
4646            "cluster" => Ok(MountPointTypeEnum::CLUSTER),
4647            x => Err(format!("Invalid enum type: {}", x)),
4648        }
4649    }
4650}
4651
4652impl ::std::convert::AsRef<str> for MountPointTypeEnum {
4653    fn as_ref(&self) -> &str {
4654        match self { 
4655            MountPointTypeEnum::EMPTY => "",
4656            MountPointTypeEnum::BIND => "bind",
4657            MountPointTypeEnum::VOLUME => "volume",
4658            MountPointTypeEnum::IMAGE => "image",
4659            MountPointTypeEnum::TMPFS => "tmpfs",
4660            MountPointTypeEnum::NPIPE => "npipe",
4661            MountPointTypeEnum::CLUSTER => "cluster",
4662        }
4663    }
4664}
4665
4666/// Optional configuration for the `tmpfs` type.
4667#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4668pub struct MountTmpfsOptions {
4669    /// The size for the tmpfs mount in bytes.
4670    #[serde(rename = "SizeBytes")]
4671    #[serde(skip_serializing_if = "Option::is_none")]
4672    pub size_bytes: Option<i64>,
4673
4674    /// The permission mode for the tmpfs mount in an integer.
4675    #[serde(rename = "Mode")]
4676    #[serde(skip_serializing_if = "Option::is_none")]
4677    pub mode: Option<i64>,
4678
4679    /// The options to be passed to the tmpfs mount. An array of arrays. Flag options should be provided as 1-length arrays. Other types should be provided as as 2-length arrays, where the first item is the key and the second the value. 
4680    #[serde(rename = "Options")]
4681    #[serde(skip_serializing_if = "Option::is_none")]
4682    pub options: Option<Vec<Vec<String>>>,
4683
4684}
4685
4686/// Optional configuration for the `volume` type.
4687#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4688pub struct MountVolumeOptions {
4689    /// Populate volume with data from the target.
4690    #[serde(rename = "NoCopy")]
4691    #[serde(skip_serializing_if = "Option::is_none")]
4692    pub no_copy: Option<bool>,
4693
4694    /// User-defined key/value metadata.
4695    #[serde(rename = "Labels")]
4696    #[serde(skip_serializing_if = "Option::is_none")]
4697    pub labels: Option<HashMap<String, String>>,
4698
4699    #[serde(rename = "DriverConfig")]
4700    #[serde(skip_serializing_if = "Option::is_none")]
4701    pub driver_config: Option<MountVolumeOptionsDriverConfig>,
4702
4703    /// Source path inside the volume. Must be relative without any back traversals.
4704    #[serde(rename = "Subpath")]
4705    #[serde(skip_serializing_if = "Option::is_none")]
4706    pub subpath: Option<String>,
4707
4708}
4709
4710/// Map of driver specific options
4711#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4712pub struct MountVolumeOptionsDriverConfig {
4713    /// Name of the driver to use to create the volume.
4714    #[serde(rename = "Name")]
4715    #[serde(skip_serializing_if = "Option::is_none")]
4716    pub name: Option<String>,
4717
4718    /// key/value map of driver specific options.
4719    #[serde(rename = "Options")]
4720    #[serde(skip_serializing_if = "Option::is_none")]
4721    pub options: Option<HashMap<String, String>>,
4722
4723}
4724
4725#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4726pub struct Network {
4727    /// Name of the network. 
4728    #[serde(rename = "Name")]
4729    #[serde(skip_serializing_if = "Option::is_none")]
4730    pub name: Option<String>,
4731
4732    /// ID that uniquely identifies a network on a single machine. 
4733    #[serde(rename = "Id")]
4734    #[serde(skip_serializing_if = "Option::is_none")]
4735    pub id: Option<String>,
4736
4737    /// Date and time at which the network was created in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
4738    #[serde(rename = "Created")]
4739    #[serde(skip_serializing_if = "Option::is_none")]
4740    #[serde(
4741        default,
4742        deserialize_with = "deserialize_timestamp",
4743        serialize_with = "serialize_timestamp"
4744    )]
4745    pub created: Option<BollardDate>,
4746
4747    /// The level at which the network exists (e.g. `swarm` for cluster-wide or `local` for machine level) 
4748    #[serde(rename = "Scope")]
4749    #[serde(skip_serializing_if = "Option::is_none")]
4750    pub scope: Option<String>,
4751
4752    /// The name of the driver used to create the network (e.g. `bridge`, `overlay`). 
4753    #[serde(rename = "Driver")]
4754    #[serde(skip_serializing_if = "Option::is_none")]
4755    pub driver: Option<String>,
4756
4757    /// Whether the network was created with IPv4 enabled. 
4758    #[serde(rename = "EnableIPv4")]
4759    #[serde(skip_serializing_if = "Option::is_none")]
4760    pub enable_ipv4: Option<bool>,
4761
4762    /// Whether the network was created with IPv6 enabled. 
4763    #[serde(rename = "EnableIPv6")]
4764    #[serde(skip_serializing_if = "Option::is_none")]
4765    pub enable_ipv6: Option<bool>,
4766
4767    #[serde(rename = "IPAM")]
4768    #[serde(skip_serializing_if = "Option::is_none")]
4769    pub ipam: Option<Ipam>,
4770
4771    /// Whether the network is created to only allow internal networking connectivity. 
4772    #[serde(rename = "Internal")]
4773    #[serde(skip_serializing_if = "Option::is_none")]
4774    pub internal: Option<bool>,
4775
4776    /// Whether a global / swarm scope network is manually attachable by regular containers from workers in swarm mode. 
4777    #[serde(rename = "Attachable")]
4778    #[serde(skip_serializing_if = "Option::is_none")]
4779    pub attachable: Option<bool>,
4780
4781    /// Whether the network is providing the routing-mesh for the swarm cluster. 
4782    #[serde(rename = "Ingress")]
4783    #[serde(skip_serializing_if = "Option::is_none")]
4784    pub ingress: Option<bool>,
4785
4786    #[serde(rename = "ConfigFrom")]
4787    #[serde(skip_serializing_if = "Option::is_none")]
4788    pub config_from: Option<ConfigReference>,
4789
4790    /// Whether the network is a config-only network. Config-only networks are placeholder networks for network configurations to be used by other networks. Config-only networks cannot be used directly to run containers or services. 
4791    #[serde(rename = "ConfigOnly")]
4792    #[serde(skip_serializing_if = "Option::is_none")]
4793    pub config_only: Option<bool>,
4794
4795    /// Contains endpoints attached to the network. 
4796    #[serde(rename = "Containers")]
4797    #[serde(skip_serializing_if = "Option::is_none")]
4798    pub containers: Option<HashMap<String, NetworkContainer>>,
4799
4800    /// Network-specific options uses when creating the network. 
4801    #[serde(rename = "Options")]
4802    #[serde(skip_serializing_if = "Option::is_none")]
4803    pub options: Option<HashMap<String, String>>,
4804
4805    /// User-defined key/value metadata.
4806    #[serde(rename = "Labels")]
4807    #[serde(skip_serializing_if = "Option::is_none")]
4808    pub labels: Option<HashMap<String, String>>,
4809
4810    /// List of peer nodes for an overlay network. This field is only present for overlay networks, and omitted for other network types. 
4811    #[serde(rename = "Peers")]
4812    #[serde(skip_serializing_if = "Option::is_none")]
4813    pub peers: Option<Vec<PeerInfo>>,
4814
4815}
4816
4817/// Specifies how a service should be attached to a particular network. 
4818#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4819pub struct NetworkAttachmentConfig {
4820    /// The target network for attachment. Must be a network name or ID. 
4821    #[serde(rename = "Target")]
4822    #[serde(skip_serializing_if = "Option::is_none")]
4823    pub target: Option<String>,
4824
4825    /// Discoverable alternate names for the service on this network. 
4826    #[serde(rename = "Aliases")]
4827    #[serde(skip_serializing_if = "Option::is_none")]
4828    pub aliases: Option<Vec<String>>,
4829
4830    /// Driver attachment options for the network target. 
4831    #[serde(rename = "DriverOpts")]
4832    #[serde(skip_serializing_if = "Option::is_none")]
4833    pub driver_opts: Option<HashMap<String, String>>,
4834
4835}
4836
4837#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4838pub struct NetworkConnectRequest {
4839    /// The ID or name of the container to connect to the network.
4840    #[serde(rename = "Container")]
4841    #[serde(skip_serializing_if = "Option::is_none")]
4842    pub container: Option<String>,
4843
4844    #[serde(rename = "EndpointConfig")]
4845    #[serde(skip_serializing_if = "Option::is_none")]
4846    pub endpoint_config: Option<EndpointSettings>,
4847
4848}
4849
4850#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4851pub struct NetworkContainer {
4852    #[serde(rename = "Name")]
4853    #[serde(skip_serializing_if = "Option::is_none")]
4854    pub name: Option<String>,
4855
4856    #[serde(rename = "EndpointID")]
4857    #[serde(skip_serializing_if = "Option::is_none")]
4858    pub endpoint_id: Option<String>,
4859
4860    #[serde(rename = "MacAddress")]
4861    #[serde(skip_serializing_if = "Option::is_none")]
4862    pub mac_address: Option<String>,
4863
4864    #[serde(rename = "IPv4Address")]
4865    #[serde(skip_serializing_if = "Option::is_none")]
4866    pub ipv4_address: Option<String>,
4867
4868    #[serde(rename = "IPv6Address")]
4869    #[serde(skip_serializing_if = "Option::is_none")]
4870    pub ipv6_address: Option<String>,
4871
4872}
4873
4874#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4875pub struct NetworkCreateRequest {
4876    /// The network's name.
4877    #[serde(rename = "Name")]
4878    pub name: String,
4879
4880    /// Name of the network driver plugin to use.
4881    #[serde(rename = "Driver")]
4882    #[serde(skip_serializing_if = "Option::is_none")]
4883    pub driver: Option<String>,
4884
4885    /// The level at which the network exists (e.g. `swarm` for cluster-wide or `local` for machine level). 
4886    #[serde(rename = "Scope")]
4887    #[serde(skip_serializing_if = "Option::is_none")]
4888    pub scope: Option<String>,
4889
4890    /// Restrict external access to the network.
4891    #[serde(rename = "Internal")]
4892    #[serde(skip_serializing_if = "Option::is_none")]
4893    pub internal: Option<bool>,
4894
4895    /// Globally scoped network is manually attachable by regular containers from workers in swarm mode. 
4896    #[serde(rename = "Attachable")]
4897    #[serde(skip_serializing_if = "Option::is_none")]
4898    pub attachable: Option<bool>,
4899
4900    /// Ingress network is the network which provides the routing-mesh in swarm mode. 
4901    #[serde(rename = "Ingress")]
4902    #[serde(skip_serializing_if = "Option::is_none")]
4903    pub ingress: Option<bool>,
4904
4905    /// Creates a config-only network. Config-only networks are placeholder networks for network configurations to be used by other networks. Config-only networks cannot be used directly to run containers or services. 
4906    #[serde(rename = "ConfigOnly")]
4907    #[serde(skip_serializing_if = "Option::is_none")]
4908    pub config_only: Option<bool>,
4909
4910    /// Specifies the source which will provide the configuration for this network. The specified network must be an existing config-only network; see ConfigOnly. 
4911    #[serde(rename = "ConfigFrom")]
4912    #[serde(skip_serializing_if = "Option::is_none")]
4913    pub config_from: Option<ConfigReference>,
4914
4915    /// Optional custom IP scheme for the network.
4916    #[serde(rename = "IPAM")]
4917    #[serde(skip_serializing_if = "Option::is_none")]
4918    pub ipam: Option<Ipam>,
4919
4920    /// Enable IPv4 on the network.
4921    #[serde(rename = "EnableIPv4")]
4922    #[serde(skip_serializing_if = "Option::is_none")]
4923    pub enable_ipv4: Option<bool>,
4924
4925    /// Enable IPv6 on the network.
4926    #[serde(rename = "EnableIPv6")]
4927    #[serde(skip_serializing_if = "Option::is_none")]
4928    pub enable_ipv6: Option<bool>,
4929
4930    /// Network specific options to be used by the drivers.
4931    #[serde(rename = "Options")]
4932    #[serde(skip_serializing_if = "Option::is_none")]
4933    pub options: Option<HashMap<String, String>>,
4934
4935    /// User-defined key/value metadata.
4936    #[serde(rename = "Labels")]
4937    #[serde(skip_serializing_if = "Option::is_none")]
4938    pub labels: Option<HashMap<String, String>>,
4939
4940}
4941
4942/// OK response to NetworkCreate operation
4943#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4944pub struct NetworkCreateResponse {
4945    /// The ID of the created network.
4946    #[serde(rename = "Id")]
4947    pub id: String,
4948
4949    /// Warnings encountered when creating the container
4950    #[serde(rename = "Warning")]
4951    pub warning: String,
4952
4953}
4954
4955#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4956pub struct NetworkDisconnectRequest {
4957    /// The ID or name of the container to disconnect from the network. 
4958    #[serde(rename = "Container")]
4959    #[serde(skip_serializing_if = "Option::is_none")]
4960    pub container: Option<String>,
4961
4962    /// Force the container to disconnect from the network. 
4963    #[serde(rename = "Force")]
4964    #[serde(skip_serializing_if = "Option::is_none")]
4965    pub force: Option<bool>,
4966
4967}
4968
4969#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4970pub struct NetworkPruneResponse {
4971    /// Networks that were deleted
4972    #[serde(rename = "NetworksDeleted")]
4973    #[serde(skip_serializing_if = "Option::is_none")]
4974    pub networks_deleted: Option<Vec<String>>,
4975
4976}
4977
4978/// NetworkSettings exposes the network settings in the API
4979#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4980pub struct NetworkSettings {
4981    /// Name of the default bridge interface when dockerd's --bridge flag is set. 
4982    #[serde(rename = "Bridge")]
4983    #[serde(skip_serializing_if = "Option::is_none")]
4984    pub bridge: Option<String>,
4985
4986    /// SandboxID uniquely represents a container's network stack.
4987    #[serde(rename = "SandboxID")]
4988    #[serde(skip_serializing_if = "Option::is_none")]
4989    pub sandbox_id: Option<String>,
4990
4991    /// Indicates if hairpin NAT should be enabled on the virtual interface.  Deprecated: This field is never set and will be removed in a future release. 
4992    #[serde(rename = "HairpinMode")]
4993    #[serde(skip_serializing_if = "Option::is_none")]
4994    pub hairpin_mode: Option<bool>,
4995
4996    /// IPv6 unicast address using the link-local prefix.  Deprecated: This field is never set and will be removed in a future release. 
4997    #[serde(rename = "LinkLocalIPv6Address")]
4998    #[serde(skip_serializing_if = "Option::is_none")]
4999    pub link_local_ipv6_address: Option<String>,
5000
5001    /// Prefix length of the IPv6 unicast address.  Deprecated: This field is never set and will be removed in a future release. 
5002    #[serde(rename = "LinkLocalIPv6PrefixLen")]
5003    #[serde(skip_serializing_if = "Option::is_none")]
5004    pub link_local_ipv6_prefix_len: Option<i64>,
5005
5006    #[serde(rename = "Ports")]
5007    #[serde(skip_serializing_if = "Option::is_none")]
5008    pub ports: Option<PortMap>,
5009
5010    /// SandboxKey is the full path of the netns handle
5011    #[serde(rename = "SandboxKey")]
5012    #[serde(skip_serializing_if = "Option::is_none")]
5013    pub sandbox_key: Option<String>,
5014
5015    /// Deprecated: This field is never set and will be removed in a future release.
5016    #[serde(rename = "SecondaryIPAddresses")]
5017    #[serde(skip_serializing_if = "Option::is_none")]
5018    pub secondary_ip_addresses: Option<Vec<Address>>,
5019
5020    /// Deprecated: This field is never set and will be removed in a future release.
5021    #[serde(rename = "SecondaryIPv6Addresses")]
5022    #[serde(skip_serializing_if = "Option::is_none")]
5023    pub secondary_ipv6_addresses: Option<Vec<Address>>,
5024
5025    /// 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 
5026    #[serde(rename = "EndpointID")]
5027    #[serde(skip_serializing_if = "Option::is_none")]
5028    pub endpoint_id: Option<String>,
5029
5030    /// 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 
5031    #[serde(rename = "Gateway")]
5032    #[serde(skip_serializing_if = "Option::is_none")]
5033    pub gateway: Option<String>,
5034
5035    /// 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 
5036    #[serde(rename = "GlobalIPv6Address")]
5037    #[serde(skip_serializing_if = "Option::is_none")]
5038    pub global_ipv6_address: Option<String>,
5039
5040    /// 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 
5041    #[serde(rename = "GlobalIPv6PrefixLen")]
5042    #[serde(skip_serializing_if = "Option::is_none")]
5043    pub global_ipv6_prefix_len: Option<i64>,
5044
5045    /// 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 
5046    #[serde(rename = "IPAddress")]
5047    #[serde(skip_serializing_if = "Option::is_none")]
5048    pub ip_address: Option<String>,
5049
5050    /// 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 
5051    #[serde(rename = "IPPrefixLen")]
5052    #[serde(skip_serializing_if = "Option::is_none")]
5053    pub ip_prefix_len: Option<i64>,
5054
5055    /// 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 
5056    #[serde(rename = "IPv6Gateway")]
5057    #[serde(skip_serializing_if = "Option::is_none")]
5058    pub ipv6_gateway: Option<String>,
5059
5060    /// 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 
5061    #[serde(rename = "MacAddress")]
5062    #[serde(skip_serializing_if = "Option::is_none")]
5063    pub mac_address: Option<String>,
5064
5065    /// Information about all networks that the container is connected to. 
5066    #[serde(rename = "Networks")]
5067    #[serde(skip_serializing_if = "Option::is_none")]
5068    pub networks: Option<HashMap<String, EndpointSettings>>,
5069
5070}
5071
5072/// 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. 
5073#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5074pub struct NetworkingConfig {
5075    /// A mapping of network name to endpoint configuration for that network. The endpoint configuration can be left empty to connect to that network with no particular endpoint configuration. 
5076    #[serde(rename = "EndpointsConfig")]
5077    #[serde(skip_serializing_if = "Option::is_none")]
5078    pub endpoints_config: Option<HashMap<String, EndpointSettings>>,
5079
5080}
5081
5082#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5083pub struct Node {
5084    #[serde(rename = "ID")]
5085    #[serde(skip_serializing_if = "Option::is_none")]
5086    pub id: Option<String>,
5087
5088    #[serde(rename = "Version")]
5089    #[serde(skip_serializing_if = "Option::is_none")]
5090    pub version: Option<ObjectVersion>,
5091
5092    /// 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. 
5093    #[serde(rename = "CreatedAt")]
5094    #[serde(skip_serializing_if = "Option::is_none")]
5095    #[serde(
5096        default,
5097        deserialize_with = "deserialize_timestamp",
5098        serialize_with = "serialize_timestamp"
5099    )]
5100    pub created_at: Option<BollardDate>,
5101
5102    /// Date and time at which the node was last updated in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
5103    #[serde(rename = "UpdatedAt")]
5104    #[serde(skip_serializing_if = "Option::is_none")]
5105    #[serde(
5106        default,
5107        deserialize_with = "deserialize_timestamp",
5108        serialize_with = "serialize_timestamp"
5109    )]
5110    pub updated_at: Option<BollardDate>,
5111
5112    #[serde(rename = "Spec")]
5113    #[serde(skip_serializing_if = "Option::is_none")]
5114    pub spec: Option<NodeSpec>,
5115
5116    #[serde(rename = "Description")]
5117    #[serde(skip_serializing_if = "Option::is_none")]
5118    pub description: Option<NodeDescription>,
5119
5120    #[serde(rename = "Status")]
5121    #[serde(skip_serializing_if = "Option::is_none")]
5122    pub status: Option<NodeStatus>,
5123
5124    #[serde(rename = "ManagerStatus")]
5125    #[serde(skip_serializing_if = "Option::is_none")]
5126    pub manager_status: Option<ManagerStatus>,
5127
5128}
5129
5130/// NodeDescription encapsulates the properties of the Node as reported by the agent. 
5131#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5132pub struct NodeDescription {
5133    #[serde(rename = "Hostname")]
5134    #[serde(skip_serializing_if = "Option::is_none")]
5135    pub hostname: Option<String>,
5136
5137    #[serde(rename = "Platform")]
5138    #[serde(skip_serializing_if = "Option::is_none")]
5139    pub platform: Option<Platform>,
5140
5141    #[serde(rename = "Resources")]
5142    #[serde(skip_serializing_if = "Option::is_none")]
5143    pub resources: Option<ResourceObject>,
5144
5145    #[serde(rename = "Engine")]
5146    #[serde(skip_serializing_if = "Option::is_none")]
5147    pub engine: Option<EngineDescription>,
5148
5149    #[serde(rename = "TLSInfo")]
5150    #[serde(skip_serializing_if = "Option::is_none")]
5151    pub tls_info: Option<TlsInfo>,
5152
5153}
5154
5155#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5156pub struct NodeSpec {
5157    /// Name for the node.
5158    #[serde(rename = "Name")]
5159    #[serde(skip_serializing_if = "Option::is_none")]
5160    pub name: Option<String>,
5161
5162    /// User-defined key/value metadata.
5163    #[serde(rename = "Labels")]
5164    #[serde(skip_serializing_if = "Option::is_none")]
5165    pub labels: Option<HashMap<String, String>>,
5166
5167    /// Role of the node.
5168    #[serde(rename = "Role")]
5169    #[serde(skip_serializing_if = "Option::is_none")]
5170    pub role: Option<NodeSpecRoleEnum>,
5171
5172    /// Availability of the node.
5173    #[serde(rename = "Availability")]
5174    #[serde(skip_serializing_if = "Option::is_none")]
5175    pub availability: Option<NodeSpecAvailabilityEnum>,
5176
5177}
5178
5179#[allow(non_camel_case_types)]
5180#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
5181pub enum NodeSpecRoleEnum { 
5182    #[serde(rename = "")]
5183    EMPTY,
5184    #[serde(rename = "worker")]
5185    WORKER,
5186    #[serde(rename = "manager")]
5187    MANAGER,
5188}
5189
5190impl ::std::fmt::Display for NodeSpecRoleEnum {
5191    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
5192        match *self { 
5193            NodeSpecRoleEnum::EMPTY => write!(f, ""),
5194            NodeSpecRoleEnum::WORKER => write!(f, "{}", "worker"),
5195            NodeSpecRoleEnum::MANAGER => write!(f, "{}", "manager"),
5196
5197        }
5198    }
5199}
5200
5201impl ::std::str::FromStr for NodeSpecRoleEnum {
5202    type Err = String;
5203    fn from_str(s: &str) -> Result<Self, Self::Err> {
5204        match s { 
5205            "" => Ok(NodeSpecRoleEnum::EMPTY),
5206            "worker" => Ok(NodeSpecRoleEnum::WORKER),
5207            "manager" => Ok(NodeSpecRoleEnum::MANAGER),
5208            x => Err(format!("Invalid enum type: {}", x)),
5209        }
5210    }
5211}
5212
5213impl ::std::convert::AsRef<str> for NodeSpecRoleEnum {
5214    fn as_ref(&self) -> &str {
5215        match self { 
5216            NodeSpecRoleEnum::EMPTY => "",
5217            NodeSpecRoleEnum::WORKER => "worker",
5218            NodeSpecRoleEnum::MANAGER => "manager",
5219        }
5220    }
5221}
5222
5223#[allow(non_camel_case_types)]
5224#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
5225pub enum NodeSpecAvailabilityEnum { 
5226    #[serde(rename = "")]
5227    EMPTY,
5228    #[serde(rename = "active")]
5229    ACTIVE,
5230    #[serde(rename = "pause")]
5231    PAUSE,
5232    #[serde(rename = "drain")]
5233    DRAIN,
5234}
5235
5236impl ::std::fmt::Display for NodeSpecAvailabilityEnum {
5237    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
5238        match *self { 
5239            NodeSpecAvailabilityEnum::EMPTY => write!(f, ""),
5240            NodeSpecAvailabilityEnum::ACTIVE => write!(f, "{}", "active"),
5241            NodeSpecAvailabilityEnum::PAUSE => write!(f, "{}", "pause"),
5242            NodeSpecAvailabilityEnum::DRAIN => write!(f, "{}", "drain"),
5243
5244        }
5245    }
5246}
5247
5248impl ::std::str::FromStr for NodeSpecAvailabilityEnum {
5249    type Err = String;
5250    fn from_str(s: &str) -> Result<Self, Self::Err> {
5251        match s { 
5252            "" => Ok(NodeSpecAvailabilityEnum::EMPTY),
5253            "active" => Ok(NodeSpecAvailabilityEnum::ACTIVE),
5254            "pause" => Ok(NodeSpecAvailabilityEnum::PAUSE),
5255            "drain" => Ok(NodeSpecAvailabilityEnum::DRAIN),
5256            x => Err(format!("Invalid enum type: {}", x)),
5257        }
5258    }
5259}
5260
5261impl ::std::convert::AsRef<str> for NodeSpecAvailabilityEnum {
5262    fn as_ref(&self) -> &str {
5263        match self { 
5264            NodeSpecAvailabilityEnum::EMPTY => "",
5265            NodeSpecAvailabilityEnum::ACTIVE => "active",
5266            NodeSpecAvailabilityEnum::PAUSE => "pause",
5267            NodeSpecAvailabilityEnum::DRAIN => "drain",
5268        }
5269    }
5270}
5271
5272/// NodeState represents the state of a node.
5273/// Enumeration of values.
5274/// Since this enum's variants do not hold data, we can easily define them them as `#[repr(C)]`
5275/// which helps with FFI.
5276#[allow(non_camel_case_types)]
5277#[repr(C)]
5278#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
5279pub enum NodeState { 
5280    #[serde(rename = "unknown")]
5281    UNKNOWN,
5282    #[serde(rename = "down")]
5283    DOWN,
5284    #[serde(rename = "ready")]
5285    READY,
5286    #[serde(rename = "disconnected")]
5287    DISCONNECTED,
5288}
5289
5290impl ::std::fmt::Display for NodeState {
5291    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
5292        match *self { 
5293            NodeState::UNKNOWN => write!(f, "{}", "unknown"),
5294            NodeState::DOWN => write!(f, "{}", "down"),
5295            NodeState::READY => write!(f, "{}", "ready"),
5296            NodeState::DISCONNECTED => write!(f, "{}", "disconnected"),
5297        }
5298    }
5299}
5300
5301impl ::std::str::FromStr for NodeState {
5302    type Err = ();
5303    fn from_str(s: &str) -> Result<Self, Self::Err> {
5304        match s {
5305            "unknown" => Ok(NodeState::UNKNOWN),
5306            "down" => Ok(NodeState::DOWN),
5307            "ready" => Ok(NodeState::READY),
5308            "disconnected" => Ok(NodeState::DISCONNECTED),
5309            _ => Err(()),
5310        }
5311    }
5312}
5313
5314impl std::default::Default for NodeState {
5315    fn default() -> Self { 
5316        NodeState::UNKNOWN
5317    }
5318}
5319
5320/// NodeStatus represents the status of a node.  It provides the current status of the node, as seen by the manager. 
5321#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5322pub struct NodeStatus {
5323    #[serde(rename = "State")]
5324    #[serde(skip_serializing_if = "Option::is_none")]
5325    pub state: Option<NodeState>,
5326
5327    #[serde(rename = "Message")]
5328    #[serde(skip_serializing_if = "Option::is_none")]
5329    pub message: Option<String>,
5330
5331    /// IP address of the node.
5332    #[serde(rename = "Addr")]
5333    #[serde(skip_serializing_if = "Option::is_none")]
5334    pub addr: Option<String>,
5335
5336}
5337
5338/// 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. 
5339#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5340pub struct ObjectVersion {
5341    #[serde(rename = "Index")]
5342    #[serde(skip_serializing_if = "Option::is_none")]
5343    pub index: Option<u64>,
5344
5345}
5346
5347/// A descriptor struct containing digest, media type, and size, as defined in the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). 
5348#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5349pub struct OciDescriptor {
5350    /// The media type of the object this schema refers to. 
5351    #[serde(rename = "mediaType")]
5352    #[serde(skip_serializing_if = "Option::is_none")]
5353    pub media_type: Option<String>,
5354
5355    /// The digest of the targeted content. 
5356    #[serde(rename = "digest")]
5357    #[serde(skip_serializing_if = "Option::is_none")]
5358    pub digest: Option<String>,
5359
5360    /// The size in bytes of the blob. 
5361    #[serde(rename = "size")]
5362    #[serde(skip_serializing_if = "Option::is_none")]
5363    pub size: Option<i64>,
5364
5365    /// List of URLs from which this object MAY be downloaded.
5366    #[serde(rename = "urls")]
5367    #[serde(skip_serializing_if = "Option::is_none")]
5368    pub urls: Option<Vec<String>>,
5369
5370    /// Arbitrary metadata relating to the targeted content.
5371    #[serde(rename = "annotations")]
5372    #[serde(skip_serializing_if = "Option::is_none")]
5373    pub annotations: Option<HashMap<String, String>>,
5374
5375    /// Data is an embedding of the targeted content. This is encoded as a base64 string when marshalled to JSON (automatically, by encoding/json). If present, Data can be used directly to avoid fetching the targeted content.
5376    #[serde(rename = "data")]
5377    #[serde(skip_serializing_if = "Option::is_none")]
5378    pub data: Option<String>,
5379
5380    #[serde(rename = "platform")]
5381    #[serde(skip_serializing_if = "Option::is_none")]
5382    pub platform: Option<OciPlatform>,
5383
5384    /// ArtifactType is the IANA media type of this artifact.
5385    #[serde(rename = "artifactType")]
5386    #[serde(skip_serializing_if = "Option::is_none")]
5387    pub artifact_type: Option<String>,
5388
5389}
5390
5391/// Describes the platform which the image in the manifest runs on, as defined in the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md). 
5392#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5393pub struct OciPlatform {
5394    /// The CPU architecture, for example `amd64` or `ppc64`. 
5395    #[serde(rename = "architecture")]
5396    #[serde(skip_serializing_if = "Option::is_none")]
5397    pub architecture: Option<String>,
5398
5399    /// The operating system, for example `linux` or `windows`. 
5400    #[serde(rename = "os")]
5401    #[serde(skip_serializing_if = "Option::is_none")]
5402    pub os: Option<String>,
5403
5404    /// Optional field specifying the operating system version, for example on Windows `10.0.19041.1165`. 
5405    #[serde(rename = "os.version")]
5406    #[serde(skip_serializing_if = "Option::is_none")]
5407    pub os_version: Option<String>,
5408
5409    /// Optional field specifying an array of strings, each listing a required OS feature (for example on Windows `win32k`). 
5410    #[serde(rename = "os.features")]
5411    #[serde(skip_serializing_if = "Option::is_none")]
5412    pub os_features: Option<Vec<String>>,
5413
5414    /// Optional field specifying a variant of the CPU, for example `v7` to specify ARMv7 when architecture is `arm`. 
5415    #[serde(rename = "variant")]
5416    #[serde(skip_serializing_if = "Option::is_none")]
5417    pub variant: Option<String>,
5418
5419}
5420
5421/// PeerInfo represents one peer of an overlay network. 
5422#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5423pub struct PeerInfo {
5424    /// ID of the peer-node in the Swarm cluster.
5425    #[serde(rename = "Name")]
5426    #[serde(skip_serializing_if = "Option::is_none")]
5427    pub name: Option<String>,
5428
5429    /// IP-address of the peer-node in the Swarm cluster.
5430    #[serde(rename = "IP")]
5431    #[serde(skip_serializing_if = "Option::is_none")]
5432    pub ip: Option<String>,
5433
5434}
5435
5436/// Represents a peer-node in the swarm
5437#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5438pub struct PeerNode {
5439    /// Unique identifier of for this node in the swarm.
5440    #[serde(rename = "NodeID")]
5441    #[serde(skip_serializing_if = "Option::is_none")]
5442    pub node_id: Option<String>,
5443
5444    /// IP address and ports at which this node can be reached. 
5445    #[serde(rename = "Addr")]
5446    #[serde(skip_serializing_if = "Option::is_none")]
5447    pub addr: Option<String>,
5448
5449}
5450
5451/// Platform represents the platform (Arch/OS). 
5452#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5453pub struct Platform {
5454    /// Architecture represents the hardware architecture (for example, `x86_64`). 
5455    #[serde(rename = "Architecture")]
5456    #[serde(skip_serializing_if = "Option::is_none")]
5457    pub architecture: Option<String>,
5458
5459    /// OS represents the Operating System (for example, `linux` or `windows`). 
5460    #[serde(rename = "OS")]
5461    #[serde(skip_serializing_if = "Option::is_none")]
5462    pub os: Option<String>,
5463
5464}
5465
5466/// A plugin for the Engine API
5467#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5468pub struct Plugin {
5469    #[serde(rename = "Id")]
5470    #[serde(skip_serializing_if = "Option::is_none")]
5471    pub id: Option<String>,
5472
5473    #[serde(rename = "Name")]
5474    pub name: String,
5475
5476    /// True if the plugin is running. False if the plugin is not running, only installed.
5477    #[serde(rename = "Enabled")]
5478    pub enabled: bool,
5479
5480    #[serde(rename = "Settings")]
5481    pub settings: PluginSettings,
5482
5483    /// plugin remote reference used to push/pull the plugin
5484    #[serde(rename = "PluginReference")]
5485    #[serde(skip_serializing_if = "Option::is_none")]
5486    pub plugin_reference: Option<String>,
5487
5488    #[serde(rename = "Config")]
5489    pub config: PluginConfig,
5490
5491}
5492
5493/// The config of a plugin.
5494#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5495pub struct PluginConfig {
5496    /// Docker Version used to create the plugin
5497    #[serde(rename = "DockerVersion")]
5498    #[serde(skip_serializing_if = "Option::is_none")]
5499    pub docker_version: Option<String>,
5500
5501    #[serde(rename = "Description")]
5502    pub description: String,
5503
5504    #[serde(rename = "Documentation")]
5505    pub documentation: String,
5506
5507    #[serde(rename = "Interface")]
5508    pub interface: PluginConfigInterface,
5509
5510    #[serde(rename = "Entrypoint")]
5511    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5512    pub entrypoint: Vec<String>,
5513
5514    #[serde(rename = "WorkDir")]
5515    pub work_dir: String,
5516
5517    #[serde(rename = "User")]
5518    #[serde(skip_serializing_if = "Option::is_none")]
5519    pub user: Option<PluginConfigUser>,
5520
5521    #[serde(rename = "Network")]
5522    pub network: PluginConfigNetwork,
5523
5524    #[serde(rename = "Linux")]
5525    pub linux: PluginConfigLinux,
5526
5527    #[serde(rename = "PropagatedMount")]
5528    pub propagated_mount: String,
5529
5530    #[serde(rename = "IpcHost")]
5531    pub ipc_host: bool,
5532
5533    #[serde(rename = "PidHost")]
5534    pub pid_host: bool,
5535
5536    #[serde(rename = "Mounts")]
5537    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5538    pub mounts: Vec<PluginMount>,
5539
5540    #[serde(rename = "Env")]
5541    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5542    pub env: Vec<PluginEnv>,
5543
5544    #[serde(rename = "Args")]
5545    pub args: PluginConfigArgs,
5546
5547    #[serde(rename = "rootfs")]
5548    #[serde(skip_serializing_if = "Option::is_none")]
5549    pub rootfs: Option<PluginConfigRootfs>,
5550
5551}
5552
5553#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5554pub struct PluginConfigArgs {
5555    #[serde(rename = "Name")]
5556    pub name: String,
5557
5558    #[serde(rename = "Description")]
5559    pub description: String,
5560
5561    #[serde(rename = "Settable")]
5562    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5563    pub settable: Vec<String>,
5564
5565    #[serde(rename = "Value")]
5566    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5567    pub value: Vec<String>,
5568
5569}
5570
5571/// The interface between Docker and the plugin
5572#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5573pub struct PluginConfigInterface {
5574    #[serde(rename = "Types")]
5575    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5576    pub types: Vec<PluginInterfaceType>,
5577
5578    #[serde(rename = "Socket")]
5579    pub socket: String,
5580
5581    /// Protocol to use for clients connecting to the plugin.
5582    #[serde(rename = "ProtocolScheme")]
5583    #[serde(skip_serializing_if = "Option::is_none")]
5584    pub protocol_scheme: Option<PluginConfigInterfaceProtocolSchemeEnum>,
5585
5586}
5587
5588#[allow(non_camel_case_types)]
5589#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
5590pub enum PluginConfigInterfaceProtocolSchemeEnum { 
5591    #[serde(rename = "")]
5592    EMPTY,
5593    #[serde(rename = "moby.plugins.http/v1")]
5594    MOBY_PLUGINS_HTTP_V1,
5595}
5596
5597impl ::std::fmt::Display for PluginConfigInterfaceProtocolSchemeEnum {
5598    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
5599        match *self { 
5600            PluginConfigInterfaceProtocolSchemeEnum::EMPTY => write!(f, "{}", ""),
5601            PluginConfigInterfaceProtocolSchemeEnum::MOBY_PLUGINS_HTTP_V1 => write!(f, "{}", "moby.plugins.http/v1"),
5602
5603        }
5604    }
5605}
5606
5607impl ::std::str::FromStr for PluginConfigInterfaceProtocolSchemeEnum {
5608    type Err = String;
5609    fn from_str(s: &str) -> Result<Self, Self::Err> {
5610        match s { 
5611            "" => Ok(PluginConfigInterfaceProtocolSchemeEnum::EMPTY),
5612            "moby.plugins.http/v1" => Ok(PluginConfigInterfaceProtocolSchemeEnum::MOBY_PLUGINS_HTTP_V1),
5613            x => Err(format!("Invalid enum type: {}", x)),
5614        }
5615    }
5616}
5617
5618impl ::std::convert::AsRef<str> for PluginConfigInterfaceProtocolSchemeEnum {
5619    fn as_ref(&self) -> &str {
5620        match self { 
5621            PluginConfigInterfaceProtocolSchemeEnum::EMPTY => "",
5622            PluginConfigInterfaceProtocolSchemeEnum::MOBY_PLUGINS_HTTP_V1 => "moby.plugins.http/v1",
5623        }
5624    }
5625}
5626
5627#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5628pub struct PluginConfigLinux {
5629    #[serde(rename = "Capabilities")]
5630    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5631    pub capabilities: Vec<String>,
5632
5633    #[serde(rename = "AllowAllDevices")]
5634    pub allow_all_devices: bool,
5635
5636    #[serde(rename = "Devices")]
5637    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5638    pub devices: Vec<PluginDevice>,
5639
5640}
5641
5642#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5643pub struct PluginConfigNetwork {
5644    #[serde(rename = "Type")]
5645    pub typ: String,
5646
5647}
5648
5649#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5650pub struct PluginConfigRootfs {
5651    #[serde(rename = "type")]
5652    #[serde(skip_serializing_if = "Option::is_none")]
5653    pub typ: Option<String>,
5654
5655    #[serde(rename = "diff_ids")]
5656    #[serde(skip_serializing_if = "Option::is_none")]
5657    pub diff_ids: Option<Vec<String>>,
5658
5659}
5660
5661#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5662pub struct PluginConfigUser {
5663    #[serde(rename = "UID")]
5664    #[serde(skip_serializing_if = "Option::is_none")]
5665    pub uid: Option<u32>,
5666
5667    #[serde(rename = "GID")]
5668    #[serde(skip_serializing_if = "Option::is_none")]
5669    pub gid: Option<u32>,
5670
5671}
5672
5673#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5674pub struct PluginDevice {
5675    #[serde(rename = "Name")]
5676    pub name: String,
5677
5678    #[serde(rename = "Description")]
5679    pub description: String,
5680
5681    #[serde(rename = "Settable")]
5682    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5683    pub settable: Vec<String>,
5684
5685    #[serde(rename = "Path")]
5686    pub path: String,
5687
5688}
5689
5690#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5691pub struct PluginEnv {
5692    #[serde(rename = "Name")]
5693    pub name: String,
5694
5695    #[serde(rename = "Description")]
5696    pub description: String,
5697
5698    #[serde(rename = "Settable")]
5699    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5700    pub settable: Vec<String>,
5701
5702    #[serde(rename = "Value")]
5703    pub value: String,
5704
5705}
5706
5707#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5708pub struct PluginInterfaceType {
5709    #[serde(rename = "Prefix")]
5710    pub prefix: String,
5711
5712    #[serde(rename = "Capability")]
5713    pub capability: String,
5714
5715    #[serde(rename = "Version")]
5716    pub version: String,
5717
5718}
5719
5720#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5721pub struct PluginMount {
5722    #[serde(rename = "Name")]
5723    pub name: String,
5724
5725    #[serde(rename = "Description")]
5726    pub description: String,
5727
5728    #[serde(rename = "Settable")]
5729    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5730    pub settable: Vec<String>,
5731
5732    #[serde(rename = "Source")]
5733    pub source: String,
5734
5735    #[serde(rename = "Destination")]
5736    pub destination: String,
5737
5738    #[serde(rename = "Type")]
5739    pub typ: String,
5740
5741    #[serde(rename = "Options")]
5742    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5743    pub options: Vec<String>,
5744
5745}
5746
5747/// Describes a permission the user has to accept upon installing the plugin. 
5748#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5749pub struct PluginPrivilege {
5750    #[serde(rename = "Name")]
5751    #[serde(skip_serializing_if = "Option::is_none")]
5752    pub name: Option<String>,
5753
5754    #[serde(rename = "Description")]
5755    #[serde(skip_serializing_if = "Option::is_none")]
5756    pub description: Option<String>,
5757
5758    #[serde(rename = "Value")]
5759    #[serde(skip_serializing_if = "Option::is_none")]
5760    pub value: Option<Vec<String>>,
5761
5762}
5763
5764/// Settings that can be modified by users.
5765#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5766pub struct PluginSettings {
5767    #[serde(rename = "Mounts")]
5768    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5769    pub mounts: Vec<PluginMount>,
5770
5771    #[serde(rename = "Env")]
5772    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5773    pub env: Vec<String>,
5774
5775    #[serde(rename = "Args")]
5776    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5777    pub args: Vec<String>,
5778
5779    #[serde(rename = "Devices")]
5780    #[serde(deserialize_with = "deserialize_nonoptional_vec")]
5781    pub devices: Vec<PluginDevice>,
5782
5783}
5784
5785/// 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. 
5786#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5787pub struct PluginsInfo {
5788    /// Names of available volume-drivers, and network-driver plugins.
5789    #[serde(rename = "Volume")]
5790    #[serde(skip_serializing_if = "Option::is_none")]
5791    pub volume: Option<Vec<String>>,
5792
5793    /// Names of available network-drivers, and network-driver plugins.
5794    #[serde(rename = "Network")]
5795    #[serde(skip_serializing_if = "Option::is_none")]
5796    pub network: Option<Vec<String>>,
5797
5798    /// Names of available authorization plugins.
5799    #[serde(rename = "Authorization")]
5800    #[serde(skip_serializing_if = "Option::is_none")]
5801    pub authorization: Option<Vec<String>>,
5802
5803    /// Names of available logging-drivers, and logging-driver plugins.
5804    #[serde(rename = "Log")]
5805    #[serde(skip_serializing_if = "Option::is_none")]
5806    pub log: Option<Vec<String>>,
5807
5808}
5809
5810/// An open port on a container
5811#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5812pub struct Port {
5813    /// Host IP address that the container's port is mapped to
5814    #[serde(rename = "IP")]
5815    #[serde(skip_serializing_if = "Option::is_none")]
5816    pub ip: Option<String>,
5817
5818    /// Port on the container
5819    #[serde(rename = "PrivatePort")]
5820    pub private_port: u16,
5821
5822    /// Port exposed on the host
5823    #[serde(rename = "PublicPort")]
5824    #[serde(skip_serializing_if = "Option::is_none")]
5825    pub public_port: Option<u16>,
5826
5827    #[serde(rename = "Type")]
5828    #[serde(skip_serializing_if = "Option::is_none")]
5829    #[serde(with = "::serde_with::As::<::serde_with::NoneAsEmptyString>")]
5830    pub typ: Option<PortTypeEnum>,
5831
5832}
5833
5834#[allow(non_camel_case_types)]
5835#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
5836pub enum PortTypeEnum { 
5837    #[serde(rename = "")]
5838    EMPTY,
5839    #[serde(rename = "tcp")]
5840    TCP,
5841    #[serde(rename = "udp")]
5842    UDP,
5843    #[serde(rename = "sctp")]
5844    SCTP,
5845}
5846
5847impl ::std::fmt::Display for PortTypeEnum {
5848    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
5849        match *self { 
5850            PortTypeEnum::EMPTY => write!(f, ""),
5851            PortTypeEnum::TCP => write!(f, "{}", "tcp"),
5852            PortTypeEnum::UDP => write!(f, "{}", "udp"),
5853            PortTypeEnum::SCTP => write!(f, "{}", "sctp"),
5854
5855        }
5856    }
5857}
5858
5859impl ::std::str::FromStr for PortTypeEnum {
5860    type Err = String;
5861    fn from_str(s: &str) -> Result<Self, Self::Err> {
5862        match s { 
5863            "" => Ok(PortTypeEnum::EMPTY),
5864            "tcp" => Ok(PortTypeEnum::TCP),
5865            "udp" => Ok(PortTypeEnum::UDP),
5866            "sctp" => Ok(PortTypeEnum::SCTP),
5867            x => Err(format!("Invalid enum type: {}", x)),
5868        }
5869    }
5870}
5871
5872impl ::std::convert::AsRef<str> for PortTypeEnum {
5873    fn as_ref(&self) -> &str {
5874        match self { 
5875            PortTypeEnum::EMPTY => "",
5876            PortTypeEnum::TCP => "tcp",
5877            PortTypeEnum::UDP => "udp",
5878            PortTypeEnum::SCTP => "sctp",
5879        }
5880    }
5881}
5882
5883/// PortBinding represents a binding between a host IP address and a host port. 
5884#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5885pub struct PortBinding {
5886    /// Host IP address that the container's port is mapped to.
5887    #[serde(rename = "HostIp")]
5888    #[serde(skip_serializing_if = "Option::is_none")]
5889    pub host_ip: Option<String>,
5890
5891    /// Host port number that the container's port is mapped to.
5892    #[serde(rename = "HostPort")]
5893    #[serde(skip_serializing_if = "Option::is_none")]
5894    pub host_port: Option<String>,
5895
5896}
5897
5898/// 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. 
5899// special-casing PortMap, cos swagger-codegen doesn't figure out this type
5900pub type PortMap = HashMap<String, Option<Vec<PortBinding>>>;
5901
5902/// represents the port status of a task's host ports whose service has published host ports
5903#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5904pub struct PortStatus {
5905    #[serde(rename = "Ports")]
5906    #[serde(skip_serializing_if = "Option::is_none")]
5907    pub ports: Option<Vec<EndpointPortConfig>>,
5908
5909}
5910
5911#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5912pub struct ProcessConfig {
5913    #[serde(rename = "privileged")]
5914    #[serde(skip_serializing_if = "Option::is_none")]
5915    pub privileged: Option<bool>,
5916
5917    #[serde(rename = "user")]
5918    #[serde(skip_serializing_if = "Option::is_none")]
5919    pub user: Option<String>,
5920
5921    #[serde(rename = "tty")]
5922    #[serde(skip_serializing_if = "Option::is_none")]
5923    pub tty: Option<bool>,
5924
5925    #[serde(rename = "entrypoint")]
5926    #[serde(skip_serializing_if = "Option::is_none")]
5927    pub entrypoint: Option<String>,
5928
5929    #[serde(rename = "arguments")]
5930    #[serde(skip_serializing_if = "Option::is_none")]
5931    pub arguments: Option<Vec<String>>,
5932
5933}
5934
5935#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5936pub struct ProgressDetail {
5937    #[serde(rename = "current")]
5938    #[serde(skip_serializing_if = "Option::is_none")]
5939    pub current: Option<i64>,
5940
5941    #[serde(rename = "total")]
5942    #[serde(skip_serializing_if = "Option::is_none")]
5943    pub total: Option<i64>,
5944
5945}
5946
5947#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
5948pub struct PushImageInfo {
5949    /// errors encountered during the operation.   > **Deprecated**: This field is deprecated since API v1.4, and will be omitted in a future API version. Use the information in errorDetail instead.
5950    #[serde(rename = "error")]
5951    #[serde(skip_serializing_if = "Option::is_none")]
5952    pub error: Option<String>,
5953
5954    #[serde(rename = "errorDetail")]
5955    #[serde(skip_serializing_if = "Option::is_none")]
5956    pub error_detail: Option<ErrorDetail>,
5957
5958    #[serde(rename = "status")]
5959    #[serde(skip_serializing_if = "Option::is_none")]
5960    pub status: Option<String>,
5961
5962    /// Progress is a pre-formatted presentation of progressDetail.   > **Deprecated**: This field is deprecated since API v1.8, and will be omitted in a future API version. Use the information in progressDetail instead.
5963    #[serde(rename = "progress")]
5964    #[serde(skip_serializing_if = "Option::is_none")]
5965    pub progress: Option<String>,
5966
5967    #[serde(rename = "progressDetail")]
5968    #[serde(skip_serializing_if = "Option::is_none")]
5969    pub progress_detail: Option<ProgressDetail>,
5970
5971}
5972
5973/// Reachability represents the reachability of a node.
5974/// Enumeration of values.
5975/// Since this enum's variants do not hold data, we can easily define them them as `#[repr(C)]`
5976/// which helps with FFI.
5977#[allow(non_camel_case_types)]
5978#[repr(C)]
5979#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
5980pub enum Reachability { 
5981    #[serde(rename = "unknown")]
5982    UNKNOWN,
5983    #[serde(rename = "unreachable")]
5984    UNREACHABLE,
5985    #[serde(rename = "reachable")]
5986    REACHABLE,
5987}
5988
5989impl ::std::fmt::Display for Reachability {
5990    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
5991        match *self { 
5992            Reachability::UNKNOWN => write!(f, "{}", "unknown"),
5993            Reachability::UNREACHABLE => write!(f, "{}", "unreachable"),
5994            Reachability::REACHABLE => write!(f, "{}", "reachable"),
5995        }
5996    }
5997}
5998
5999impl ::std::str::FromStr for Reachability {
6000    type Err = ();
6001    fn from_str(s: &str) -> Result<Self, Self::Err> {
6002        match s {
6003            "unknown" => Ok(Reachability::UNKNOWN),
6004            "unreachable" => Ok(Reachability::UNREACHABLE),
6005            "reachable" => Ok(Reachability::REACHABLE),
6006            _ => Err(()),
6007        }
6008    }
6009}
6010
6011impl std::default::Default for Reachability {
6012    fn default() -> Self { 
6013        Reachability::UNKNOWN
6014    }
6015}
6016
6017/// RegistryServiceConfig stores daemon registry services configuration. 
6018#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6019pub struct RegistryServiceConfig {
6020    /// List of IP ranges to which nondistributable artifacts can be pushed, using the CIDR syntax [RFC 4632](https://tools.ietf.org/html/4632).  <p><br /></p>  > **Deprecated**: Pushing nondistributable artifacts is now always enabled > and this field is always `null`. This field will be removed in a API v1.49. 
6021    #[serde(rename = "AllowNondistributableArtifactsCIDRs")]
6022    #[serde(skip_serializing_if = "Option::is_none")]
6023    pub allow_nondistributable_artifacts_cidrs: Option<Vec<String>>,
6024
6025    /// List of registry hostnames to which nondistributable artifacts can be pushed, using the format `<hostname>[:<port>]` or `<IP address>[:<port>]`.  <p><br /></p>  > **Deprecated**: Pushing nondistributable artifacts is now always enabled > and this field is always `null`. This field will be removed in a API v1.49. 
6026    #[serde(rename = "AllowNondistributableArtifactsHostnames")]
6027    #[serde(skip_serializing_if = "Option::is_none")]
6028    pub allow_nondistributable_artifacts_hostnames: Option<Vec<String>>,
6029
6030    /// 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 (`::1/128` and `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. 
6031    #[serde(rename = "InsecureRegistryCIDRs")]
6032    #[serde(skip_serializing_if = "Option::is_none")]
6033    pub insecure_registry_cidrs: Option<Vec<String>>,
6034
6035    #[serde(rename = "IndexConfigs")]
6036    #[serde(skip_serializing_if = "Option::is_none")]
6037    pub index_configs: Option<HashMap<String, IndexInfo>>,
6038
6039    /// List of registry URLs that act as a mirror for the official (`docker.io`) registry. 
6040    #[serde(rename = "Mirrors")]
6041    #[serde(skip_serializing_if = "Option::is_none")]
6042    pub mirrors: Option<Vec<String>>,
6043
6044}
6045
6046/// An object describing the resources which can be advertised by a node and requested by a task. 
6047#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6048pub struct ResourceObject {
6049    #[serde(rename = "NanoCPUs")]
6050    #[serde(skip_serializing_if = "Option::is_none")]
6051    pub nano_cpus: Option<i64>,
6052
6053    #[serde(rename = "MemoryBytes")]
6054    #[serde(skip_serializing_if = "Option::is_none")]
6055    pub memory_bytes: Option<i64>,
6056
6057    #[serde(rename = "GenericResources")]
6058    #[serde(skip_serializing_if = "Option::is_none")]
6059    pub generic_resources: Option<GenericResources>,
6060
6061}
6062
6063/// A container's resources (cgroups config, ulimits, etc)
6064#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6065pub struct Resources {
6066    /// An integer value representing this container's relative CPU weight versus other containers. 
6067    #[serde(rename = "CpuShares")]
6068    #[serde(skip_serializing_if = "Option::is_none")]
6069    pub cpu_shares: Option<i64>,
6070
6071    /// Memory limit in bytes.
6072    #[serde(rename = "Memory")]
6073    #[serde(skip_serializing_if = "Option::is_none")]
6074    pub memory: Option<i64>,
6075
6076    /// 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. 
6077    #[serde(rename = "CgroupParent")]
6078    #[serde(skip_serializing_if = "Option::is_none")]
6079    pub cgroup_parent: Option<String>,
6080
6081    /// Block IO weight (relative weight).
6082    #[serde(rename = "BlkioWeight")]
6083    #[serde(skip_serializing_if = "Option::is_none")]
6084    pub blkio_weight: Option<u16>,
6085
6086    /// Block IO weight (relative device weight) in the form:  ``` [{\"Path\": \"device_path\", \"Weight\": weight}] ``` 
6087    #[serde(rename = "BlkioWeightDevice")]
6088    #[serde(skip_serializing_if = "Option::is_none")]
6089    pub blkio_weight_device: Option<Vec<ResourcesBlkioWeightDevice>>,
6090
6091    /// Limit read rate (bytes per second) from a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
6092    #[serde(rename = "BlkioDeviceReadBps")]
6093    #[serde(skip_serializing_if = "Option::is_none")]
6094    pub blkio_device_read_bps: Option<Vec<ThrottleDevice>>,
6095
6096    /// Limit write rate (bytes per second) to a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
6097    #[serde(rename = "BlkioDeviceWriteBps")]
6098    #[serde(skip_serializing_if = "Option::is_none")]
6099    pub blkio_device_write_bps: Option<Vec<ThrottleDevice>>,
6100
6101    /// Limit read rate (IO per second) from a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
6102    #[serde(rename = "BlkioDeviceReadIOps")]
6103    #[serde(skip_serializing_if = "Option::is_none")]
6104    pub blkio_device_read_iops: Option<Vec<ThrottleDevice>>,
6105
6106    /// Limit write rate (IO per second) to a device, in the form:  ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` 
6107    #[serde(rename = "BlkioDeviceWriteIOps")]
6108    #[serde(skip_serializing_if = "Option::is_none")]
6109    pub blkio_device_write_iops: Option<Vec<ThrottleDevice>>,
6110
6111    /// The length of a CPU period in microseconds.
6112    #[serde(rename = "CpuPeriod")]
6113    #[serde(skip_serializing_if = "Option::is_none")]
6114    pub cpu_period: Option<i64>,
6115
6116    /// Microseconds of CPU time that the container can get in a CPU period. 
6117    #[serde(rename = "CpuQuota")]
6118    #[serde(skip_serializing_if = "Option::is_none")]
6119    pub cpu_quota: Option<i64>,
6120
6121    /// The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. 
6122    #[serde(rename = "CpuRealtimePeriod")]
6123    #[serde(skip_serializing_if = "Option::is_none")]
6124    pub cpu_realtime_period: Option<i64>,
6125
6126    /// The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. 
6127    #[serde(rename = "CpuRealtimeRuntime")]
6128    #[serde(skip_serializing_if = "Option::is_none")]
6129    pub cpu_realtime_runtime: Option<i64>,
6130
6131    /// CPUs in which to allow execution (e.g., `0-3`, `0,1`). 
6132    #[serde(rename = "CpusetCpus")]
6133    #[serde(skip_serializing_if = "Option::is_none")]
6134    pub cpuset_cpus: Option<String>,
6135
6136    /// Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. 
6137    #[serde(rename = "CpusetMems")]
6138    #[serde(skip_serializing_if = "Option::is_none")]
6139    pub cpuset_mems: Option<String>,
6140
6141    /// A list of devices to add to the container.
6142    #[serde(rename = "Devices")]
6143    #[serde(skip_serializing_if = "Option::is_none")]
6144    pub devices: Option<Vec<DeviceMapping>>,
6145
6146    /// a list of cgroup rules to apply to the container
6147    #[serde(rename = "DeviceCgroupRules")]
6148    #[serde(skip_serializing_if = "Option::is_none")]
6149    pub device_cgroup_rules: Option<Vec<String>>,
6150
6151    /// A list of requests for devices to be sent to device drivers. 
6152    #[serde(rename = "DeviceRequests")]
6153    #[serde(skip_serializing_if = "Option::is_none")]
6154    pub device_requests: Option<Vec<DeviceRequest>>,
6155
6156    /// Hard limit for kernel TCP buffer memory (in bytes). Depending on the OCI runtime in use, this option may be ignored. It is no longer supported by the default (runc) runtime.  This field is omitted when empty. 
6157    #[serde(rename = "KernelMemoryTCP")]
6158    #[serde(skip_serializing_if = "Option::is_none")]
6159    pub kernel_memory_tcp: Option<i64>,
6160
6161    /// Memory soft limit in bytes.
6162    #[serde(rename = "MemoryReservation")]
6163    #[serde(skip_serializing_if = "Option::is_none")]
6164    pub memory_reservation: Option<i64>,
6165
6166    /// Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. 
6167    #[serde(rename = "MemorySwap")]
6168    #[serde(skip_serializing_if = "Option::is_none")]
6169    pub memory_swap: Option<i64>,
6170
6171    /// Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. 
6172    #[serde(rename = "MemorySwappiness")]
6173    #[serde(skip_serializing_if = "Option::is_none")]
6174    pub memory_swappiness: Option<i64>,
6175
6176    /// CPU quota in units of 10<sup>-9</sup> CPUs.
6177    #[serde(rename = "NanoCpus")]
6178    #[serde(skip_serializing_if = "Option::is_none")]
6179    pub nano_cpus: Option<i64>,
6180
6181    /// Disable OOM Killer for the container.
6182    #[serde(rename = "OomKillDisable")]
6183    #[serde(skip_serializing_if = "Option::is_none")]
6184    pub oom_kill_disable: Option<bool>,
6185
6186    /// 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. 
6187    #[serde(rename = "Init")]
6188    #[serde(skip_serializing_if = "Option::is_none")]
6189    pub init: Option<bool>,
6190
6191    /// Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` to not change. 
6192    #[serde(rename = "PidsLimit")]
6193    #[serde(skip_serializing_if = "Option::is_none")]
6194    pub pids_limit: Option<i64>,
6195
6196    /// A list of resource limits to set in the container. For example:  ``` {\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048} ``` 
6197    #[serde(rename = "Ulimits")]
6198    #[serde(skip_serializing_if = "Option::is_none")]
6199    pub ulimits: Option<Vec<ResourcesUlimits>>,
6200
6201    /// 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. 
6202    #[serde(rename = "CpuCount")]
6203    #[serde(skip_serializing_if = "Option::is_none")]
6204    pub cpu_count: Option<i64>,
6205
6206    /// 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. 
6207    #[serde(rename = "CpuPercent")]
6208    #[serde(skip_serializing_if = "Option::is_none")]
6209    pub cpu_percent: Option<i64>,
6210
6211    /// Maximum IOps for the container system drive (Windows only)
6212    #[serde(rename = "IOMaximumIOps")]
6213    #[serde(skip_serializing_if = "Option::is_none")]
6214    pub io_maximum_iops: Option<i64>,
6215
6216    /// Maximum IO in bytes per second for the container system drive (Windows only). 
6217    #[serde(rename = "IOMaximumBandwidth")]
6218    #[serde(skip_serializing_if = "Option::is_none")]
6219    pub io_maximum_bandwidth: Option<i64>,
6220
6221}
6222
6223#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6224pub struct ResourcesBlkioWeightDevice {
6225    #[serde(rename = "Path")]
6226    #[serde(skip_serializing_if = "Option::is_none")]
6227    pub path: Option<String>,
6228
6229    #[serde(rename = "Weight")]
6230    #[serde(skip_serializing_if = "Option::is_none")]
6231    pub weight: Option<usize>,
6232
6233}
6234
6235#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6236pub struct ResourcesUlimits {
6237    /// Name of ulimit
6238    #[serde(rename = "Name")]
6239    #[serde(skip_serializing_if = "Option::is_none")]
6240    pub name: Option<String>,
6241
6242    /// Soft limit
6243    #[serde(rename = "Soft")]
6244    #[serde(skip_serializing_if = "Option::is_none")]
6245    pub soft: Option<i64>,
6246
6247    /// Hard limit
6248    #[serde(rename = "Hard")]
6249    #[serde(skip_serializing_if = "Option::is_none")]
6250    pub hard: Option<i64>,
6251
6252}
6253
6254/// 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. 
6255#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6256pub struct RestartPolicy {
6257    /// - Empty string means not to restart - `no` Do not automatically 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 
6258    #[serde(rename = "Name")]
6259    #[serde(skip_serializing_if = "Option::is_none")]
6260    pub name: Option<RestartPolicyNameEnum>,
6261
6262    /// If `on-failure` is used, the number of times to retry before giving up. 
6263    #[serde(rename = "MaximumRetryCount")]
6264    #[serde(skip_serializing_if = "Option::is_none")]
6265    pub maximum_retry_count: Option<i64>,
6266
6267}
6268
6269#[allow(non_camel_case_types)]
6270#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
6271pub enum RestartPolicyNameEnum { 
6272    #[serde(rename = "")]
6273    EMPTY,
6274    #[serde(rename = "no")]
6275    NO,
6276    #[serde(rename = "always")]
6277    ALWAYS,
6278    #[serde(rename = "unless-stopped")]
6279    UNLESS_STOPPED,
6280    #[serde(rename = "on-failure")]
6281    ON_FAILURE,
6282}
6283
6284impl ::std::fmt::Display for RestartPolicyNameEnum {
6285    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
6286        match *self { 
6287            RestartPolicyNameEnum::EMPTY => write!(f, "{}", ""),
6288            RestartPolicyNameEnum::NO => write!(f, "{}", "no"),
6289            RestartPolicyNameEnum::ALWAYS => write!(f, "{}", "always"),
6290            RestartPolicyNameEnum::UNLESS_STOPPED => write!(f, "{}", "unless-stopped"),
6291            RestartPolicyNameEnum::ON_FAILURE => write!(f, "{}", "on-failure"),
6292
6293        }
6294    }
6295}
6296
6297impl ::std::str::FromStr for RestartPolicyNameEnum {
6298    type Err = String;
6299    fn from_str(s: &str) -> Result<Self, Self::Err> {
6300        match s { 
6301            "" => Ok(RestartPolicyNameEnum::EMPTY),
6302            "no" => Ok(RestartPolicyNameEnum::NO),
6303            "always" => Ok(RestartPolicyNameEnum::ALWAYS),
6304            "unless-stopped" => Ok(RestartPolicyNameEnum::UNLESS_STOPPED),
6305            "on-failure" => Ok(RestartPolicyNameEnum::ON_FAILURE),
6306            x => Err(format!("Invalid enum type: {}", x)),
6307        }
6308    }
6309}
6310
6311impl ::std::convert::AsRef<str> for RestartPolicyNameEnum {
6312    fn as_ref(&self) -> &str {
6313        match self { 
6314            RestartPolicyNameEnum::EMPTY => "",
6315            RestartPolicyNameEnum::NO => "no",
6316            RestartPolicyNameEnum::ALWAYS => "always",
6317            RestartPolicyNameEnum::UNLESS_STOPPED => "unless-stopped",
6318            RestartPolicyNameEnum::ON_FAILURE => "on-failure",
6319        }
6320    }
6321}
6322
6323/// 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. 
6324#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6325pub struct Runtime {
6326    /// 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. 
6327    #[serde(rename = "path")]
6328    #[serde(skip_serializing_if = "Option::is_none")]
6329    pub path: Option<String>,
6330
6331    /// List of command-line arguments to pass to the runtime when invoked. 
6332    #[serde(rename = "runtimeArgs")]
6333    #[serde(skip_serializing_if = "Option::is_none")]
6334    pub runtime_args: Option<Vec<String>>,
6335
6336    /// Information specific to the runtime.  While this API specification does not define data provided by runtimes, the following well-known properties may be provided by runtimes:  `org.opencontainers.runtime-spec.features`: features structure as defined in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), in a JSON string representation.  <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. 
6337    #[serde(rename = "status")]
6338    #[serde(skip_serializing_if = "Option::is_none")]
6339    pub status: Option<HashMap<String, String>>,
6340
6341}
6342
6343#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6344pub struct Secret {
6345    #[serde(rename = "ID")]
6346    #[serde(skip_serializing_if = "Option::is_none")]
6347    pub id: Option<String>,
6348
6349    #[serde(rename = "Version")]
6350    #[serde(skip_serializing_if = "Option::is_none")]
6351    pub version: Option<ObjectVersion>,
6352
6353    #[serde(rename = "CreatedAt")]
6354    #[serde(skip_serializing_if = "Option::is_none")]
6355    #[serde(
6356        default,
6357        deserialize_with = "deserialize_timestamp",
6358        serialize_with = "serialize_timestamp"
6359    )]
6360    pub created_at: Option<BollardDate>,
6361
6362    #[serde(rename = "UpdatedAt")]
6363    #[serde(skip_serializing_if = "Option::is_none")]
6364    #[serde(
6365        default,
6366        deserialize_with = "deserialize_timestamp",
6367        serialize_with = "serialize_timestamp"
6368    )]
6369    pub updated_at: Option<BollardDate>,
6370
6371    #[serde(rename = "Spec")]
6372    #[serde(skip_serializing_if = "Option::is_none")]
6373    pub spec: Option<SecretSpec>,
6374
6375}
6376
6377#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6378pub struct SecretSpec {
6379    /// User-defined name of the secret.
6380    #[serde(rename = "Name")]
6381    #[serde(skip_serializing_if = "Option::is_none")]
6382    pub name: Option<String>,
6383
6384    /// User-defined key/value metadata.
6385    #[serde(rename = "Labels")]
6386    #[serde(skip_serializing_if = "Option::is_none")]
6387    pub labels: Option<HashMap<String, String>>,
6388
6389    /// Data is the data to store as a secret, formatted as a Base64-url-safe-encoded ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize).  This field is only used to _create_ a secret, and is not returned by other endpoints. 
6390    #[serde(rename = "Data")]
6391    #[serde(skip_serializing_if = "Option::is_none")]
6392    pub data: Option<String>,
6393
6394    /// Name of the secrets driver used to fetch the secret's value from an external secret store. 
6395    #[serde(rename = "Driver")]
6396    #[serde(skip_serializing_if = "Option::is_none")]
6397    pub driver: Option<Driver>,
6398
6399    /// 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. 
6400    #[serde(rename = "Templating")]
6401    #[serde(skip_serializing_if = "Option::is_none")]
6402    pub templating: Option<Driver>,
6403
6404}
6405
6406#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6407pub struct Service {
6408    #[serde(rename = "ID")]
6409    #[serde(skip_serializing_if = "Option::is_none")]
6410    pub id: Option<String>,
6411
6412    #[serde(rename = "Version")]
6413    #[serde(skip_serializing_if = "Option::is_none")]
6414    pub version: Option<ObjectVersion>,
6415
6416    #[serde(rename = "CreatedAt")]
6417    #[serde(skip_serializing_if = "Option::is_none")]
6418    #[serde(
6419        default,
6420        deserialize_with = "deserialize_timestamp",
6421        serialize_with = "serialize_timestamp"
6422    )]
6423    pub created_at: Option<BollardDate>,
6424
6425    #[serde(rename = "UpdatedAt")]
6426    #[serde(skip_serializing_if = "Option::is_none")]
6427    #[serde(
6428        default,
6429        deserialize_with = "deserialize_timestamp",
6430        serialize_with = "serialize_timestamp"
6431    )]
6432    pub updated_at: Option<BollardDate>,
6433
6434    #[serde(rename = "Spec")]
6435    #[serde(skip_serializing_if = "Option::is_none")]
6436    pub spec: Option<ServiceSpec>,
6437
6438    #[serde(rename = "Endpoint")]
6439    #[serde(skip_serializing_if = "Option::is_none")]
6440    pub endpoint: Option<ServiceEndpoint>,
6441
6442    #[serde(rename = "UpdateStatus")]
6443    #[serde(skip_serializing_if = "Option::is_none")]
6444    pub update_status: Option<ServiceUpdateStatus>,
6445
6446    #[serde(rename = "ServiceStatus")]
6447    #[serde(skip_serializing_if = "Option::is_none")]
6448    pub service_status: Option<ServiceServiceStatus>,
6449
6450    #[serde(rename = "JobStatus")]
6451    #[serde(skip_serializing_if = "Option::is_none")]
6452    pub job_status: Option<ServiceJobStatus>,
6453
6454}
6455
6456/// contains the information returned to a client on the creation of a new service. 
6457#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6458pub struct ServiceCreateResponse {
6459    /// The ID of the created service.
6460    #[serde(rename = "ID")]
6461    #[serde(skip_serializing_if = "Option::is_none")]
6462    pub id: Option<String>,
6463
6464    /// Optional warning message.  FIXME(thaJeztah): this should have \"omitempty\" in the generated type. 
6465    #[serde(rename = "Warnings")]
6466    #[serde(skip_serializing_if = "Option::is_none")]
6467    pub warnings: Option<Vec<String>>,
6468
6469}
6470
6471#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6472pub struct ServiceEndpoint {
6473    #[serde(rename = "Spec")]
6474    #[serde(skip_serializing_if = "Option::is_none")]
6475    pub spec: Option<EndpointSpec>,
6476
6477    #[serde(rename = "Ports")]
6478    #[serde(skip_serializing_if = "Option::is_none")]
6479    pub ports: Option<Vec<EndpointPortConfig>>,
6480
6481    #[serde(rename = "VirtualIPs")]
6482    #[serde(skip_serializing_if = "Option::is_none")]
6483    pub virtual_ips: Option<Vec<ServiceEndpointVirtualIps>>,
6484
6485}
6486
6487#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6488pub struct ServiceEndpointVirtualIps {
6489    #[serde(rename = "NetworkID")]
6490    #[serde(skip_serializing_if = "Option::is_none")]
6491    pub network_id: Option<String>,
6492
6493    #[serde(rename = "Addr")]
6494    #[serde(skip_serializing_if = "Option::is_none")]
6495    pub addr: Option<String>,
6496
6497}
6498
6499/// 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. 
6500#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6501pub struct ServiceJobStatus {
6502    /// 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 
6503    #[serde(rename = "JobIteration")]
6504    #[serde(skip_serializing_if = "Option::is_none")]
6505    pub job_iteration: Option<ObjectVersion>,
6506
6507    /// The last time, as observed by the server, that this job was started. 
6508    #[serde(rename = "LastExecution")]
6509    #[serde(skip_serializing_if = "Option::is_none")]
6510    #[serde(
6511        default,
6512        deserialize_with = "deserialize_timestamp",
6513        serialize_with = "serialize_timestamp"
6514    )]
6515    pub last_execution: Option<BollardDate>,
6516
6517}
6518
6519/// The status of the service's tasks. Provided only when requested as part of a ServiceList operation. 
6520#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6521pub struct ServiceServiceStatus {
6522    /// The number of tasks for the service currently in the Running state. 
6523    #[serde(rename = "RunningTasks")]
6524    #[serde(skip_serializing_if = "Option::is_none")]
6525    pub running_tasks: Option<u64>,
6526
6527    /// 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. 
6528    #[serde(rename = "DesiredTasks")]
6529    #[serde(skip_serializing_if = "Option::is_none")]
6530    pub desired_tasks: Option<u64>,
6531
6532    /// 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. 
6533    #[serde(rename = "CompletedTasks")]
6534    #[serde(skip_serializing_if = "Option::is_none")]
6535    pub completed_tasks: Option<u64>,
6536
6537}
6538
6539/// User modifiable configuration for a service.
6540#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6541pub struct ServiceSpec {
6542    /// Name of the service.
6543    #[serde(rename = "Name")]
6544    #[serde(skip_serializing_if = "Option::is_none")]
6545    pub name: Option<String>,
6546
6547    /// User-defined key/value metadata.
6548    #[serde(rename = "Labels")]
6549    #[serde(skip_serializing_if = "Option::is_none")]
6550    pub labels: Option<HashMap<String, String>>,
6551
6552    #[serde(rename = "TaskTemplate")]
6553    #[serde(skip_serializing_if = "Option::is_none")]
6554    pub task_template: Option<TaskSpec>,
6555
6556    #[serde(rename = "Mode")]
6557    #[serde(skip_serializing_if = "Option::is_none")]
6558    pub mode: Option<ServiceSpecMode>,
6559
6560    #[serde(rename = "UpdateConfig")]
6561    #[serde(skip_serializing_if = "Option::is_none")]
6562    pub update_config: Option<ServiceSpecUpdateConfig>,
6563
6564    #[serde(rename = "RollbackConfig")]
6565    #[serde(skip_serializing_if = "Option::is_none")]
6566    pub rollback_config: Option<ServiceSpecRollbackConfig>,
6567
6568    /// Specifies which networks the service should attach to.  Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. 
6569    #[serde(rename = "Networks")]
6570    #[serde(skip_serializing_if = "Option::is_none")]
6571    pub networks: Option<Vec<NetworkAttachmentConfig>>,
6572
6573    #[serde(rename = "EndpointSpec")]
6574    #[serde(skip_serializing_if = "Option::is_none")]
6575    pub endpoint_spec: Option<EndpointSpec>,
6576
6577}
6578
6579/// Scheduling mode for the service.
6580#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6581pub struct ServiceSpecMode {
6582    #[serde(rename = "Replicated")]
6583    #[serde(skip_serializing_if = "Option::is_none")]
6584    pub replicated: Option<ServiceSpecModeReplicated>,
6585
6586    #[serde(rename = "Global")]
6587    #[serde(skip_serializing_if = "Option::is_none")]
6588    pub global: Option<HashMap<(), ()>>,
6589
6590    #[serde(rename = "ReplicatedJob")]
6591    #[serde(skip_serializing_if = "Option::is_none")]
6592    pub replicated_job: Option<ServiceSpecModeReplicatedJob>,
6593
6594    /// The mode used for services which run a task to the completed state on each valid node. 
6595    #[serde(rename = "GlobalJob")]
6596    #[serde(skip_serializing_if = "Option::is_none")]
6597    pub global_job: Option<HashMap<(), ()>>,
6598
6599}
6600
6601#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6602pub struct ServiceSpecModeReplicated {
6603    #[serde(rename = "Replicas")]
6604    #[serde(skip_serializing_if = "Option::is_none")]
6605    pub replicas: Option<i64>,
6606
6607}
6608
6609/// The mode used for services with a finite number of tasks that run to a completed state. 
6610#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6611pub struct ServiceSpecModeReplicatedJob {
6612    /// The maximum number of replicas to run simultaneously. 
6613    #[serde(rename = "MaxConcurrent")]
6614    #[serde(skip_serializing_if = "Option::is_none")]
6615    pub max_concurrent: Option<i64>,
6616
6617    /// The total number of replicas desired to reach the Completed state. If unset, will default to the value of `MaxConcurrent` 
6618    #[serde(rename = "TotalCompletions")]
6619    #[serde(skip_serializing_if = "Option::is_none")]
6620    pub total_completions: Option<i64>,
6621
6622}
6623
6624/// Specification for the rollback strategy of the service.
6625#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6626pub struct ServiceSpecRollbackConfig {
6627    /// Maximum number of tasks to be rolled back in one iteration (0 means unlimited parallelism). 
6628    #[serde(rename = "Parallelism")]
6629    #[serde(skip_serializing_if = "Option::is_none")]
6630    pub parallelism: Option<i64>,
6631
6632    /// Amount of time between rollback iterations, in nanoseconds. 
6633    #[serde(rename = "Delay")]
6634    #[serde(skip_serializing_if = "Option::is_none")]
6635    pub delay: Option<i64>,
6636
6637    /// Action to take if an rolled back task fails to run, or stops running during the rollback. 
6638    #[serde(rename = "FailureAction")]
6639    #[serde(skip_serializing_if = "Option::is_none")]
6640    pub failure_action: Option<ServiceSpecRollbackConfigFailureActionEnum>,
6641
6642    /// Amount of time to monitor each rolled back task for failures, in nanoseconds. 
6643    #[serde(rename = "Monitor")]
6644    #[serde(skip_serializing_if = "Option::is_none")]
6645    pub monitor: Option<i64>,
6646
6647    /// 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. 
6648    #[serde(rename = "MaxFailureRatio")]
6649    #[serde(skip_serializing_if = "Option::is_none")]
6650    pub max_failure_ratio: Option<f64>,
6651
6652    /// 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. 
6653    #[serde(rename = "Order")]
6654    #[serde(skip_serializing_if = "Option::is_none")]
6655    pub order: Option<ServiceSpecRollbackConfigOrderEnum>,
6656
6657}
6658
6659#[allow(non_camel_case_types)]
6660#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
6661pub enum ServiceSpecRollbackConfigFailureActionEnum { 
6662    #[serde(rename = "")]
6663    EMPTY,
6664    #[serde(rename = "continue")]
6665    CONTINUE,
6666    #[serde(rename = "pause")]
6667    PAUSE,
6668}
6669
6670impl ::std::fmt::Display for ServiceSpecRollbackConfigFailureActionEnum {
6671    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
6672        match *self { 
6673            ServiceSpecRollbackConfigFailureActionEnum::EMPTY => write!(f, ""),
6674            ServiceSpecRollbackConfigFailureActionEnum::CONTINUE => write!(f, "{}", "continue"),
6675            ServiceSpecRollbackConfigFailureActionEnum::PAUSE => write!(f, "{}", "pause"),
6676
6677        }
6678    }
6679}
6680
6681impl ::std::str::FromStr for ServiceSpecRollbackConfigFailureActionEnum {
6682    type Err = String;
6683    fn from_str(s: &str) -> Result<Self, Self::Err> {
6684        match s { 
6685            "" => Ok(ServiceSpecRollbackConfigFailureActionEnum::EMPTY),
6686            "continue" => Ok(ServiceSpecRollbackConfigFailureActionEnum::CONTINUE),
6687            "pause" => Ok(ServiceSpecRollbackConfigFailureActionEnum::PAUSE),
6688            x => Err(format!("Invalid enum type: {}", x)),
6689        }
6690    }
6691}
6692
6693impl ::std::convert::AsRef<str> for ServiceSpecRollbackConfigFailureActionEnum {
6694    fn as_ref(&self) -> &str {
6695        match self { 
6696            ServiceSpecRollbackConfigFailureActionEnum::EMPTY => "",
6697            ServiceSpecRollbackConfigFailureActionEnum::CONTINUE => "continue",
6698            ServiceSpecRollbackConfigFailureActionEnum::PAUSE => "pause",
6699        }
6700    }
6701}
6702
6703#[allow(non_camel_case_types)]
6704#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
6705pub enum ServiceSpecRollbackConfigOrderEnum { 
6706    #[serde(rename = "")]
6707    EMPTY,
6708    #[serde(rename = "stop-first")]
6709    STOP_FIRST,
6710    #[serde(rename = "start-first")]
6711    START_FIRST,
6712}
6713
6714impl ::std::fmt::Display for ServiceSpecRollbackConfigOrderEnum {
6715    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
6716        match *self { 
6717            ServiceSpecRollbackConfigOrderEnum::EMPTY => write!(f, ""),
6718            ServiceSpecRollbackConfigOrderEnum::STOP_FIRST => write!(f, "{}", "stop-first"),
6719            ServiceSpecRollbackConfigOrderEnum::START_FIRST => write!(f, "{}", "start-first"),
6720
6721        }
6722    }
6723}
6724
6725impl ::std::str::FromStr for ServiceSpecRollbackConfigOrderEnum {
6726    type Err = String;
6727    fn from_str(s: &str) -> Result<Self, Self::Err> {
6728        match s { 
6729            "" => Ok(ServiceSpecRollbackConfigOrderEnum::EMPTY),
6730            "stop-first" => Ok(ServiceSpecRollbackConfigOrderEnum::STOP_FIRST),
6731            "start-first" => Ok(ServiceSpecRollbackConfigOrderEnum::START_FIRST),
6732            x => Err(format!("Invalid enum type: {}", x)),
6733        }
6734    }
6735}
6736
6737impl ::std::convert::AsRef<str> for ServiceSpecRollbackConfigOrderEnum {
6738    fn as_ref(&self) -> &str {
6739        match self { 
6740            ServiceSpecRollbackConfigOrderEnum::EMPTY => "",
6741            ServiceSpecRollbackConfigOrderEnum::STOP_FIRST => "stop-first",
6742            ServiceSpecRollbackConfigOrderEnum::START_FIRST => "start-first",
6743        }
6744    }
6745}
6746
6747/// Specification for the update strategy of the service.
6748#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6749pub struct ServiceSpecUpdateConfig {
6750    /// Maximum number of tasks to be updated in one iteration (0 means unlimited parallelism). 
6751    #[serde(rename = "Parallelism")]
6752    #[serde(skip_serializing_if = "Option::is_none")]
6753    pub parallelism: Option<i64>,
6754
6755    /// Amount of time between updates, in nanoseconds.
6756    #[serde(rename = "Delay")]
6757    #[serde(skip_serializing_if = "Option::is_none")]
6758    pub delay: Option<i64>,
6759
6760    /// Action to take if an updated task fails to run, or stops running during the update. 
6761    #[serde(rename = "FailureAction")]
6762    #[serde(skip_serializing_if = "Option::is_none")]
6763    pub failure_action: Option<ServiceSpecUpdateConfigFailureActionEnum>,
6764
6765    /// Amount of time to monitor each updated task for failures, in nanoseconds. 
6766    #[serde(rename = "Monitor")]
6767    #[serde(skip_serializing_if = "Option::is_none")]
6768    pub monitor: Option<i64>,
6769
6770    /// 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. 
6771    #[serde(rename = "MaxFailureRatio")]
6772    #[serde(skip_serializing_if = "Option::is_none")]
6773    pub max_failure_ratio: Option<f64>,
6774
6775    /// 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. 
6776    #[serde(rename = "Order")]
6777    #[serde(skip_serializing_if = "Option::is_none")]
6778    pub order: Option<ServiceSpecUpdateConfigOrderEnum>,
6779
6780}
6781
6782#[allow(non_camel_case_types)]
6783#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
6784pub enum ServiceSpecUpdateConfigFailureActionEnum { 
6785    #[serde(rename = "")]
6786    EMPTY,
6787    #[serde(rename = "continue")]
6788    CONTINUE,
6789    #[serde(rename = "pause")]
6790    PAUSE,
6791    #[serde(rename = "rollback")]
6792    ROLLBACK,
6793}
6794
6795impl ::std::fmt::Display for ServiceSpecUpdateConfigFailureActionEnum {
6796    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
6797        match *self { 
6798            ServiceSpecUpdateConfigFailureActionEnum::EMPTY => write!(f, ""),
6799            ServiceSpecUpdateConfigFailureActionEnum::CONTINUE => write!(f, "{}", "continue"),
6800            ServiceSpecUpdateConfigFailureActionEnum::PAUSE => write!(f, "{}", "pause"),
6801            ServiceSpecUpdateConfigFailureActionEnum::ROLLBACK => write!(f, "{}", "rollback"),
6802
6803        }
6804    }
6805}
6806
6807impl ::std::str::FromStr for ServiceSpecUpdateConfigFailureActionEnum {
6808    type Err = String;
6809    fn from_str(s: &str) -> Result<Self, Self::Err> {
6810        match s { 
6811            "" => Ok(ServiceSpecUpdateConfigFailureActionEnum::EMPTY),
6812            "continue" => Ok(ServiceSpecUpdateConfigFailureActionEnum::CONTINUE),
6813            "pause" => Ok(ServiceSpecUpdateConfigFailureActionEnum::PAUSE),
6814            "rollback" => Ok(ServiceSpecUpdateConfigFailureActionEnum::ROLLBACK),
6815            x => Err(format!("Invalid enum type: {}", x)),
6816        }
6817    }
6818}
6819
6820impl ::std::convert::AsRef<str> for ServiceSpecUpdateConfigFailureActionEnum {
6821    fn as_ref(&self) -> &str {
6822        match self { 
6823            ServiceSpecUpdateConfigFailureActionEnum::EMPTY => "",
6824            ServiceSpecUpdateConfigFailureActionEnum::CONTINUE => "continue",
6825            ServiceSpecUpdateConfigFailureActionEnum::PAUSE => "pause",
6826            ServiceSpecUpdateConfigFailureActionEnum::ROLLBACK => "rollback",
6827        }
6828    }
6829}
6830
6831#[allow(non_camel_case_types)]
6832#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
6833pub enum ServiceSpecUpdateConfigOrderEnum { 
6834    #[serde(rename = "")]
6835    EMPTY,
6836    #[serde(rename = "stop-first")]
6837    STOP_FIRST,
6838    #[serde(rename = "start-first")]
6839    START_FIRST,
6840}
6841
6842impl ::std::fmt::Display for ServiceSpecUpdateConfigOrderEnum {
6843    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
6844        match *self { 
6845            ServiceSpecUpdateConfigOrderEnum::EMPTY => write!(f, ""),
6846            ServiceSpecUpdateConfigOrderEnum::STOP_FIRST => write!(f, "{}", "stop-first"),
6847            ServiceSpecUpdateConfigOrderEnum::START_FIRST => write!(f, "{}", "start-first"),
6848
6849        }
6850    }
6851}
6852
6853impl ::std::str::FromStr for ServiceSpecUpdateConfigOrderEnum {
6854    type Err = String;
6855    fn from_str(s: &str) -> Result<Self, Self::Err> {
6856        match s { 
6857            "" => Ok(ServiceSpecUpdateConfigOrderEnum::EMPTY),
6858            "stop-first" => Ok(ServiceSpecUpdateConfigOrderEnum::STOP_FIRST),
6859            "start-first" => Ok(ServiceSpecUpdateConfigOrderEnum::START_FIRST),
6860            x => Err(format!("Invalid enum type: {}", x)),
6861        }
6862    }
6863}
6864
6865impl ::std::convert::AsRef<str> for ServiceSpecUpdateConfigOrderEnum {
6866    fn as_ref(&self) -> &str {
6867        match self { 
6868            ServiceSpecUpdateConfigOrderEnum::EMPTY => "",
6869            ServiceSpecUpdateConfigOrderEnum::STOP_FIRST => "stop-first",
6870            ServiceSpecUpdateConfigOrderEnum::START_FIRST => "start-first",
6871        }
6872    }
6873}
6874
6875#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6876pub struct ServiceUpdateResponse {
6877    /// Optional warning messages
6878    #[serde(rename = "Warnings")]
6879    #[serde(skip_serializing_if = "Option::is_none")]
6880    pub warnings: Option<Vec<String>>,
6881
6882}
6883
6884/// The status of a service update.
6885#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6886pub struct ServiceUpdateStatus {
6887    #[serde(rename = "State")]
6888    #[serde(skip_serializing_if = "Option::is_none")]
6889    pub state: Option<ServiceUpdateStatusStateEnum>,
6890
6891    #[serde(rename = "StartedAt")]
6892    #[serde(skip_serializing_if = "Option::is_none")]
6893    #[serde(
6894        default,
6895        deserialize_with = "deserialize_timestamp",
6896        serialize_with = "serialize_timestamp"
6897    )]
6898    pub started_at: Option<BollardDate>,
6899
6900    #[serde(rename = "CompletedAt")]
6901    #[serde(skip_serializing_if = "Option::is_none")]
6902    #[serde(
6903        default,
6904        deserialize_with = "deserialize_timestamp",
6905        serialize_with = "serialize_timestamp"
6906    )]
6907    pub completed_at: Option<BollardDate>,
6908
6909    #[serde(rename = "Message")]
6910    #[serde(skip_serializing_if = "Option::is_none")]
6911    pub message: Option<String>,
6912
6913}
6914
6915#[allow(non_camel_case_types)]
6916#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
6917pub enum ServiceUpdateStatusStateEnum { 
6918    #[serde(rename = "")]
6919    EMPTY,
6920    #[serde(rename = "updating")]
6921    UPDATING,
6922    #[serde(rename = "paused")]
6923    PAUSED,
6924    #[serde(rename = "completed")]
6925    COMPLETED,
6926    #[serde(rename = "rollback_started")]
6927    ROLLBACK_STARTED,
6928    #[serde(rename = "rollback_paused")]
6929    ROLLBACK_PAUSED,
6930    #[serde(rename = "rollback_completed")]
6931    ROLLBACK_COMPLETED,
6932}
6933
6934impl ::std::fmt::Display for ServiceUpdateStatusStateEnum {
6935    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
6936        match *self { 
6937            ServiceUpdateStatusStateEnum::EMPTY => write!(f, ""),
6938            ServiceUpdateStatusStateEnum::UPDATING => write!(f, "{}", "updating"),
6939            ServiceUpdateStatusStateEnum::PAUSED => write!(f, "{}", "paused"),
6940            ServiceUpdateStatusStateEnum::COMPLETED => write!(f, "{}", "completed"),
6941            ServiceUpdateStatusStateEnum::ROLLBACK_STARTED => write!(f, "{}", "rollback_started"),
6942            ServiceUpdateStatusStateEnum::ROLLBACK_PAUSED => write!(f, "{}", "rollback_paused"),
6943            ServiceUpdateStatusStateEnum::ROLLBACK_COMPLETED => write!(f, "{}", "rollback_completed"),
6944
6945        }
6946    }
6947}
6948
6949impl ::std::str::FromStr for ServiceUpdateStatusStateEnum {
6950    type Err = String;
6951    fn from_str(s: &str) -> Result<Self, Self::Err> {
6952        match s { 
6953            "" => Ok(ServiceUpdateStatusStateEnum::EMPTY),
6954            "updating" => Ok(ServiceUpdateStatusStateEnum::UPDATING),
6955            "paused" => Ok(ServiceUpdateStatusStateEnum::PAUSED),
6956            "completed" => Ok(ServiceUpdateStatusStateEnum::COMPLETED),
6957            "rollback_started" => Ok(ServiceUpdateStatusStateEnum::ROLLBACK_STARTED),
6958            "rollback_paused" => Ok(ServiceUpdateStatusStateEnum::ROLLBACK_PAUSED),
6959            "rollback_completed" => Ok(ServiceUpdateStatusStateEnum::ROLLBACK_COMPLETED),
6960            x => Err(format!("Invalid enum type: {}", x)),
6961        }
6962    }
6963}
6964
6965impl ::std::convert::AsRef<str> for ServiceUpdateStatusStateEnum {
6966    fn as_ref(&self) -> &str {
6967        match self { 
6968            ServiceUpdateStatusStateEnum::EMPTY => "",
6969            ServiceUpdateStatusStateEnum::UPDATING => "updating",
6970            ServiceUpdateStatusStateEnum::PAUSED => "paused",
6971            ServiceUpdateStatusStateEnum::COMPLETED => "completed",
6972            ServiceUpdateStatusStateEnum::ROLLBACK_STARTED => "rollback_started",
6973            ServiceUpdateStatusStateEnum::ROLLBACK_PAUSED => "rollback_paused",
6974            ServiceUpdateStatusStateEnum::ROLLBACK_COMPLETED => "rollback_completed",
6975        }
6976    }
6977}
6978
6979#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
6980pub struct Swarm {
6981    /// The ID of the swarm.
6982    #[serde(rename = "ID")]
6983    #[serde(skip_serializing_if = "Option::is_none")]
6984    pub id: Option<String>,
6985
6986    #[serde(rename = "Version")]
6987    #[serde(skip_serializing_if = "Option::is_none")]
6988    pub version: Option<ObjectVersion>,
6989
6990    /// Date and time at which the swarm was initialised in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
6991    #[serde(rename = "CreatedAt")]
6992    #[serde(skip_serializing_if = "Option::is_none")]
6993    #[serde(
6994        default,
6995        deserialize_with = "deserialize_timestamp",
6996        serialize_with = "serialize_timestamp"
6997    )]
6998    pub created_at: Option<BollardDate>,
6999
7000    /// Date and time at which the swarm was last updated in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
7001    #[serde(rename = "UpdatedAt")]
7002    #[serde(skip_serializing_if = "Option::is_none")]
7003    #[serde(
7004        default,
7005        deserialize_with = "deserialize_timestamp",
7006        serialize_with = "serialize_timestamp"
7007    )]
7008    pub updated_at: Option<BollardDate>,
7009
7010    #[serde(rename = "Spec")]
7011    #[serde(skip_serializing_if = "Option::is_none")]
7012    pub spec: Option<SwarmSpec>,
7013
7014    #[serde(rename = "TLSInfo")]
7015    #[serde(skip_serializing_if = "Option::is_none")]
7016    pub tls_info: Option<TlsInfo>,
7017
7018    /// Whether there is currently a root CA rotation in progress for the swarm 
7019    #[serde(rename = "RootRotationInProgress")]
7020    #[serde(skip_serializing_if = "Option::is_none")]
7021    pub root_rotation_in_progress: Option<bool>,
7022
7023    /// 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. 
7024    #[serde(rename = "DataPathPort")]
7025    #[serde(skip_serializing_if = "Option::is_none")]
7026    pub data_path_port: Option<u32>,
7027
7028    /// Default Address Pool specifies default subnet pools for global scope networks. 
7029    #[serde(rename = "DefaultAddrPool")]
7030    #[serde(skip_serializing_if = "Option::is_none")]
7031    pub default_addr_pool: Option<Vec<String>>,
7032
7033    /// SubnetSize specifies the subnet size of the networks created from the default subnet pool. 
7034    #[serde(rename = "SubnetSize")]
7035    #[serde(skip_serializing_if = "Option::is_none")]
7036    pub subnet_size: Option<u32>,
7037
7038    #[serde(rename = "JoinTokens")]
7039    #[serde(skip_serializing_if = "Option::is_none")]
7040    pub join_tokens: Option<JoinTokens>,
7041
7042}
7043
7044/// Represents generic information about swarm. 
7045#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7046pub struct SwarmInfo {
7047    /// Unique identifier of for this node in the swarm.
7048    #[serde(rename = "NodeID")]
7049    #[serde(skip_serializing_if = "Option::is_none")]
7050    pub node_id: Option<String>,
7051
7052    /// IP address at which this node can be reached by other nodes in the swarm. 
7053    #[serde(rename = "NodeAddr")]
7054    #[serde(skip_serializing_if = "Option::is_none")]
7055    pub node_addr: Option<String>,
7056
7057    #[serde(rename = "LocalNodeState")]
7058    #[serde(skip_serializing_if = "Option::is_none")]
7059    pub local_node_state: Option<LocalNodeState>,
7060
7061    #[serde(rename = "ControlAvailable")]
7062    #[serde(skip_serializing_if = "Option::is_none")]
7063    pub control_available: Option<bool>,
7064
7065    #[serde(rename = "Error")]
7066    #[serde(skip_serializing_if = "Option::is_none")]
7067    pub error: Option<String>,
7068
7069    /// List of ID's and addresses of other managers in the swarm. 
7070    #[serde(rename = "RemoteManagers")]
7071    #[serde(skip_serializing_if = "Option::is_none")]
7072    pub remote_managers: Option<Vec<PeerNode>>,
7073
7074    /// Total number of nodes in the swarm.
7075    #[serde(rename = "Nodes")]
7076    #[serde(skip_serializing_if = "Option::is_none")]
7077    pub nodes: Option<i64>,
7078
7079    /// Total number of managers in the swarm.
7080    #[serde(rename = "Managers")]
7081    #[serde(skip_serializing_if = "Option::is_none")]
7082    pub managers: Option<i64>,
7083
7084    #[serde(rename = "Cluster")]
7085    #[serde(skip_serializing_if = "Option::is_none")]
7086    pub cluster: Option<ClusterInfo>,
7087
7088}
7089
7090#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7091pub struct SwarmInitRequest {
7092    /// 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. 
7093    #[serde(rename = "ListenAddr")]
7094    #[serde(skip_serializing_if = "Option::is_none")]
7095    pub listen_addr: Option<String>,
7096
7097    /// 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. 
7098    #[serde(rename = "AdvertiseAddr")]
7099    #[serde(skip_serializing_if = "Option::is_none")]
7100    pub advertise_addr: Option<String>,
7101
7102    /// 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. 
7103    #[serde(rename = "DataPathAddr")]
7104    #[serde(skip_serializing_if = "Option::is_none")]
7105    pub data_path_addr: Option<String>,
7106
7107    /// 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. 
7108    #[serde(rename = "DataPathPort")]
7109    #[serde(skip_serializing_if = "Option::is_none")]
7110    pub data_path_port: Option<u32>,
7111
7112    /// Default Address Pool specifies default subnet pools for global scope networks. 
7113    #[serde(rename = "DefaultAddrPool")]
7114    #[serde(skip_serializing_if = "Option::is_none")]
7115    pub default_addr_pool: Option<Vec<String>>,
7116
7117    /// Force creation of a new swarm.
7118    #[serde(rename = "ForceNewCluster")]
7119    #[serde(skip_serializing_if = "Option::is_none")]
7120    pub force_new_cluster: Option<bool>,
7121
7122    /// SubnetSize specifies the subnet size of the networks created from the default subnet pool. 
7123    #[serde(rename = "SubnetSize")]
7124    #[serde(skip_serializing_if = "Option::is_none")]
7125    pub subnet_size: Option<u32>,
7126
7127    #[serde(rename = "Spec")]
7128    #[serde(skip_serializing_if = "Option::is_none")]
7129    pub spec: Option<SwarmSpec>,
7130
7131}
7132
7133#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7134pub struct SwarmJoinRequest {
7135    /// 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). 
7136    #[serde(rename = "ListenAddr")]
7137    #[serde(skip_serializing_if = "Option::is_none")]
7138    pub listen_addr: Option<String>,
7139
7140    /// 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. 
7141    #[serde(rename = "AdvertiseAddr")]
7142    #[serde(skip_serializing_if = "Option::is_none")]
7143    pub advertise_addr: Option<String>,
7144
7145    /// 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. 
7146    #[serde(rename = "DataPathAddr")]
7147    #[serde(skip_serializing_if = "Option::is_none")]
7148    pub data_path_addr: Option<String>,
7149
7150    /// Addresses of manager nodes already participating in the swarm. 
7151    #[serde(rename = "RemoteAddrs")]
7152    #[serde(skip_serializing_if = "Option::is_none")]
7153    pub remote_addrs: Option<Vec<String>>,
7154
7155    /// Secret token for joining this swarm.
7156    #[serde(rename = "JoinToken")]
7157    #[serde(skip_serializing_if = "Option::is_none")]
7158    pub join_token: Option<String>,
7159
7160}
7161
7162/// User modifiable swarm configuration.
7163#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7164pub struct SwarmSpec {
7165    /// Name of the swarm.
7166    #[serde(rename = "Name")]
7167    #[serde(skip_serializing_if = "Option::is_none")]
7168    pub name: Option<String>,
7169
7170    /// User-defined key/value metadata.
7171    #[serde(rename = "Labels")]
7172    #[serde(skip_serializing_if = "Option::is_none")]
7173    pub labels: Option<HashMap<String, String>>,
7174
7175    #[serde(rename = "Orchestration")]
7176    #[serde(skip_serializing_if = "Option::is_none")]
7177    pub orchestration: Option<SwarmSpecOrchestration>,
7178
7179    #[serde(rename = "Raft")]
7180    #[serde(skip_serializing_if = "Option::is_none")]
7181    pub raft: Option<SwarmSpecRaft>,
7182
7183    #[serde(rename = "Dispatcher")]
7184    #[serde(skip_serializing_if = "Option::is_none")]
7185    pub dispatcher: Option<SwarmSpecDispatcher>,
7186
7187    #[serde(rename = "CAConfig")]
7188    #[serde(skip_serializing_if = "Option::is_none")]
7189    pub ca_config: Option<SwarmSpecCaConfig>,
7190
7191    #[serde(rename = "EncryptionConfig")]
7192    #[serde(skip_serializing_if = "Option::is_none")]
7193    pub encryption_config: Option<SwarmSpecEncryptionConfig>,
7194
7195    #[serde(rename = "TaskDefaults")]
7196    #[serde(skip_serializing_if = "Option::is_none")]
7197    pub task_defaults: Option<SwarmSpecTaskDefaults>,
7198
7199}
7200
7201/// CA configuration.
7202#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7203pub struct SwarmSpecCaConfig {
7204    /// The duration node certificates are issued for.
7205    #[serde(rename = "NodeCertExpiry")]
7206    #[serde(skip_serializing_if = "Option::is_none")]
7207    pub node_cert_expiry: Option<i64>,
7208
7209    /// Configuration for forwarding signing requests to an external certificate authority. 
7210    #[serde(rename = "ExternalCAs")]
7211    #[serde(skip_serializing_if = "Option::is_none")]
7212    pub external_cas: Option<Vec<SwarmSpecCaConfigExternalCas>>,
7213
7214    /// The desired signing CA certificate for all swarm node TLS leaf certificates, in PEM format. 
7215    #[serde(rename = "SigningCACert")]
7216    #[serde(skip_serializing_if = "Option::is_none")]
7217    pub signing_ca_cert: Option<String>,
7218
7219    /// The desired signing CA key for all swarm node TLS leaf certificates, in PEM format. 
7220    #[serde(rename = "SigningCAKey")]
7221    #[serde(skip_serializing_if = "Option::is_none")]
7222    pub signing_ca_key: Option<String>,
7223
7224    /// 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` 
7225    #[serde(rename = "ForceRotate")]
7226    #[serde(skip_serializing_if = "Option::is_none")]
7227    pub force_rotate: Option<u64>,
7228
7229}
7230
7231#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7232pub struct SwarmSpecCaConfigExternalCas {
7233    /// Protocol for communication with the external CA (currently only `cfssl` is supported). 
7234    #[serde(rename = "Protocol")]
7235    #[serde(skip_serializing_if = "Option::is_none")]
7236    pub protocol: Option<SwarmSpecCaConfigExternalCasProtocolEnum>,
7237
7238    /// URL where certificate signing requests should be sent. 
7239    #[serde(rename = "URL")]
7240    #[serde(skip_serializing_if = "Option::is_none")]
7241    pub url: Option<String>,
7242
7243    /// An object with key/value pairs that are interpreted as protocol-specific options for the external CA driver. 
7244    #[serde(rename = "Options")]
7245    #[serde(skip_serializing_if = "Option::is_none")]
7246    pub options: Option<HashMap<String, String>>,
7247
7248    /// 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). 
7249    #[serde(rename = "CACert")]
7250    #[serde(skip_serializing_if = "Option::is_none")]
7251    pub ca_cert: Option<String>,
7252
7253}
7254
7255#[allow(non_camel_case_types)]
7256#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
7257pub enum SwarmSpecCaConfigExternalCasProtocolEnum { 
7258    #[serde(rename = "")]
7259    EMPTY,
7260    #[serde(rename = "cfssl")]
7261    CFSSL,
7262}
7263
7264impl ::std::fmt::Display for SwarmSpecCaConfigExternalCasProtocolEnum {
7265    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
7266        match *self { 
7267            SwarmSpecCaConfigExternalCasProtocolEnum::EMPTY => write!(f, ""),
7268            SwarmSpecCaConfigExternalCasProtocolEnum::CFSSL => write!(f, "{}", "cfssl"),
7269
7270        }
7271    }
7272}
7273
7274impl ::std::str::FromStr for SwarmSpecCaConfigExternalCasProtocolEnum {
7275    type Err = String;
7276    fn from_str(s: &str) -> Result<Self, Self::Err> {
7277        match s { 
7278            "" => Ok(SwarmSpecCaConfigExternalCasProtocolEnum::EMPTY),
7279            "cfssl" => Ok(SwarmSpecCaConfigExternalCasProtocolEnum::CFSSL),
7280            x => Err(format!("Invalid enum type: {}", x)),
7281        }
7282    }
7283}
7284
7285impl ::std::convert::AsRef<str> for SwarmSpecCaConfigExternalCasProtocolEnum {
7286    fn as_ref(&self) -> &str {
7287        match self { 
7288            SwarmSpecCaConfigExternalCasProtocolEnum::EMPTY => "",
7289            SwarmSpecCaConfigExternalCasProtocolEnum::CFSSL => "cfssl",
7290        }
7291    }
7292}
7293
7294/// Dispatcher configuration.
7295#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7296pub struct SwarmSpecDispatcher {
7297    /// The delay for an agent to send a heartbeat to the dispatcher. 
7298    #[serde(rename = "HeartbeatPeriod")]
7299    #[serde(skip_serializing_if = "Option::is_none")]
7300    pub heartbeat_period: Option<i64>,
7301
7302}
7303
7304/// Parameters related to encryption-at-rest.
7305#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7306pub struct SwarmSpecEncryptionConfig {
7307    /// If set, generate a key and use it to lock data stored on the managers. 
7308    #[serde(rename = "AutoLockManagers")]
7309    #[serde(skip_serializing_if = "Option::is_none")]
7310    pub auto_lock_managers: Option<bool>,
7311
7312}
7313
7314/// Orchestration configuration.
7315#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7316pub struct SwarmSpecOrchestration {
7317    /// The number of historic tasks to keep per instance or node. If negative, never remove completed or failed tasks. 
7318    #[serde(rename = "TaskHistoryRetentionLimit")]
7319    #[serde(skip_serializing_if = "Option::is_none")]
7320    pub task_history_retention_limit: Option<i64>,
7321
7322}
7323
7324/// Raft configuration.
7325#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7326pub struct SwarmSpecRaft {
7327    /// The number of log entries between snapshots.
7328    #[serde(rename = "SnapshotInterval")]
7329    #[serde(skip_serializing_if = "Option::is_none")]
7330    pub snapshot_interval: Option<u64>,
7331
7332    /// The number of snapshots to keep beyond the current snapshot. 
7333    #[serde(rename = "KeepOldSnapshots")]
7334    #[serde(skip_serializing_if = "Option::is_none")]
7335    pub keep_old_snapshots: Option<u64>,
7336
7337    /// The number of log entries to keep around to sync up slow followers after a snapshot is created. 
7338    #[serde(rename = "LogEntriesForSlowFollowers")]
7339    #[serde(skip_serializing_if = "Option::is_none")]
7340    pub log_entries_for_slow_followers: Option<u64>,
7341
7342    /// 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. 
7343    #[serde(rename = "ElectionTick")]
7344    #[serde(skip_serializing_if = "Option::is_none")]
7345    pub election_tick: Option<i64>,
7346
7347    /// 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. 
7348    #[serde(rename = "HeartbeatTick")]
7349    #[serde(skip_serializing_if = "Option::is_none")]
7350    pub heartbeat_tick: Option<i64>,
7351
7352}
7353
7354/// Defaults for creating tasks in this cluster.
7355#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7356pub struct SwarmSpecTaskDefaults {
7357    #[serde(rename = "LogDriver")]
7358    #[serde(skip_serializing_if = "Option::is_none")]
7359    pub log_driver: Option<SwarmSpecTaskDefaultsLogDriver>,
7360
7361}
7362
7363/// 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. 
7364#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7365pub struct SwarmSpecTaskDefaultsLogDriver {
7366    /// The log driver to use as a default for new tasks. 
7367    #[serde(rename = "Name")]
7368    #[serde(skip_serializing_if = "Option::is_none")]
7369    pub name: Option<String>,
7370
7371    /// Driver-specific options for the selected log driver, specified as key/value pairs. 
7372    #[serde(rename = "Options")]
7373    #[serde(skip_serializing_if = "Option::is_none")]
7374    pub options: Option<HashMap<String, String>>,
7375
7376}
7377
7378#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7379pub struct SwarmUnlockRequest {
7380    /// The swarm's unlock key.
7381    #[serde(rename = "UnlockKey")]
7382    #[serde(skip_serializing_if = "Option::is_none")]
7383    pub unlock_key: Option<String>,
7384
7385}
7386
7387#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7388pub struct SystemAuthResponse {
7389    /// The status of the authentication
7390    #[serde(rename = "Status")]
7391    pub status: String,
7392
7393    /// An opaque token used to authenticate a user after a successful login
7394    #[serde(rename = "IdentityToken")]
7395    #[serde(skip_serializing_if = "Option::is_none")]
7396    pub identity_token: Option<String>,
7397
7398}
7399
7400#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7401pub struct SystemDataUsageResponse {
7402    #[serde(rename = "LayersSize")]
7403    #[serde(skip_serializing_if = "Option::is_none")]
7404    pub layers_size: Option<i64>,
7405
7406    #[serde(rename = "Images")]
7407    #[serde(skip_serializing_if = "Option::is_none")]
7408    pub images: Option<Vec<ImageSummary>>,
7409
7410    #[serde(rename = "Containers")]
7411    #[serde(skip_serializing_if = "Option::is_none")]
7412    pub containers: Option<Vec<ContainerSummary>>,
7413
7414    #[serde(rename = "Volumes")]
7415    #[serde(skip_serializing_if = "Option::is_none")]
7416    pub volumes: Option<Vec<Volume>>,
7417
7418    #[serde(rename = "BuildCache")]
7419    #[serde(skip_serializing_if = "Option::is_none")]
7420    pub build_cache: Option<Vec<BuildCache>>,
7421
7422}
7423
7424#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7425pub struct SystemInfo {
7426    /// 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. 
7427    #[serde(rename = "ID")]
7428    #[serde(skip_serializing_if = "Option::is_none")]
7429    pub id: Option<String>,
7430
7431    /// Total number of containers on the host.
7432    #[serde(rename = "Containers")]
7433    #[serde(skip_serializing_if = "Option::is_none")]
7434    pub containers: Option<i64>,
7435
7436    /// Number of containers with status `\"running\"`. 
7437    #[serde(rename = "ContainersRunning")]
7438    #[serde(skip_serializing_if = "Option::is_none")]
7439    pub containers_running: Option<i64>,
7440
7441    /// Number of containers with status `\"paused\"`. 
7442    #[serde(rename = "ContainersPaused")]
7443    #[serde(skip_serializing_if = "Option::is_none")]
7444    pub containers_paused: Option<i64>,
7445
7446    /// Number of containers with status `\"stopped\"`. 
7447    #[serde(rename = "ContainersStopped")]
7448    #[serde(skip_serializing_if = "Option::is_none")]
7449    pub containers_stopped: Option<i64>,
7450
7451    /// Total number of images on the host.  Both _tagged_ and _untagged_ (dangling) images are counted. 
7452    #[serde(rename = "Images")]
7453    #[serde(skip_serializing_if = "Option::is_none")]
7454    pub images: Option<i64>,
7455
7456    /// Name of the storage driver in use.
7457    #[serde(rename = "Driver")]
7458    #[serde(skip_serializing_if = "Option::is_none")]
7459    pub driver: Option<String>,
7460
7461    /// 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. 
7462    #[serde(rename = "DriverStatus")]
7463    #[serde(skip_serializing_if = "Option::is_none")]
7464    pub driver_status: Option<Vec<Vec<String>>>,
7465
7466    /// Root directory of persistent Docker state.  Defaults to `/var/lib/docker` on Linux, and `C:\\ProgramData\\docker` on Windows. 
7467    #[serde(rename = "DockerRootDir")]
7468    #[serde(skip_serializing_if = "Option::is_none")]
7469    pub docker_root_dir: Option<String>,
7470
7471    #[serde(rename = "Plugins")]
7472    #[serde(skip_serializing_if = "Option::is_none")]
7473    pub plugins: Option<PluginsInfo>,
7474
7475    /// Indicates if the host has memory limit support enabled.
7476    #[serde(rename = "MemoryLimit")]
7477    #[serde(skip_serializing_if = "Option::is_none")]
7478    pub memory_limit: Option<bool>,
7479
7480    /// Indicates if the host has memory swap limit support enabled.
7481    #[serde(rename = "SwapLimit")]
7482    #[serde(skip_serializing_if = "Option::is_none")]
7483    pub swap_limit: Option<bool>,
7484
7485    /// Indicates if the host has kernel memory TCP limit support enabled. This field is omitted if not supported.  Kernel memory TCP limits are not supported when using cgroups v2, which does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup. 
7486    #[serde(rename = "KernelMemoryTCP")]
7487    #[serde(skip_serializing_if = "Option::is_none")]
7488    pub kernel_memory_tcp: Option<bool>,
7489
7490    /// Indicates if CPU CFS(Completely Fair Scheduler) period is supported by the host. 
7491    #[serde(rename = "CpuCfsPeriod")]
7492    #[serde(skip_serializing_if = "Option::is_none")]
7493    pub cpu_cfs_period: Option<bool>,
7494
7495    /// Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by the host. 
7496    #[serde(rename = "CpuCfsQuota")]
7497    #[serde(skip_serializing_if = "Option::is_none")]
7498    pub cpu_cfs_quota: Option<bool>,
7499
7500    /// Indicates if CPU Shares limiting is supported by the host. 
7501    #[serde(rename = "CPUShares")]
7502    #[serde(skip_serializing_if = "Option::is_none")]
7503    pub cpu_shares: Option<bool>,
7504
7505    /// 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) 
7506    #[serde(rename = "CPUSet")]
7507    #[serde(skip_serializing_if = "Option::is_none")]
7508    pub cpu_set: Option<bool>,
7509
7510    /// Indicates if the host kernel has PID limit support enabled.
7511    #[serde(rename = "PidsLimit")]
7512    #[serde(skip_serializing_if = "Option::is_none")]
7513    pub pids_limit: Option<bool>,
7514
7515    /// Indicates if OOM killer disable is supported on the host.
7516    #[serde(rename = "OomKillDisable")]
7517    #[serde(skip_serializing_if = "Option::is_none")]
7518    pub oom_kill_disable: Option<bool>,
7519
7520    /// Indicates IPv4 forwarding is enabled.
7521    #[serde(rename = "IPv4Forwarding")]
7522    #[serde(skip_serializing_if = "Option::is_none")]
7523    pub ipv4_forwarding: Option<bool>,
7524
7525    /// Indicates if `bridge-nf-call-iptables` is available on the host when the daemon was started.  <p><br /></p>  > **Deprecated**: netfilter module is now loaded on-demand and no longer > during daemon startup, making this field obsolete. This field is always > `false` and will be removed in a API v1.49. 
7526    #[serde(rename = "BridgeNfIptables")]
7527    #[serde(skip_serializing_if = "Option::is_none")]
7528    pub bridge_nf_iptables: Option<bool>,
7529
7530    /// Indicates if `bridge-nf-call-ip6tables` is available on the host.  <p><br /></p>  > **Deprecated**: netfilter module is now loaded on-demand, and no longer > during daemon startup, making this field obsolete. This field is always > `false` and will be removed in a API v1.49. 
7531    #[serde(rename = "BridgeNfIp6tables")]
7532    #[serde(skip_serializing_if = "Option::is_none")]
7533    pub bridge_nf_ip6tables: Option<bool>,
7534
7535    /// Indicates if the daemon is running in debug-mode / with debug-level logging enabled. 
7536    #[serde(rename = "Debug")]
7537    #[serde(skip_serializing_if = "Option::is_none")]
7538    pub debug: Option<bool>,
7539
7540    /// The total number of file Descriptors in use by the daemon process.  This information is only returned if debug-mode is enabled. 
7541    #[serde(rename = "NFd")]
7542    #[serde(skip_serializing_if = "Option::is_none")]
7543    pub nfd: Option<i64>,
7544
7545    /// The  number of goroutines that currently exist.  This information is only returned if debug-mode is enabled. 
7546    #[serde(rename = "NGoroutines")]
7547    #[serde(skip_serializing_if = "Option::is_none")]
7548    pub n_goroutines: Option<i64>,
7549
7550    /// Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. 
7551    #[serde(rename = "SystemTime")]
7552    #[serde(skip_serializing_if = "Option::is_none")]
7553    pub system_time: Option<String>,
7554
7555    /// The logging driver to use as a default for new containers. 
7556    #[serde(rename = "LoggingDriver")]
7557    #[serde(skip_serializing_if = "Option::is_none")]
7558    pub logging_driver: Option<String>,
7559
7560    /// The driver to use for managing cgroups. 
7561    #[serde(rename = "CgroupDriver")]
7562    #[serde(skip_serializing_if = "Option::is_none")]
7563    pub cgroup_driver: Option<SystemInfoCgroupDriverEnum>,
7564
7565    /// The version of the cgroup. 
7566    #[serde(rename = "CgroupVersion")]
7567    #[serde(skip_serializing_if = "Option::is_none")]
7568    pub cgroup_version: Option<SystemInfoCgroupVersionEnum>,
7569
7570    /// Number of event listeners subscribed.
7571    #[serde(rename = "NEventsListener")]
7572    #[serde(skip_serializing_if = "Option::is_none")]
7573    pub n_events_listener: Option<i64>,
7574
7575    /// 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)\"_. 
7576    #[serde(rename = "KernelVersion")]
7577    #[serde(skip_serializing_if = "Option::is_none")]
7578    pub kernel_version: Option<String>,
7579
7580    /// Name of the host's operating system, for example: \"Ubuntu 24.04 LTS\" or \"Windows Server 2016 Datacenter\" 
7581    #[serde(rename = "OperatingSystem")]
7582    #[serde(skip_serializing_if = "Option::is_none")]
7583    pub operating_system: Option<String>,
7584
7585    /// 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. 
7586    #[serde(rename = "OSVersion")]
7587    #[serde(skip_serializing_if = "Option::is_none")]
7588    pub os_version: Option<String>,
7589
7590    /// 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://go.dev/doc/install/source#environment). 
7591    #[serde(rename = "OSType")]
7592    #[serde(skip_serializing_if = "Option::is_none")]
7593    pub os_type: Option<String>,
7594
7595    /// 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://go.dev/doc/install/source#environment). 
7596    #[serde(rename = "Architecture")]
7597    #[serde(skip_serializing_if = "Option::is_none")]
7598    pub architecture: Option<String>,
7599
7600    /// 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. 
7601    #[serde(rename = "NCPU")]
7602    #[serde(skip_serializing_if = "Option::is_none")]
7603    pub ncpu: Option<i64>,
7604
7605    /// Total amount of physical memory available on the host, in bytes. 
7606    #[serde(rename = "MemTotal")]
7607    #[serde(skip_serializing_if = "Option::is_none")]
7608    pub mem_total: Option<i64>,
7609
7610    /// 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. 
7611    #[serde(rename = "IndexServerAddress")]
7612    #[serde(skip_serializing_if = "Option::is_none")]
7613    pub index_server_address: Option<String>,
7614
7615    #[serde(rename = "RegistryConfig")]
7616    #[serde(skip_serializing_if = "Option::is_none")]
7617    pub registry_config: Option<RegistryServiceConfig>,
7618
7619    #[serde(rename = "GenericResources")]
7620    #[serde(skip_serializing_if = "Option::is_none")]
7621    pub generic_resources: Option<GenericResources>,
7622
7623    /// 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. 
7624    #[serde(rename = "HttpProxy")]
7625    #[serde(skip_serializing_if = "Option::is_none")]
7626    pub http_proxy: Option<String>,
7627
7628    /// 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. 
7629    #[serde(rename = "HttpsProxy")]
7630    #[serde(skip_serializing_if = "Option::is_none")]
7631    pub https_proxy: Option<String>,
7632
7633    /// 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. 
7634    #[serde(rename = "NoProxy")]
7635    #[serde(skip_serializing_if = "Option::is_none")]
7636    pub no_proxy: Option<String>,
7637
7638    /// Hostname of the host.
7639    #[serde(rename = "Name")]
7640    #[serde(skip_serializing_if = "Option::is_none")]
7641    pub name: Option<String>,
7642
7643    /// 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. 
7644    #[serde(rename = "Labels")]
7645    #[serde(skip_serializing_if = "Option::is_none")]
7646    pub labels: Option<Vec<String>>,
7647
7648    /// Indicates if experimental features are enabled on the daemon. 
7649    #[serde(rename = "ExperimentalBuild")]
7650    #[serde(skip_serializing_if = "Option::is_none")]
7651    pub experimental_build: Option<bool>,
7652
7653    /// Version string of the daemon. 
7654    #[serde(rename = "ServerVersion")]
7655    #[serde(skip_serializing_if = "Option::is_none")]
7656    pub server_version: Option<String>,
7657
7658    /// 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. 
7659    #[serde(rename = "Runtimes")]
7660    #[serde(skip_serializing_if = "Option::is_none")]
7661    pub runtimes: Option<HashMap<String, Runtime>>,
7662
7663    /// Name of the default OCI runtime that is used when starting containers.  The default can be overridden per-container at create time. 
7664    #[serde(rename = "DefaultRuntime")]
7665    #[serde(skip_serializing_if = "Option::is_none")]
7666    pub default_runtime: Option<String>,
7667
7668    #[serde(rename = "Swarm")]
7669    #[serde(skip_serializing_if = "Option::is_none")]
7670    pub swarm: Option<SwarmInfo>,
7671
7672    /// 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. 
7673    #[serde(rename = "LiveRestoreEnabled")]
7674    #[serde(skip_serializing_if = "Option::is_none")]
7675    pub live_restore_enabled: Option<bool>,
7676
7677    /// 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. 
7678    #[serde(rename = "Isolation")]
7679    #[serde(skip_serializing_if = "Option::is_none")]
7680    pub isolation: Option<SystemInfoIsolationEnum>,
7681
7682    /// 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. 
7683    #[serde(rename = "InitBinary")]
7684    #[serde(skip_serializing_if = "Option::is_none")]
7685    pub init_binary: Option<String>,
7686
7687    #[serde(rename = "ContainerdCommit")]
7688    #[serde(skip_serializing_if = "Option::is_none")]
7689    pub containerd_commit: Option<Commit>,
7690
7691    #[serde(rename = "RuncCommit")]
7692    #[serde(skip_serializing_if = "Option::is_none")]
7693    pub runc_commit: Option<Commit>,
7694
7695    #[serde(rename = "InitCommit")]
7696    #[serde(skip_serializing_if = "Option::is_none")]
7697    pub init_commit: Option<Commit>,
7698
7699    /// List of security features that are enabled on the daemon, such as apparmor, seccomp, SELinux, user-namespaces (userns), rootless and no-new-privileges.  Additional configuration options for each security feature may be present, and are included as a comma-separated list of key/value pairs. 
7700    #[serde(rename = "SecurityOptions")]
7701    #[serde(skip_serializing_if = "Option::is_none")]
7702    pub security_options: Option<Vec<String>>,
7703
7704    /// 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. 
7705    #[serde(rename = "ProductLicense")]
7706    #[serde(skip_serializing_if = "Option::is_none")]
7707    pub product_license: Option<String>,
7708
7709    /// 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. 
7710    #[serde(rename = "DefaultAddressPools")]
7711    #[serde(skip_serializing_if = "Option::is_none")]
7712    pub default_address_pools: Option<Vec<SystemInfoDefaultAddressPools>>,
7713
7714    /// 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. 
7715    #[serde(rename = "Warnings")]
7716    #[serde(skip_serializing_if = "Option::is_none")]
7717    pub warnings: Option<Vec<String>>,
7718
7719    /// List of directories where (Container Device Interface) CDI specifications are located.  These specifications define vendor-specific modifications to an OCI runtime specification for a container being created.  An empty list indicates that CDI device injection is disabled.  Note that since using CDI device injection requires the daemon to have experimental enabled. For non-experimental daemons an empty list will always be returned. 
7720    #[serde(rename = "CDISpecDirs")]
7721    #[serde(skip_serializing_if = "Option::is_none")]
7722    pub cdi_spec_dirs: Option<Vec<String>>,
7723
7724    #[serde(rename = "Containerd")]
7725    #[serde(skip_serializing_if = "Option::is_none")]
7726    pub containerd: Option<ContainerdInfo>,
7727
7728}
7729
7730#[allow(non_camel_case_types)]
7731#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
7732pub enum SystemInfoCgroupDriverEnum { 
7733    #[serde(rename = "")]
7734    EMPTY,
7735    #[serde(rename = "cgroupfs")]
7736    CGROUPFS,
7737    #[serde(rename = "systemd")]
7738    SYSTEMD,
7739    #[serde(rename = "none")]
7740    NONE,
7741}
7742
7743impl ::std::fmt::Display for SystemInfoCgroupDriverEnum {
7744    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
7745        match *self { 
7746            SystemInfoCgroupDriverEnum::EMPTY => write!(f, ""),
7747            SystemInfoCgroupDriverEnum::CGROUPFS => write!(f, "{}", "cgroupfs"),
7748            SystemInfoCgroupDriverEnum::SYSTEMD => write!(f, "{}", "systemd"),
7749            SystemInfoCgroupDriverEnum::NONE => write!(f, "{}", "none"),
7750
7751        }
7752    }
7753}
7754
7755impl ::std::str::FromStr for SystemInfoCgroupDriverEnum {
7756    type Err = String;
7757    fn from_str(s: &str) -> Result<Self, Self::Err> {
7758        match s { 
7759            "" => Ok(SystemInfoCgroupDriverEnum::EMPTY),
7760            "cgroupfs" => Ok(SystemInfoCgroupDriverEnum::CGROUPFS),
7761            "systemd" => Ok(SystemInfoCgroupDriverEnum::SYSTEMD),
7762            "none" => Ok(SystemInfoCgroupDriverEnum::NONE),
7763            x => Err(format!("Invalid enum type: {}", x)),
7764        }
7765    }
7766}
7767
7768impl ::std::convert::AsRef<str> for SystemInfoCgroupDriverEnum {
7769    fn as_ref(&self) -> &str {
7770        match self { 
7771            SystemInfoCgroupDriverEnum::EMPTY => "",
7772            SystemInfoCgroupDriverEnum::CGROUPFS => "cgroupfs",
7773            SystemInfoCgroupDriverEnum::SYSTEMD => "systemd",
7774            SystemInfoCgroupDriverEnum::NONE => "none",
7775        }
7776    }
7777}
7778
7779#[allow(non_camel_case_types)]
7780#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
7781pub enum SystemInfoCgroupVersionEnum { 
7782    #[serde(rename = "")]
7783    EMPTY,
7784    #[serde(rename = "1")]
7785    _1,
7786    #[serde(rename = "2")]
7787    _2,
7788}
7789
7790impl ::std::fmt::Display for SystemInfoCgroupVersionEnum {
7791    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
7792        match *self { 
7793            SystemInfoCgroupVersionEnum::EMPTY => write!(f, ""),
7794            SystemInfoCgroupVersionEnum::_1 => write!(f, "{}", "1"),
7795            SystemInfoCgroupVersionEnum::_2 => write!(f, "{}", "2"),
7796
7797        }
7798    }
7799}
7800
7801impl ::std::str::FromStr for SystemInfoCgroupVersionEnum {
7802    type Err = String;
7803    fn from_str(s: &str) -> Result<Self, Self::Err> {
7804        match s { 
7805            "" => Ok(SystemInfoCgroupVersionEnum::EMPTY),
7806            "1" => Ok(SystemInfoCgroupVersionEnum::_1),
7807            "2" => Ok(SystemInfoCgroupVersionEnum::_2),
7808            x => Err(format!("Invalid enum type: {}", x)),
7809        }
7810    }
7811}
7812
7813impl ::std::convert::AsRef<str> for SystemInfoCgroupVersionEnum {
7814    fn as_ref(&self) -> &str {
7815        match self { 
7816            SystemInfoCgroupVersionEnum::EMPTY => "",
7817            SystemInfoCgroupVersionEnum::_1 => "1",
7818            SystemInfoCgroupVersionEnum::_2 => "2",
7819        }
7820    }
7821}
7822
7823#[allow(non_camel_case_types)]
7824#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
7825pub enum SystemInfoIsolationEnum { 
7826    #[serde(rename = "default")]
7827    DEFAULT,
7828    #[serde(rename = "hyperv")]
7829    HYPERV,
7830    #[serde(rename = "process")]
7831    PROCESS,
7832    #[serde(rename = "")]
7833    EMPTY,
7834}
7835
7836impl ::std::fmt::Display for SystemInfoIsolationEnum {
7837    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
7838        match *self { 
7839            SystemInfoIsolationEnum::DEFAULT => write!(f, "{}", "default"),
7840            SystemInfoIsolationEnum::HYPERV => write!(f, "{}", "hyperv"),
7841            SystemInfoIsolationEnum::PROCESS => write!(f, "{}", "process"),
7842            SystemInfoIsolationEnum::EMPTY => write!(f, "{}", ""),
7843
7844        }
7845    }
7846}
7847
7848impl ::std::str::FromStr for SystemInfoIsolationEnum {
7849    type Err = String;
7850    fn from_str(s: &str) -> Result<Self, Self::Err> {
7851        match s { 
7852            "default" => Ok(SystemInfoIsolationEnum::DEFAULT),
7853            "hyperv" => Ok(SystemInfoIsolationEnum::HYPERV),
7854            "process" => Ok(SystemInfoIsolationEnum::PROCESS),
7855            "" => Ok(SystemInfoIsolationEnum::EMPTY),
7856            x => Err(format!("Invalid enum type: {}", x)),
7857        }
7858    }
7859}
7860
7861impl ::std::convert::AsRef<str> for SystemInfoIsolationEnum {
7862    fn as_ref(&self) -> &str {
7863        match self { 
7864            SystemInfoIsolationEnum::DEFAULT => "default",
7865            SystemInfoIsolationEnum::HYPERV => "hyperv",
7866            SystemInfoIsolationEnum::PROCESS => "process",
7867            SystemInfoIsolationEnum::EMPTY => "",
7868        }
7869    }
7870}
7871
7872#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7873pub struct SystemInfoDefaultAddressPools {
7874    /// The network address in CIDR format
7875    #[serde(rename = "Base")]
7876    #[serde(skip_serializing_if = "Option::is_none")]
7877    pub base: Option<String>,
7878
7879    /// The network pool size
7880    #[serde(rename = "Size")]
7881    #[serde(skip_serializing_if = "Option::is_none")]
7882    pub size: Option<i64>,
7883
7884}
7885
7886/// Response of Engine API: GET \"/version\" 
7887#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7888pub struct SystemVersion {
7889    #[serde(rename = "Platform")]
7890    #[serde(skip_serializing_if = "Option::is_none")]
7891    pub platform: Option<SystemVersionPlatform>,
7892
7893    /// Information about system components 
7894    #[serde(rename = "Components")]
7895    #[serde(skip_serializing_if = "Option::is_none")]
7896    pub components: Option<Vec<SystemVersionComponents>>,
7897
7898    /// The version of the daemon
7899    #[serde(rename = "Version")]
7900    #[serde(skip_serializing_if = "Option::is_none")]
7901    pub version: Option<String>,
7902
7903    /// The default (and highest) API version that is supported by the daemon 
7904    #[serde(rename = "ApiVersion")]
7905    #[serde(skip_serializing_if = "Option::is_none")]
7906    pub api_version: Option<String>,
7907
7908    /// The minimum API version that is supported by the daemon 
7909    #[serde(rename = "MinAPIVersion")]
7910    #[serde(skip_serializing_if = "Option::is_none")]
7911    pub min_api_version: Option<String>,
7912
7913    /// The Git commit of the source code that was used to build the daemon 
7914    #[serde(rename = "GitCommit")]
7915    #[serde(skip_serializing_if = "Option::is_none")]
7916    pub git_commit: Option<String>,
7917
7918    /// The version Go used to compile the daemon, and the version of the Go runtime in use. 
7919    #[serde(rename = "GoVersion")]
7920    #[serde(skip_serializing_if = "Option::is_none")]
7921    pub go_version: Option<String>,
7922
7923    /// The operating system that the daemon is running on (\"linux\" or \"windows\") 
7924    #[serde(rename = "Os")]
7925    #[serde(skip_serializing_if = "Option::is_none")]
7926    pub os: Option<String>,
7927
7928    /// The architecture that the daemon is running on 
7929    #[serde(rename = "Arch")]
7930    #[serde(skip_serializing_if = "Option::is_none")]
7931    pub arch: Option<String>,
7932
7933    /// The kernel version (`uname -r`) that the daemon is running on.  This field is omitted when empty. 
7934    #[serde(rename = "KernelVersion")]
7935    #[serde(skip_serializing_if = "Option::is_none")]
7936    pub kernel_version: Option<String>,
7937
7938    /// Indicates if the daemon is started with experimental features enabled.  This field is omitted when empty / false. 
7939    #[serde(rename = "Experimental")]
7940    #[serde(skip_serializing_if = "Option::is_none")]
7941    pub experimental: Option<bool>,
7942
7943    /// The date and time that the daemon was compiled. 
7944    #[serde(rename = "BuildTime")]
7945    #[serde(skip_serializing_if = "Option::is_none")]
7946    pub build_time: Option<String>,
7947
7948}
7949
7950#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7951pub struct SystemVersionComponents {
7952    /// Name of the component 
7953    #[serde(rename = "Name")]
7954    pub name: String,
7955
7956    /// Version of the component 
7957    #[serde(rename = "Version")]
7958    pub version: String,
7959
7960    /// 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. 
7961    #[serde(rename = "Details")]
7962    #[serde(skip_serializing_if = "Option::is_none")]
7963    pub details: Option<HashMap<String, String>>,
7964
7965}
7966
7967#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7968pub struct SystemVersionPlatform {
7969    #[serde(rename = "Name")]
7970    pub name: String,
7971
7972}
7973
7974#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7975pub struct Task {
7976    /// The ID of the task.
7977    #[serde(rename = "ID")]
7978    #[serde(skip_serializing_if = "Option::is_none")]
7979    pub id: Option<String>,
7980
7981    #[serde(rename = "Version")]
7982    #[serde(skip_serializing_if = "Option::is_none")]
7983    pub version: Option<ObjectVersion>,
7984
7985    #[serde(rename = "CreatedAt")]
7986    #[serde(skip_serializing_if = "Option::is_none")]
7987    #[serde(
7988        default,
7989        deserialize_with = "deserialize_timestamp",
7990        serialize_with = "serialize_timestamp"
7991    )]
7992    pub created_at: Option<BollardDate>,
7993
7994    #[serde(rename = "UpdatedAt")]
7995    #[serde(skip_serializing_if = "Option::is_none")]
7996    #[serde(
7997        default,
7998        deserialize_with = "deserialize_timestamp",
7999        serialize_with = "serialize_timestamp"
8000    )]
8001    pub updated_at: Option<BollardDate>,
8002
8003    /// Name of the task.
8004    #[serde(rename = "Name")]
8005    #[serde(skip_serializing_if = "Option::is_none")]
8006    pub name: Option<String>,
8007
8008    /// User-defined key/value metadata.
8009    #[serde(rename = "Labels")]
8010    #[serde(skip_serializing_if = "Option::is_none")]
8011    pub labels: Option<HashMap<String, String>>,
8012
8013    #[serde(rename = "Spec")]
8014    #[serde(skip_serializing_if = "Option::is_none")]
8015    pub spec: Option<TaskSpec>,
8016
8017    /// The ID of the service this task is part of.
8018    #[serde(rename = "ServiceID")]
8019    #[serde(skip_serializing_if = "Option::is_none")]
8020    pub service_id: Option<String>,
8021
8022    #[serde(rename = "Slot")]
8023    #[serde(skip_serializing_if = "Option::is_none")]
8024    pub slot: Option<i64>,
8025
8026    /// The ID of the node that this task is on.
8027    #[serde(rename = "NodeID")]
8028    #[serde(skip_serializing_if = "Option::is_none")]
8029    pub node_id: Option<String>,
8030
8031    #[serde(rename = "AssignedGenericResources")]
8032    #[serde(skip_serializing_if = "Option::is_none")]
8033    pub assigned_generic_resources: Option<GenericResources>,
8034
8035    #[serde(rename = "Status")]
8036    #[serde(skip_serializing_if = "Option::is_none")]
8037    pub status: Option<TaskStatus>,
8038
8039    #[serde(rename = "DesiredState")]
8040    #[serde(skip_serializing_if = "Option::is_none")]
8041    pub desired_state: Option<TaskState>,
8042
8043    /// 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. 
8044    #[serde(rename = "JobIteration")]
8045    #[serde(skip_serializing_if = "Option::is_none")]
8046    pub job_iteration: Option<ObjectVersion>,
8047
8048}
8049
8050/// User modifiable task configuration.
8051#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8052pub struct TaskSpec {
8053    #[serde(rename = "PluginSpec")]
8054    #[serde(skip_serializing_if = "Option::is_none")]
8055    pub plugin_spec: Option<TaskSpecPluginSpec>,
8056
8057    #[serde(rename = "ContainerSpec")]
8058    #[serde(skip_serializing_if = "Option::is_none")]
8059    pub container_spec: Option<TaskSpecContainerSpec>,
8060
8061    #[serde(rename = "NetworkAttachmentSpec")]
8062    #[serde(skip_serializing_if = "Option::is_none")]
8063    pub network_attachment_spec: Option<TaskSpecNetworkAttachmentSpec>,
8064
8065    #[serde(rename = "Resources")]
8066    #[serde(skip_serializing_if = "Option::is_none")]
8067    pub resources: Option<TaskSpecResources>,
8068
8069    #[serde(rename = "RestartPolicy")]
8070    #[serde(skip_serializing_if = "Option::is_none")]
8071    pub restart_policy: Option<TaskSpecRestartPolicy>,
8072
8073    #[serde(rename = "Placement")]
8074    #[serde(skip_serializing_if = "Option::is_none")]
8075    pub placement: Option<TaskSpecPlacement>,
8076
8077    /// A counter that triggers an update even if no relevant parameters have been changed. 
8078    #[serde(rename = "ForceUpdate")]
8079    #[serde(skip_serializing_if = "Option::is_none")]
8080    pub force_update: Option<i64>,
8081
8082    /// Runtime is the type of runtime specified for the task executor. 
8083    #[serde(rename = "Runtime")]
8084    #[serde(skip_serializing_if = "Option::is_none")]
8085    pub runtime: Option<String>,
8086
8087    /// Specifies which networks the service should attach to.
8088    #[serde(rename = "Networks")]
8089    #[serde(skip_serializing_if = "Option::is_none")]
8090    pub networks: Option<Vec<NetworkAttachmentConfig>>,
8091
8092    #[serde(rename = "LogDriver")]
8093    #[serde(skip_serializing_if = "Option::is_none")]
8094    pub log_driver: Option<TaskSpecLogDriver>,
8095
8096}
8097
8098/// 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`. 
8099#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8100pub struct TaskSpecContainerSpec {
8101    /// The image name to use for the container
8102    #[serde(rename = "Image")]
8103    #[serde(skip_serializing_if = "Option::is_none")]
8104    pub image: Option<String>,
8105
8106    /// User-defined key/value data.
8107    #[serde(rename = "Labels")]
8108    #[serde(skip_serializing_if = "Option::is_none")]
8109    pub labels: Option<HashMap<String, String>>,
8110
8111    /// The command to be run in the image.
8112    #[serde(rename = "Command")]
8113    #[serde(skip_serializing_if = "Option::is_none")]
8114    pub command: Option<Vec<String>>,
8115
8116    /// Arguments to the command.
8117    #[serde(rename = "Args")]
8118    #[serde(skip_serializing_if = "Option::is_none")]
8119    pub args: Option<Vec<String>>,
8120
8121    /// The hostname to use for the container, as a valid [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. 
8122    #[serde(rename = "Hostname")]
8123    #[serde(skip_serializing_if = "Option::is_none")]
8124    pub hostname: Option<String>,
8125
8126    /// A list of environment variables in the form `VAR=value`. 
8127    #[serde(rename = "Env")]
8128    #[serde(skip_serializing_if = "Option::is_none")]
8129    pub env: Option<Vec<String>>,
8130
8131    /// The working directory for commands to run in.
8132    #[serde(rename = "Dir")]
8133    #[serde(skip_serializing_if = "Option::is_none")]
8134    pub dir: Option<String>,
8135
8136    /// The user inside the container.
8137    #[serde(rename = "User")]
8138    #[serde(skip_serializing_if = "Option::is_none")]
8139    pub user: Option<String>,
8140
8141    /// A list of additional groups that the container process will run as. 
8142    #[serde(rename = "Groups")]
8143    #[serde(skip_serializing_if = "Option::is_none")]
8144    pub groups: Option<Vec<String>>,
8145
8146    #[serde(rename = "Privileges")]
8147    #[serde(skip_serializing_if = "Option::is_none")]
8148    pub privileges: Option<TaskSpecContainerSpecPrivileges>,
8149
8150    /// Whether a pseudo-TTY should be allocated.
8151    #[serde(rename = "TTY")]
8152    #[serde(skip_serializing_if = "Option::is_none")]
8153    pub tty: Option<bool>,
8154
8155    /// Open `stdin`
8156    #[serde(rename = "OpenStdin")]
8157    #[serde(skip_serializing_if = "Option::is_none")]
8158    pub open_stdin: Option<bool>,
8159
8160    /// Mount the container's root filesystem as read only.
8161    #[serde(rename = "ReadOnly")]
8162    #[serde(skip_serializing_if = "Option::is_none")]
8163    pub read_only: Option<bool>,
8164
8165    /// Specification for mounts to be added to containers created as part of the service. 
8166    #[serde(rename = "Mounts")]
8167    #[serde(skip_serializing_if = "Option::is_none")]
8168    pub mounts: Option<Vec<Mount>>,
8169
8170    /// Signal to stop the container.
8171    #[serde(rename = "StopSignal")]
8172    #[serde(skip_serializing_if = "Option::is_none")]
8173    pub stop_signal: Option<String>,
8174
8175    /// Amount of time to wait for the container to terminate before forcefully killing it. 
8176    #[serde(rename = "StopGracePeriod")]
8177    #[serde(skip_serializing_if = "Option::is_none")]
8178    pub stop_grace_period: Option<i64>,
8179
8180    #[serde(rename = "HealthCheck")]
8181    #[serde(skip_serializing_if = "Option::is_none")]
8182    pub health_check: Option<HealthConfig>,
8183
8184    /// 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...] 
8185    #[serde(rename = "Hosts")]
8186    #[serde(skip_serializing_if = "Option::is_none")]
8187    pub hosts: Option<Vec<String>>,
8188
8189    #[serde(rename = "DNSConfig")]
8190    #[serde(skip_serializing_if = "Option::is_none")]
8191    pub dns_config: Option<TaskSpecContainerSpecDnsConfig>,
8192
8193    /// Secrets contains references to zero or more secrets that will be exposed to the service. 
8194    #[serde(rename = "Secrets")]
8195    #[serde(skip_serializing_if = "Option::is_none")]
8196    pub secrets: Option<Vec<TaskSpecContainerSpecSecrets>>,
8197
8198    /// An integer value containing the score given to the container in order to tune OOM killer preferences. 
8199    #[serde(rename = "OomScoreAdj")]
8200    #[serde(skip_serializing_if = "Option::is_none")]
8201    pub oom_score_adj: Option<i64>,
8202
8203    /// Configs contains references to zero or more configs that will be exposed to the service. 
8204    #[serde(rename = "Configs")]
8205    #[serde(skip_serializing_if = "Option::is_none")]
8206    pub configs: Option<Vec<TaskSpecContainerSpecConfigs>>,
8207
8208    /// Isolation technology of the containers running the service. (Windows only) 
8209    #[serde(rename = "Isolation")]
8210    #[serde(skip_serializing_if = "Option::is_none")]
8211    pub isolation: Option<TaskSpecContainerSpecIsolationEnum>,
8212
8213    /// 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. 
8214    #[serde(rename = "Init")]
8215    #[serde(skip_serializing_if = "Option::is_none")]
8216    pub init: Option<bool>,
8217
8218    /// 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. 
8219    #[serde(rename = "Sysctls")]
8220    #[serde(skip_serializing_if = "Option::is_none")]
8221    pub sysctls: Option<HashMap<String, String>>,
8222
8223    /// A list of kernel capabilities to add to the default set for the container. 
8224    #[serde(rename = "CapabilityAdd")]
8225    #[serde(skip_serializing_if = "Option::is_none")]
8226    pub capability_add: Option<Vec<String>>,
8227
8228    /// A list of kernel capabilities to drop from the default set for the container. 
8229    #[serde(rename = "CapabilityDrop")]
8230    #[serde(skip_serializing_if = "Option::is_none")]
8231    pub capability_drop: Option<Vec<String>>,
8232
8233    /// A list of resource limits to set in the container. For example: `{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}`\" 
8234    #[serde(rename = "Ulimits")]
8235    #[serde(skip_serializing_if = "Option::is_none")]
8236    pub ulimits: Option<Vec<ResourcesUlimits>>,
8237
8238}
8239
8240#[allow(non_camel_case_types)]
8241#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
8242pub enum TaskSpecContainerSpecIsolationEnum { 
8243    #[serde(rename = "default")]
8244    DEFAULT,
8245    #[serde(rename = "process")]
8246    PROCESS,
8247    #[serde(rename = "hyperv")]
8248    HYPERV,
8249    #[serde(rename = "")]
8250    EMPTY,
8251}
8252
8253impl ::std::fmt::Display for TaskSpecContainerSpecIsolationEnum {
8254    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
8255        match *self { 
8256            TaskSpecContainerSpecIsolationEnum::DEFAULT => write!(f, "{}", "default"),
8257            TaskSpecContainerSpecIsolationEnum::PROCESS => write!(f, "{}", "process"),
8258            TaskSpecContainerSpecIsolationEnum::HYPERV => write!(f, "{}", "hyperv"),
8259            TaskSpecContainerSpecIsolationEnum::EMPTY => write!(f, "{}", ""),
8260
8261        }
8262    }
8263}
8264
8265impl ::std::str::FromStr for TaskSpecContainerSpecIsolationEnum {
8266    type Err = String;
8267    fn from_str(s: &str) -> Result<Self, Self::Err> {
8268        match s { 
8269            "default" => Ok(TaskSpecContainerSpecIsolationEnum::DEFAULT),
8270            "process" => Ok(TaskSpecContainerSpecIsolationEnum::PROCESS),
8271            "hyperv" => Ok(TaskSpecContainerSpecIsolationEnum::HYPERV),
8272            "" => Ok(TaskSpecContainerSpecIsolationEnum::EMPTY),
8273            x => Err(format!("Invalid enum type: {}", x)),
8274        }
8275    }
8276}
8277
8278impl ::std::convert::AsRef<str> for TaskSpecContainerSpecIsolationEnum {
8279    fn as_ref(&self) -> &str {
8280        match self { 
8281            TaskSpecContainerSpecIsolationEnum::DEFAULT => "default",
8282            TaskSpecContainerSpecIsolationEnum::PROCESS => "process",
8283            TaskSpecContainerSpecIsolationEnum::HYPERV => "hyperv",
8284            TaskSpecContainerSpecIsolationEnum::EMPTY => "",
8285        }
8286    }
8287}
8288
8289#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8290pub struct TaskSpecContainerSpecConfigs {
8291    #[serde(rename = "File")]
8292    #[serde(skip_serializing_if = "Option::is_none")]
8293    pub file: Option<TaskSpecContainerSpecFile1>,
8294
8295    /// 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 
8296    #[serde(rename = "Runtime")]
8297    #[serde(skip_serializing_if = "Option::is_none")]
8298    pub runtime: Option<HashMap<(), ()>>,
8299
8300    /// ConfigID represents the ID of the specific config that we're referencing. 
8301    #[serde(rename = "ConfigID")]
8302    #[serde(skip_serializing_if = "Option::is_none")]
8303    pub config_id: Option<String>,
8304
8305    /// 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. 
8306    #[serde(rename = "ConfigName")]
8307    #[serde(skip_serializing_if = "Option::is_none")]
8308    pub config_name: Option<String>,
8309
8310}
8311
8312/// Specification for DNS related configurations in resolver configuration file (`resolv.conf`). 
8313#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8314pub struct TaskSpecContainerSpecDnsConfig {
8315    /// The IP addresses of the name servers.
8316    #[serde(rename = "Nameservers")]
8317    #[serde(skip_serializing_if = "Option::is_none")]
8318    pub nameservers: Option<Vec<String>>,
8319
8320    /// A search list for host-name lookup.
8321    #[serde(rename = "Search")]
8322    #[serde(skip_serializing_if = "Option::is_none")]
8323    pub search: Option<Vec<String>>,
8324
8325    /// A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.). 
8326    #[serde(rename = "Options")]
8327    #[serde(skip_serializing_if = "Option::is_none")]
8328    pub options: Option<Vec<String>>,
8329
8330}
8331
8332/// File represents a specific target that is backed by a file. 
8333#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8334pub struct TaskSpecContainerSpecFile {
8335    /// Name represents the final filename in the filesystem. 
8336    #[serde(rename = "Name")]
8337    #[serde(skip_serializing_if = "Option::is_none")]
8338    pub name: Option<String>,
8339
8340    /// UID represents the file UID.
8341    #[serde(rename = "UID")]
8342    #[serde(skip_serializing_if = "Option::is_none")]
8343    pub uid: Option<String>,
8344
8345    /// GID represents the file GID.
8346    #[serde(rename = "GID")]
8347    #[serde(skip_serializing_if = "Option::is_none")]
8348    pub gid: Option<String>,
8349
8350    /// Mode represents the FileMode of the file.
8351    #[serde(rename = "Mode")]
8352    #[serde(skip_serializing_if = "Option::is_none")]
8353    pub mode: Option<u32>,
8354
8355}
8356
8357/// File represents a specific target that is backed by a file.  <p><br /><p>  > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive 
8358#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8359pub struct TaskSpecContainerSpecFile1 {
8360    /// Name represents the final filename in the filesystem. 
8361    #[serde(rename = "Name")]
8362    #[serde(skip_serializing_if = "Option::is_none")]
8363    pub name: Option<String>,
8364
8365    /// UID represents the file UID.
8366    #[serde(rename = "UID")]
8367    #[serde(skip_serializing_if = "Option::is_none")]
8368    pub uid: Option<String>,
8369
8370    /// GID represents the file GID.
8371    #[serde(rename = "GID")]
8372    #[serde(skip_serializing_if = "Option::is_none")]
8373    pub gid: Option<String>,
8374
8375    /// Mode represents the FileMode of the file.
8376    #[serde(rename = "Mode")]
8377    #[serde(skip_serializing_if = "Option::is_none")]
8378    pub mode: Option<u32>,
8379
8380}
8381
8382/// Security options for the container
8383#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8384pub struct TaskSpecContainerSpecPrivileges {
8385    #[serde(rename = "CredentialSpec")]
8386    #[serde(skip_serializing_if = "Option::is_none")]
8387    pub credential_spec: Option<TaskSpecContainerSpecPrivilegesCredentialSpec>,
8388
8389    #[serde(rename = "SELinuxContext")]
8390    #[serde(skip_serializing_if = "Option::is_none")]
8391    pub se_linux_context: Option<TaskSpecContainerSpecPrivilegesSeLinuxContext>,
8392
8393    #[serde(rename = "Seccomp")]
8394    #[serde(skip_serializing_if = "Option::is_none")]
8395    pub seccomp: Option<TaskSpecContainerSpecPrivilegesSeccomp>,
8396
8397    #[serde(rename = "AppArmor")]
8398    #[serde(skip_serializing_if = "Option::is_none")]
8399    pub app_armor: Option<TaskSpecContainerSpecPrivilegesAppArmor>,
8400
8401    /// Configuration of the no_new_privs bit in the container
8402    #[serde(rename = "NoNewPrivileges")]
8403    #[serde(skip_serializing_if = "Option::is_none")]
8404    pub no_new_privileges: Option<bool>,
8405
8406}
8407
8408/// Options for configuring AppArmor on the container
8409#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8410pub struct TaskSpecContainerSpecPrivilegesAppArmor {
8411    #[serde(rename = "Mode")]
8412    #[serde(skip_serializing_if = "Option::is_none")]
8413    pub mode: Option<TaskSpecContainerSpecPrivilegesAppArmorModeEnum>,
8414
8415}
8416
8417#[allow(non_camel_case_types)]
8418#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
8419pub enum TaskSpecContainerSpecPrivilegesAppArmorModeEnum { 
8420    #[serde(rename = "")]
8421    EMPTY,
8422    #[serde(rename = "default")]
8423    DEFAULT,
8424    #[serde(rename = "disabled")]
8425    DISABLED,
8426}
8427
8428impl ::std::fmt::Display for TaskSpecContainerSpecPrivilegesAppArmorModeEnum {
8429    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
8430        match *self { 
8431            TaskSpecContainerSpecPrivilegesAppArmorModeEnum::EMPTY => write!(f, ""),
8432            TaskSpecContainerSpecPrivilegesAppArmorModeEnum::DEFAULT => write!(f, "{}", "default"),
8433            TaskSpecContainerSpecPrivilegesAppArmorModeEnum::DISABLED => write!(f, "{}", "disabled"),
8434
8435        }
8436    }
8437}
8438
8439impl ::std::str::FromStr for TaskSpecContainerSpecPrivilegesAppArmorModeEnum {
8440    type Err = String;
8441    fn from_str(s: &str) -> Result<Self, Self::Err> {
8442        match s { 
8443            "" => Ok(TaskSpecContainerSpecPrivilegesAppArmorModeEnum::EMPTY),
8444            "default" => Ok(TaskSpecContainerSpecPrivilegesAppArmorModeEnum::DEFAULT),
8445            "disabled" => Ok(TaskSpecContainerSpecPrivilegesAppArmorModeEnum::DISABLED),
8446            x => Err(format!("Invalid enum type: {}", x)),
8447        }
8448    }
8449}
8450
8451impl ::std::convert::AsRef<str> for TaskSpecContainerSpecPrivilegesAppArmorModeEnum {
8452    fn as_ref(&self) -> &str {
8453        match self { 
8454            TaskSpecContainerSpecPrivilegesAppArmorModeEnum::EMPTY => "",
8455            TaskSpecContainerSpecPrivilegesAppArmorModeEnum::DEFAULT => "default",
8456            TaskSpecContainerSpecPrivilegesAppArmorModeEnum::DISABLED => "disabled",
8457        }
8458    }
8459}
8460
8461/// CredentialSpec for managed service account (Windows only)
8462#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8463pub struct TaskSpecContainerSpecPrivilegesCredentialSpec {
8464    /// 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. 
8465    #[serde(rename = "Config")]
8466    #[serde(skip_serializing_if = "Option::is_none")]
8467    pub config: Option<String>,
8468
8469    /// 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. 
8470    #[serde(rename = "File")]
8471    #[serde(skip_serializing_if = "Option::is_none")]
8472    pub file: Option<String>,
8473
8474    /// 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. 
8475    #[serde(rename = "Registry")]
8476    #[serde(skip_serializing_if = "Option::is_none")]
8477    pub registry: Option<String>,
8478
8479}
8480
8481/// SELinux labels of the container
8482#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8483pub struct TaskSpecContainerSpecPrivilegesSeLinuxContext {
8484    /// Disable SELinux
8485    #[serde(rename = "Disable")]
8486    #[serde(skip_serializing_if = "Option::is_none")]
8487    pub disable: Option<bool>,
8488
8489    /// SELinux user label
8490    #[serde(rename = "User")]
8491    #[serde(skip_serializing_if = "Option::is_none")]
8492    pub user: Option<String>,
8493
8494    /// SELinux role label
8495    #[serde(rename = "Role")]
8496    #[serde(skip_serializing_if = "Option::is_none")]
8497    pub role: Option<String>,
8498
8499    /// SELinux type label
8500    #[serde(rename = "Type")]
8501    #[serde(skip_serializing_if = "Option::is_none")]
8502    pub typ: Option<String>,
8503
8504    /// SELinux level label
8505    #[serde(rename = "Level")]
8506    #[serde(skip_serializing_if = "Option::is_none")]
8507    pub level: Option<String>,
8508
8509}
8510
8511/// Options for configuring seccomp on the container
8512#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8513pub struct TaskSpecContainerSpecPrivilegesSeccomp {
8514    #[serde(rename = "Mode")]
8515    #[serde(skip_serializing_if = "Option::is_none")]
8516    pub mode: Option<TaskSpecContainerSpecPrivilegesSeccompModeEnum>,
8517
8518    /// The custom seccomp profile as a json object
8519    #[serde(rename = "Profile")]
8520    #[serde(skip_serializing_if = "Option::is_none")]
8521    pub profile: Option<String>,
8522
8523}
8524
8525#[allow(non_camel_case_types)]
8526#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
8527pub enum TaskSpecContainerSpecPrivilegesSeccompModeEnum { 
8528    #[serde(rename = "")]
8529    EMPTY,
8530    #[serde(rename = "default")]
8531    DEFAULT,
8532    #[serde(rename = "unconfined")]
8533    UNCONFINED,
8534    #[serde(rename = "custom")]
8535    CUSTOM,
8536}
8537
8538impl ::std::fmt::Display for TaskSpecContainerSpecPrivilegesSeccompModeEnum {
8539    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
8540        match *self { 
8541            TaskSpecContainerSpecPrivilegesSeccompModeEnum::EMPTY => write!(f, ""),
8542            TaskSpecContainerSpecPrivilegesSeccompModeEnum::DEFAULT => write!(f, "{}", "default"),
8543            TaskSpecContainerSpecPrivilegesSeccompModeEnum::UNCONFINED => write!(f, "{}", "unconfined"),
8544            TaskSpecContainerSpecPrivilegesSeccompModeEnum::CUSTOM => write!(f, "{}", "custom"),
8545
8546        }
8547    }
8548}
8549
8550impl ::std::str::FromStr for TaskSpecContainerSpecPrivilegesSeccompModeEnum {
8551    type Err = String;
8552    fn from_str(s: &str) -> Result<Self, Self::Err> {
8553        match s { 
8554            "" => Ok(TaskSpecContainerSpecPrivilegesSeccompModeEnum::EMPTY),
8555            "default" => Ok(TaskSpecContainerSpecPrivilegesSeccompModeEnum::DEFAULT),
8556            "unconfined" => Ok(TaskSpecContainerSpecPrivilegesSeccompModeEnum::UNCONFINED),
8557            "custom" => Ok(TaskSpecContainerSpecPrivilegesSeccompModeEnum::CUSTOM),
8558            x => Err(format!("Invalid enum type: {}", x)),
8559        }
8560    }
8561}
8562
8563impl ::std::convert::AsRef<str> for TaskSpecContainerSpecPrivilegesSeccompModeEnum {
8564    fn as_ref(&self) -> &str {
8565        match self { 
8566            TaskSpecContainerSpecPrivilegesSeccompModeEnum::EMPTY => "",
8567            TaskSpecContainerSpecPrivilegesSeccompModeEnum::DEFAULT => "default",
8568            TaskSpecContainerSpecPrivilegesSeccompModeEnum::UNCONFINED => "unconfined",
8569            TaskSpecContainerSpecPrivilegesSeccompModeEnum::CUSTOM => "custom",
8570        }
8571    }
8572}
8573
8574#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8575pub struct TaskSpecContainerSpecSecrets {
8576    #[serde(rename = "File")]
8577    #[serde(skip_serializing_if = "Option::is_none")]
8578    pub file: Option<TaskSpecContainerSpecFile>,
8579
8580    /// SecretID represents the ID of the specific secret that we're referencing. 
8581    #[serde(rename = "SecretID")]
8582    #[serde(skip_serializing_if = "Option::is_none")]
8583    pub secret_id: Option<String>,
8584
8585    /// 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. 
8586    #[serde(rename = "SecretName")]
8587    #[serde(skip_serializing_if = "Option::is_none")]
8588    pub secret_name: Option<String>,
8589
8590}
8591
8592/// 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. 
8593#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8594pub struct TaskSpecLogDriver {
8595    #[serde(rename = "Name")]
8596    #[serde(skip_serializing_if = "Option::is_none")]
8597    pub name: Option<String>,
8598
8599    #[serde(rename = "Options")]
8600    #[serde(skip_serializing_if = "Option::is_none")]
8601    pub options: Option<HashMap<String, String>>,
8602
8603}
8604
8605/// 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`. 
8606#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8607pub struct TaskSpecNetworkAttachmentSpec {
8608    /// ID of the container represented by this task
8609    #[serde(rename = "ContainerID")]
8610    #[serde(skip_serializing_if = "Option::is_none")]
8611    pub container_id: Option<String>,
8612
8613}
8614
8615#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8616pub struct TaskSpecPlacement {
8617    /// 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-24.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). 
8618    #[serde(rename = "Constraints")]
8619    #[serde(skip_serializing_if = "Option::is_none")]
8620    pub constraints: Option<Vec<String>>,
8621
8622    /// Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence. 
8623    #[serde(rename = "Preferences")]
8624    #[serde(skip_serializing_if = "Option::is_none")]
8625    pub preferences: Option<Vec<TaskSpecPlacementPreferences>>,
8626
8627    /// Maximum number of replicas for per node (default value is 0, which is unlimited) 
8628    #[serde(rename = "MaxReplicas")]
8629    #[serde(skip_serializing_if = "Option::is_none")]
8630    pub max_replicas: Option<i64>,
8631
8632    /// 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. 
8633    #[serde(rename = "Platforms")]
8634    #[serde(skip_serializing_if = "Option::is_none")]
8635    pub platforms: Option<Vec<Platform>>,
8636
8637}
8638
8639#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8640pub struct TaskSpecPlacementPreferences {
8641    #[serde(rename = "Spread")]
8642    #[serde(skip_serializing_if = "Option::is_none")]
8643    pub spread: Option<TaskSpecPlacementSpread>,
8644
8645}
8646
8647#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8648pub struct TaskSpecPlacementSpread {
8649    /// label descriptor, such as `engine.labels.az`. 
8650    #[serde(rename = "SpreadDescriptor")]
8651    #[serde(skip_serializing_if = "Option::is_none")]
8652    pub spread_descriptor: Option<String>,
8653
8654}
8655
8656/// 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`. 
8657#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8658pub struct TaskSpecPluginSpec {
8659    /// The name or 'alias' to use for the plugin.
8660    #[serde(rename = "Name")]
8661    #[serde(skip_serializing_if = "Option::is_none")]
8662    pub name: Option<String>,
8663
8664    /// The plugin image reference to use.
8665    #[serde(rename = "Remote")]
8666    #[serde(skip_serializing_if = "Option::is_none")]
8667    pub remote: Option<String>,
8668
8669    /// Disable the plugin once scheduled.
8670    #[serde(rename = "Disabled")]
8671    #[serde(skip_serializing_if = "Option::is_none")]
8672    pub disabled: Option<bool>,
8673
8674    #[serde(rename = "PluginPrivilege")]
8675    #[serde(skip_serializing_if = "Option::is_none")]
8676    pub plugin_privilege: Option<Vec<PluginPrivilege>>,
8677
8678}
8679
8680/// Resource requirements which apply to each individual container created as part of the service. 
8681#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8682pub struct TaskSpecResources {
8683    /// Define resources limits.
8684    #[serde(rename = "Limits")]
8685    #[serde(skip_serializing_if = "Option::is_none")]
8686    pub limits: Option<Limit>,
8687
8688    /// Define resources reservation.
8689    #[serde(rename = "Reservations")]
8690    #[serde(skip_serializing_if = "Option::is_none")]
8691    pub reservations: Option<ResourceObject>,
8692
8693}
8694
8695/// Specification for the restart policy which applies to containers created as part of this service. 
8696#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8697pub struct TaskSpecRestartPolicy {
8698    /// Condition for restart.
8699    #[serde(rename = "Condition")]
8700    #[serde(skip_serializing_if = "Option::is_none")]
8701    pub condition: Option<TaskSpecRestartPolicyConditionEnum>,
8702
8703    /// Delay between restart attempts.
8704    #[serde(rename = "Delay")]
8705    #[serde(skip_serializing_if = "Option::is_none")]
8706    pub delay: Option<i64>,
8707
8708    /// Maximum attempts to restart a given container before giving up (default value is 0, which is ignored). 
8709    #[serde(rename = "MaxAttempts")]
8710    #[serde(skip_serializing_if = "Option::is_none")]
8711    pub max_attempts: Option<i64>,
8712
8713    /// Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded). 
8714    #[serde(rename = "Window")]
8715    #[serde(skip_serializing_if = "Option::is_none")]
8716    pub window: Option<i64>,
8717
8718}
8719
8720#[allow(non_camel_case_types)]
8721#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
8722pub enum TaskSpecRestartPolicyConditionEnum { 
8723    #[serde(rename = "")]
8724    EMPTY,
8725    #[serde(rename = "none")]
8726    NONE,
8727    #[serde(rename = "on-failure")]
8728    ON_FAILURE,
8729    #[serde(rename = "any")]
8730    ANY,
8731}
8732
8733impl ::std::fmt::Display for TaskSpecRestartPolicyConditionEnum {
8734    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
8735        match *self { 
8736            TaskSpecRestartPolicyConditionEnum::EMPTY => write!(f, ""),
8737            TaskSpecRestartPolicyConditionEnum::NONE => write!(f, "{}", "none"),
8738            TaskSpecRestartPolicyConditionEnum::ON_FAILURE => write!(f, "{}", "on-failure"),
8739            TaskSpecRestartPolicyConditionEnum::ANY => write!(f, "{}", "any"),
8740
8741        }
8742    }
8743}
8744
8745impl ::std::str::FromStr for TaskSpecRestartPolicyConditionEnum {
8746    type Err = String;
8747    fn from_str(s: &str) -> Result<Self, Self::Err> {
8748        match s { 
8749            "" => Ok(TaskSpecRestartPolicyConditionEnum::EMPTY),
8750            "none" => Ok(TaskSpecRestartPolicyConditionEnum::NONE),
8751            "on-failure" => Ok(TaskSpecRestartPolicyConditionEnum::ON_FAILURE),
8752            "any" => Ok(TaskSpecRestartPolicyConditionEnum::ANY),
8753            x => Err(format!("Invalid enum type: {}", x)),
8754        }
8755    }
8756}
8757
8758impl ::std::convert::AsRef<str> for TaskSpecRestartPolicyConditionEnum {
8759    fn as_ref(&self) -> &str {
8760        match self { 
8761            TaskSpecRestartPolicyConditionEnum::EMPTY => "",
8762            TaskSpecRestartPolicyConditionEnum::NONE => "none",
8763            TaskSpecRestartPolicyConditionEnum::ON_FAILURE => "on-failure",
8764            TaskSpecRestartPolicyConditionEnum::ANY => "any",
8765        }
8766    }
8767}
8768
8769/// Enumeration of values.
8770/// Since this enum's variants do not hold data, we can easily define them them as `#[repr(C)]`
8771/// which helps with FFI.
8772#[allow(non_camel_case_types)]
8773#[repr(C)]
8774#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
8775pub enum TaskState { 
8776    #[serde(rename = "new")]
8777    NEW,
8778    #[serde(rename = "allocated")]
8779    ALLOCATED,
8780    #[serde(rename = "pending")]
8781    PENDING,
8782    #[serde(rename = "assigned")]
8783    ASSIGNED,
8784    #[serde(rename = "accepted")]
8785    ACCEPTED,
8786    #[serde(rename = "preparing")]
8787    PREPARING,
8788    #[serde(rename = "ready")]
8789    READY,
8790    #[serde(rename = "starting")]
8791    STARTING,
8792    #[serde(rename = "running")]
8793    RUNNING,
8794    #[serde(rename = "complete")]
8795    COMPLETE,
8796    #[serde(rename = "shutdown")]
8797    SHUTDOWN,
8798    #[serde(rename = "failed")]
8799    FAILED,
8800    #[serde(rename = "rejected")]
8801    REJECTED,
8802    #[serde(rename = "remove")]
8803    REMOVE,
8804    #[serde(rename = "orphaned")]
8805    ORPHANED,
8806}
8807
8808impl ::std::fmt::Display for TaskState {
8809    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
8810        match *self { 
8811            TaskState::NEW => write!(f, "{}", "new"),
8812            TaskState::ALLOCATED => write!(f, "{}", "allocated"),
8813            TaskState::PENDING => write!(f, "{}", "pending"),
8814            TaskState::ASSIGNED => write!(f, "{}", "assigned"),
8815            TaskState::ACCEPTED => write!(f, "{}", "accepted"),
8816            TaskState::PREPARING => write!(f, "{}", "preparing"),
8817            TaskState::READY => write!(f, "{}", "ready"),
8818            TaskState::STARTING => write!(f, "{}", "starting"),
8819            TaskState::RUNNING => write!(f, "{}", "running"),
8820            TaskState::COMPLETE => write!(f, "{}", "complete"),
8821            TaskState::SHUTDOWN => write!(f, "{}", "shutdown"),
8822            TaskState::FAILED => write!(f, "{}", "failed"),
8823            TaskState::REJECTED => write!(f, "{}", "rejected"),
8824            TaskState::REMOVE => write!(f, "{}", "remove"),
8825            TaskState::ORPHANED => write!(f, "{}", "orphaned"),
8826        }
8827    }
8828}
8829
8830impl ::std::str::FromStr for TaskState {
8831    type Err = ();
8832    fn from_str(s: &str) -> Result<Self, Self::Err> {
8833        match s {
8834            "new" => Ok(TaskState::NEW),
8835            "allocated" => Ok(TaskState::ALLOCATED),
8836            "pending" => Ok(TaskState::PENDING),
8837            "assigned" => Ok(TaskState::ASSIGNED),
8838            "accepted" => Ok(TaskState::ACCEPTED),
8839            "preparing" => Ok(TaskState::PREPARING),
8840            "ready" => Ok(TaskState::READY),
8841            "starting" => Ok(TaskState::STARTING),
8842            "running" => Ok(TaskState::RUNNING),
8843            "complete" => Ok(TaskState::COMPLETE),
8844            "shutdown" => Ok(TaskState::SHUTDOWN),
8845            "failed" => Ok(TaskState::FAILED),
8846            "rejected" => Ok(TaskState::REJECTED),
8847            "remove" => Ok(TaskState::REMOVE),
8848            "orphaned" => Ok(TaskState::ORPHANED),
8849            _ => Err(()),
8850        }
8851    }
8852}
8853
8854impl std::default::Default for TaskState {
8855    fn default() -> Self { 
8856        TaskState::NEW
8857    }
8858}
8859
8860/// represents the status of a task.
8861#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8862pub struct TaskStatus {
8863    #[serde(rename = "Timestamp")]
8864    #[serde(skip_serializing_if = "Option::is_none")]
8865    #[serde(
8866        default,
8867        deserialize_with = "deserialize_timestamp",
8868        serialize_with = "serialize_timestamp"
8869    )]
8870    pub timestamp: Option<BollardDate>,
8871
8872    #[serde(rename = "State")]
8873    #[serde(skip_serializing_if = "Option::is_none")]
8874    pub state: Option<TaskState>,
8875
8876    #[serde(rename = "Message")]
8877    #[serde(skip_serializing_if = "Option::is_none")]
8878    pub message: Option<String>,
8879
8880    #[serde(rename = "Err")]
8881    #[serde(skip_serializing_if = "Option::is_none")]
8882    pub err: Option<String>,
8883
8884    #[serde(rename = "ContainerStatus")]
8885    #[serde(skip_serializing_if = "Option::is_none")]
8886    pub container_status: Option<ContainerStatus>,
8887
8888    #[serde(rename = "PortStatus")]
8889    #[serde(skip_serializing_if = "Option::is_none")]
8890    pub port_status: Option<PortStatus>,
8891
8892}
8893
8894#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8895pub struct ThrottleDevice {
8896    /// Device path
8897    #[serde(rename = "Path")]
8898    #[serde(skip_serializing_if = "Option::is_none")]
8899    pub path: Option<String>,
8900
8901    /// Rate
8902    #[serde(rename = "Rate")]
8903    #[serde(skip_serializing_if = "Option::is_none")]
8904    pub rate: Option<i64>,
8905
8906}
8907
8908/// Information about the issuer of leaf TLS certificates and the trusted root CA certificate. 
8909#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8910pub struct TlsInfo {
8911    /// The root CA certificate(s) that are used to validate leaf TLS certificates. 
8912    #[serde(rename = "TrustRoot")]
8913    #[serde(skip_serializing_if = "Option::is_none")]
8914    pub trust_root: Option<String>,
8915
8916    /// The base64-url-safe-encoded raw subject bytes of the issuer.
8917    #[serde(rename = "CertIssuerSubject")]
8918    #[serde(skip_serializing_if = "Option::is_none")]
8919    pub cert_issuer_subject: Option<String>,
8920
8921    /// The base64-url-safe-encoded raw public key bytes of the issuer. 
8922    #[serde(rename = "CertIssuerPublicKey")]
8923    #[serde(skip_serializing_if = "Option::is_none")]
8924    pub cert_issuer_public_key: Option<String>,
8925
8926}
8927
8928/// A map of topological domains to topological segments. For in depth details, see documentation for the Topology object in the CSI specification. 
8929// special-casing PortMap, cos swagger-codegen doesn't figure out this type
8930pub type Topology = HashMap<String, Option<Vec<PortBinding>>>;
8931
8932#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8933pub struct UnlockKeyResponse {
8934    /// The swarm's unlock key.
8935    #[serde(rename = "UnlockKey")]
8936    #[serde(skip_serializing_if = "Option::is_none")]
8937    pub unlock_key: Option<String>,
8938
8939}
8940
8941#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
8942pub struct Volume {
8943    /// Name of the volume.
8944    #[serde(rename = "Name")]
8945    pub name: String,
8946
8947    /// Name of the volume driver used by the volume.
8948    #[serde(rename = "Driver")]
8949    pub driver: String,
8950
8951    /// Mount path of the volume on the host.
8952    #[serde(rename = "Mountpoint")]
8953    pub mountpoint: String,
8954
8955    /// Date/Time the volume was created.
8956    #[serde(rename = "CreatedAt")]
8957    #[serde(skip_serializing_if = "Option::is_none")]
8958    #[serde(
8959        default,
8960        deserialize_with = "deserialize_timestamp",
8961        serialize_with = "serialize_timestamp"
8962    )]
8963    pub created_at: Option<BollardDate>,
8964
8965    /// 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. 
8966    #[serde(rename = "Status")]
8967    #[serde(skip_serializing_if = "Option::is_none")]
8968    pub status: Option<HashMap<String, HashMap<(), ()>>>,
8969
8970    /// User-defined key/value metadata.
8971    #[serde(rename = "Labels")]
8972    #[serde(deserialize_with = "deserialize_nonoptional_map")]
8973    pub labels: HashMap<String, String>,
8974
8975    /// The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level. 
8976    #[serde(rename = "Scope")]
8977    #[serde(skip_serializing_if = "Option::is_none")]
8978    #[serde(with = "::serde_with::As::<::serde_with::NoneAsEmptyString>")]
8979    pub scope: Option<VolumeScopeEnum>,
8980
8981    #[serde(rename = "ClusterVolume")]
8982    #[serde(skip_serializing_if = "Option::is_none")]
8983    pub cluster_volume: Option<ClusterVolume>,
8984
8985    /// The driver specific options used when creating the volume. 
8986    #[serde(rename = "Options")]
8987    #[serde(deserialize_with = "deserialize_nonoptional_map")]
8988    pub options: HashMap<String, String>,
8989
8990    #[serde(rename = "UsageData")]
8991    #[serde(skip_serializing_if = "Option::is_none")]
8992    pub usage_data: Option<VolumeUsageData>,
8993
8994}
8995
8996#[allow(non_camel_case_types)]
8997#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
8998pub enum VolumeScopeEnum { 
8999    #[serde(rename = "")]
9000    EMPTY,
9001    #[serde(rename = "local")]
9002    LOCAL,
9003    #[serde(rename = "global")]
9004    GLOBAL,
9005}
9006
9007impl ::std::fmt::Display for VolumeScopeEnum {
9008    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
9009        match *self { 
9010            VolumeScopeEnum::EMPTY => write!(f, ""),
9011            VolumeScopeEnum::LOCAL => write!(f, "{}", "local"),
9012            VolumeScopeEnum::GLOBAL => write!(f, "{}", "global"),
9013
9014        }
9015    }
9016}
9017
9018impl ::std::str::FromStr for VolumeScopeEnum {
9019    type Err = String;
9020    fn from_str(s: &str) -> Result<Self, Self::Err> {
9021        match s { 
9022            "" => Ok(VolumeScopeEnum::EMPTY),
9023            "local" => Ok(VolumeScopeEnum::LOCAL),
9024            "global" => Ok(VolumeScopeEnum::GLOBAL),
9025            x => Err(format!("Invalid enum type: {}", x)),
9026        }
9027    }
9028}
9029
9030impl ::std::convert::AsRef<str> for VolumeScopeEnum {
9031    fn as_ref(&self) -> &str {
9032        match self { 
9033            VolumeScopeEnum::EMPTY => "",
9034            VolumeScopeEnum::LOCAL => "local",
9035            VolumeScopeEnum::GLOBAL => "global",
9036        }
9037    }
9038}
9039
9040/// Volume configuration
9041#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9042pub struct VolumeCreateOptions {
9043    /// The new volume's name. If not specified, Docker generates a name. 
9044    #[serde(rename = "Name")]
9045    #[serde(skip_serializing_if = "Option::is_none")]
9046    pub name: Option<String>,
9047
9048    /// Name of the volume driver to use.
9049    #[serde(rename = "Driver")]
9050    #[serde(skip_serializing_if = "Option::is_none")]
9051    pub driver: Option<String>,
9052
9053    /// A mapping of driver options and values. These options are passed directly to the driver and are driver specific. 
9054    #[serde(rename = "DriverOpts")]
9055    #[serde(skip_serializing_if = "Option::is_none")]
9056    pub driver_opts: Option<HashMap<String, String>>,
9057
9058    /// User-defined key/value metadata.
9059    #[serde(rename = "Labels")]
9060    #[serde(skip_serializing_if = "Option::is_none")]
9061    pub labels: Option<HashMap<String, String>>,
9062
9063    #[serde(rename = "ClusterVolumeSpec")]
9064    #[serde(skip_serializing_if = "Option::is_none")]
9065    pub cluster_volume_spec: Option<ClusterVolumeSpec>,
9066
9067}
9068
9069/// Volume list response
9070#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9071pub struct VolumeListResponse {
9072    /// List of volumes
9073    #[serde(rename = "Volumes")]
9074    #[serde(skip_serializing_if = "Option::is_none")]
9075    pub volumes: Option<Vec<Volume>>,
9076
9077    /// Warnings that occurred when fetching the list of volumes. 
9078    #[serde(rename = "Warnings")]
9079    #[serde(skip_serializing_if = "Option::is_none")]
9080    pub warnings: Option<Vec<String>>,
9081
9082}
9083
9084#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9085pub struct VolumePruneResponse {
9086    /// Volumes that were deleted
9087    #[serde(rename = "VolumesDeleted")]
9088    #[serde(skip_serializing_if = "Option::is_none")]
9089    pub volumes_deleted: Option<Vec<String>>,
9090
9091    /// Disk space reclaimed in bytes
9092    #[serde(rename = "SpaceReclaimed")]
9093    #[serde(skip_serializing_if = "Option::is_none")]
9094    pub space_reclaimed: Option<i64>,
9095
9096}
9097
9098/// Usage details about the volume. This information is used by the `GET /system/df` endpoint, and omitted in other endpoints. 
9099#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9100pub struct VolumeUsageData {
9101    /// 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\") 
9102    #[serde(rename = "Size")]
9103    pub size: i64,
9104
9105    /// The number of containers referencing this volume. This field is set to `-1` if the reference-count is not available. 
9106    #[serde(rename = "RefCount")]
9107    pub ref_count: i64,
9108
9109}