1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
 * supports a RESTful API for the Libpod library
 *
 * This documentation describes the Podman v2.x+ RESTful API. It consists of a Docker-compatible API and a Libpod API providing support for Podman’s unique features such as pods.  To start the service and keep it running for 5,000 seconds (-t 0 runs forever):  podman system service -t 5000 &  You can then use cURL on the socket using requests documented below.  NOTE: if you install the package podman-docker, it will create a symbolic link for /run/docker.sock to /run/podman/podman.sock  NOTE: Some fields in the API response JSON are encoded as omitempty, which means that if said field has a zero value, they will not be encoded in the API response. This is a feature to help reduce the size of the JSON responses returned via the API.  NOTE: Due to the limitations of [go-swagger](https://github.com/go-swagger/go-swagger), some field values that have a complex type show up as null in the docs as well as in the API responses. This is because the zero value for the field type is null. The field description in the docs will state what type the field is expected to be for such cases.  See podman-system-service(1) for more information.  Quick Examples:  'podman info'  curl --unix-socket /run/podman/podman.sock http://d/v5.0.0/libpod/info  'podman pull quay.io/containers/podman'  curl -XPOST --unix-socket /run/podman/podman.sock -v 'http://d/v5.0.0/images/create?fromImage=quay.io%2Fcontainers%2Fpodman'  'podman list images'  curl --unix-socket /run/podman/podman.sock -v 'http://d/v5.0.0/libpod/images/json' | jq
 *
 * The version of the OpenAPI document: 5.0.0
 * Contact: podman@lists.podman.io
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// ListContainer : ListContainer describes a container suitable for listing
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ListContainer {
    /// AutoRemove
    #[serde(rename = "AutoRemove", skip_serializing_if = "Option::is_none")]
    pub auto_remove: Option<bool>,
    /// CIDFile specified at creation time.
    #[serde(rename = "CIDFile", skip_serializing_if = "Option::is_none")]
    pub cid_file: Option<String>,
    /// Container command
    #[serde(rename = "Command", skip_serializing_if = "Option::is_none")]
    pub command: Option<Vec<String>>,
    /// Container creation time
    #[serde(rename = "Created", skip_serializing_if = "Option::is_none")]
    pub created: Option<String>,
    /// Human-readable container creation time.
    #[serde(rename = "CreatedAt", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    /// If container has exited, the return code from the command
    #[serde(rename = "ExitCode", skip_serializing_if = "Option::is_none")]
    pub exit_code: Option<i32>,
    /// If container has exited/stopped
    #[serde(rename = "Exited", skip_serializing_if = "Option::is_none")]
    pub exited: Option<bool>,
    /// Time container exited
    #[serde(rename = "ExitedAt", skip_serializing_if = "Option::is_none")]
    pub exited_at: Option<i64>,
    /// ExposedPorts contains the ports that are exposed but not forwarded, see Ports for forwarded ports. The key is the port number and the string slice contains the protocols, i.e. \"tcp\", \"udp\" and \"sctp\".
    #[serde(rename = "ExposedPorts", skip_serializing_if = "Option::is_none")]
    pub exposed_ports: Option<serde_json::Value>,
    /// The unique identifier for the container
    #[serde(rename = "Id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Container image
    #[serde(rename = "Image", skip_serializing_if = "Option::is_none")]
    pub image: Option<String>,
    /// Container image ID
    #[serde(rename = "ImageID", skip_serializing_if = "Option::is_none")]
    pub image_id: Option<String>,
    /// If this container is a Pod infra container
    #[serde(rename = "IsInfra", skip_serializing_if = "Option::is_none")]
    pub is_infra: Option<bool>,
    /// Labels for container
    #[serde(rename = "Labels", skip_serializing_if = "Option::is_none")]
    pub labels: Option<std::collections::HashMap<String, String>>,
    /// User volume mounts
    #[serde(rename = "Mounts", skip_serializing_if = "Option::is_none")]
    pub mounts: Option<Vec<String>>,
    /// The names assigned to the container
    #[serde(rename = "Names", skip_serializing_if = "Option::is_none")]
    pub names: Option<Vec<String>>,
    #[serde(rename = "Namespaces", skip_serializing_if = "Option::is_none")]
    pub namespaces: Option<Box<models::ListContainerNamespaces>>,
    /// The network names assigned to the container
    #[serde(rename = "Networks", skip_serializing_if = "Option::is_none")]
    pub networks: Option<Vec<String>>,
    /// The process id of the container
    #[serde(rename = "Pid", skip_serializing_if = "Option::is_none")]
    pub pid: Option<i64>,
    /// If the container is part of Pod, the Pod ID. Requires the pod boolean to be set
    #[serde(rename = "Pod", skip_serializing_if = "Option::is_none")]
    pub pod: Option<String>,
    /// If the container is part of Pod, the Pod name. Requires the pod boolean to be set
    #[serde(rename = "PodName", skip_serializing_if = "Option::is_none")]
    pub pod_name: Option<String>,
    /// Port mappings
    #[serde(rename = "Ports", skip_serializing_if = "Option::is_none")]
    pub ports: Option<Vec<models::PortMapping>>,
    /// Restarts is how many times the container was restarted by its restart policy. This is NOT incremented by normal container restarts (only by restart policy).
    #[serde(rename = "Restarts", skip_serializing_if = "Option::is_none")]
    pub restarts: Option<i32>,
    #[serde(rename = "Size", skip_serializing_if = "Option::is_none")]
    pub size: Option<Box<models::ContainerSize>>,
    /// Time when container started
    #[serde(rename = "StartedAt", skip_serializing_if = "Option::is_none")]
    pub started_at: Option<i64>,
    /// State of container
    #[serde(rename = "State", skip_serializing_if = "Option::is_none")]
    pub state: Option<String>,
    /// Status is a human-readable approximation of a duration for json output
    #[serde(rename = "Status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
}

impl ListContainer {
    /// ListContainer describes a container suitable for listing
    pub fn new() -> ListContainer {
        ListContainer {
            auto_remove: None,
            cid_file: None,
            command: None,
            created: None,
            created_at: None,
            exit_code: None,
            exited: None,
            exited_at: None,
            exposed_ports: None,
            id: None,
            image: None,
            image_id: None,
            is_infra: None,
            labels: None,
            mounts: None,
            names: None,
            namespaces: None,
            networks: None,
            pid: None,
            pod: None,
            pod_name: None,
            ports: None,
            restarts: None,
            size: None,
            started_at: None,
            state: None,
            status: None,
        }
    }
}