dtz-containers 2.2.5

a generated client for the DTZ Containers API
Documentation
/*
 * DTZ Containers
 *
 * a generated client for the DTZ Containers API
 *
 * Contact: jens@apimeister.com
 * Generated by: https://openapi-generator.tech
 */

#[allow(unused_imports)]
use crate::models;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateServiceRequest {
    /// whether this service is active and should be propagated to ingress
    #[serde(rename = "enabled")]
    pub enabled: bool,
    /// by default this property is empty and represents that all verified domains will be added. I a domain is added through a service, this service will only be served through that domain, und new domain als also no longer added automatically.
    #[serde(rename = "domain", skip_serializing_if = "Option::is_none")]
    pub domain: Option<Vec<String>>,
    #[serde(rename = "prefix")]
    pub prefix: String,
    #[serde(rename = "containerImage")]
    pub container_image: String,
    /// the version of the container image; either empty string to reset or a sha256 digest in the form of \"sha256:digest\"
    #[serde(rename = "containerImageVersion", skip_serializing_if = "Option::is_none")]
    pub container_image_version: Option<String>,
    /// Optional port to expose externally; when omitted the first open container port is exposed automatically.
    #[serde(rename = "containerPort", skip_serializing_if = "Option::is_none")]
    pub container_port: Option<i32>,
    #[serde(rename = "containerPullUser", skip_serializing_if = "Option::is_none")]
    pub container_pull_user: Option<String>,
    #[serde(rename = "containerPullPwd", skip_serializing_if = "Option::is_none")]
    pub container_pull_pwd: Option<String>,
    #[serde(rename = "envVariables", skip_serializing_if = "Option::is_none")]
    pub env_variables: Option<std::collections::HashMap<String, models::CreateJobRequestEnvVariablesValue>>,
    #[serde(rename = "rewrite", skip_serializing_if = "Option::is_none")]
    pub rewrite: Option<Box<models::ServiceRewrite>>,
    #[serde(rename = "login", skip_serializing_if = "Option::is_none")]
    pub login: Option<Box<models::ServiceLogin>>,
    #[serde(rename = "mounts", skip_serializing_if = "Option::is_none")]
    pub mounts: Option<Vec<models::VolumeMount>>,
}

impl CreateServiceRequest {
    pub fn new(enabled: bool, prefix: String, container_image: String) -> CreateServiceRequest {
        CreateServiceRequest {
            enabled,
            domain: None,
            prefix,
            container_image,
            container_image_version: None,
            container_port: None,
            container_pull_user: None,
            container_pull_pwd: None,
            env_variables: None,
            rewrite: None,
            login: None,
            mounts: None,
        }
    }
}