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