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
/*
 * 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};

/// CreateContainerConfig : CreateContainerConfig used when compatible endpoint creates a container
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateContainerConfig {
    #[serde(rename = "ArgsEscaped", skip_serializing_if = "Option::is_none")]
    pub args_escaped: Option<bool>,
    #[serde(rename = "AttachStderr", skip_serializing_if = "Option::is_none")]
    pub attach_stderr: Option<bool>,
    #[serde(rename = "AttachStdin", skip_serializing_if = "Option::is_none")]
    pub attach_stdin: Option<bool>,
    #[serde(rename = "AttachStdout", skip_serializing_if = "Option::is_none")]
    pub attach_stdout: Option<bool>,
    /// We need to override the json decoder to accept both options.
    #[serde(rename = "Cmd", skip_serializing_if = "Option::is_none")]
    pub cmd: Option<Vec<String>>,
    #[serde(rename = "Domainname", skip_serializing_if = "Option::is_none")]
    pub domainname: Option<String>,
    /// We need to override the json decoder to accept both options.
    #[serde(rename = "Entrypoint", skip_serializing_if = "Option::is_none")]
    pub entrypoint: Option<Vec<String>>,
    #[serde(rename = "Env", skip_serializing_if = "Option::is_none")]
    pub env: Option<Vec<String>>,
    #[serde(rename = "EnvMerge", skip_serializing_if = "Option::is_none")]
    pub env_merge: Option<Vec<String>>,
    /// PortSet is a collection of structs indexed by Port
    #[serde(rename = "ExposedPorts", skip_serializing_if = "Option::is_none")]
    pub exposed_ports: Option<std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "Healthcheck", skip_serializing_if = "Option::is_none")]
    pub healthcheck: Option<Box<models::HealthcheckConfig>>,
    #[serde(rename = "HostConfig", skip_serializing_if = "Option::is_none")]
    pub host_config: Option<Box<models::HostConfig>>,
    #[serde(rename = "Hostname", skip_serializing_if = "Option::is_none")]
    pub hostname: Option<String>,
    #[serde(rename = "Image", skip_serializing_if = "Option::is_none")]
    pub image: Option<String>,
    #[serde(rename = "Labels", skip_serializing_if = "Option::is_none")]
    pub labels: Option<std::collections::HashMap<String, String>>,
    /// Mac Address of the container.  Deprecated: this field is deprecated since API v1.44. Use EndpointSettings.MacAddress instead.
    #[serde(rename = "MacAddress", skip_serializing_if = "Option::is_none")]
    pub mac_address: Option<String>,
    #[serde(rename = "Name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(rename = "NetworkDisabled", skip_serializing_if = "Option::is_none")]
    pub network_disabled: Option<bool>,
    #[serde(rename = "NetworkingConfig", skip_serializing_if = "Option::is_none")]
    pub networking_config: Option<Box<models::NetworkingConfig>>,
    #[serde(rename = "OnBuild", skip_serializing_if = "Option::is_none")]
    pub on_build: Option<Vec<String>>,
    #[serde(rename = "OpenStdin", skip_serializing_if = "Option::is_none")]
    pub open_stdin: Option<bool>,
    /// We need to override the json decoder to accept both options.
    #[serde(rename = "Shell", skip_serializing_if = "Option::is_none")]
    pub shell: Option<Vec<String>>,
    #[serde(rename = "StdinOnce", skip_serializing_if = "Option::is_none")]
    pub stdin_once: Option<bool>,
    #[serde(rename = "StopSignal", skip_serializing_if = "Option::is_none")]
    pub stop_signal: Option<String>,
    #[serde(rename = "StopTimeout", skip_serializing_if = "Option::is_none")]
    pub stop_timeout: Option<i64>,
    #[serde(rename = "Tty", skip_serializing_if = "Option::is_none")]
    pub tty: Option<bool>,
    #[serde(rename = "UnsetEnv", skip_serializing_if = "Option::is_none")]
    pub unset_env: Option<Vec<String>>,
    #[serde(rename = "UnsetEnvAll", skip_serializing_if = "Option::is_none")]
    pub unset_env_all: Option<bool>,
    #[serde(rename = "User", skip_serializing_if = "Option::is_none")]
    pub user: Option<String>,
    #[serde(rename = "Volumes", skip_serializing_if = "Option::is_none")]
    pub volumes: Option<std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "WorkingDir", skip_serializing_if = "Option::is_none")]
    pub working_dir: Option<String>,
}

impl CreateContainerConfig {
    /// CreateContainerConfig used when compatible endpoint creates a container
    pub fn new() -> CreateContainerConfig {
        CreateContainerConfig {
            args_escaped: None,
            attach_stderr: None,
            attach_stdin: None,
            attach_stdout: None,
            cmd: None,
            domainname: None,
            entrypoint: None,
            env: None,
            env_merge: None,
            exposed_ports: None,
            healthcheck: None,
            host_config: None,
            hostname: None,
            image: None,
            labels: None,
            mac_address: None,
            name: None,
            network_disabled: None,
            networking_config: None,
            on_build: None,
            open_stdin: None,
            shell: None,
            stdin_once: None,
            stop_signal: None,
            stop_timeout: None,
            tty: None,
            unset_env: None,
            unset_env_all: None,
            user: None,
            volumes: None,
            working_dir: None,
        }
    }
}