rs_docker_api_stubs/
models.rs

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