Skip to main content

dtz_containers/models/
create_service_request.rs

1/*
2 * DTZ Containers
3 *
4 * a generated client for the DTZ Containers API
5 *
6 * Contact: jens@apimeister.com
7 * Generated by: https://openapi-generator.tech
8 */
9
10#[allow(unused_imports)]
11use crate::models;
12#[allow(unused_imports)]
13use serde::{Deserialize, Serialize};
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CreateServiceRequest {
17    /// whether this service is active and should be propagated to ingress
18    #[serde(rename = "enabled")]
19    pub enabled: bool,
20    /// 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.
21    #[serde(rename = "domain", skip_serializing_if = "Option::is_none")]
22    pub domain: Option<Vec<String>>,
23    #[serde(rename = "prefix")]
24    pub prefix: String,
25    #[serde(rename = "containerImage")]
26    pub container_image: String,
27    /// the version of the container image; either empty string to reset or a sha256 digest in the form of \"sha256:digest\"
28    #[serde(rename = "containerImageVersion", skip_serializing_if = "Option::is_none")]
29    pub container_image_version: Option<String>,
30    /// Optional port to expose externally; when omitted the first open container port is exposed automatically.
31    #[serde(rename = "containerPort", skip_serializing_if = "Option::is_none")]
32    pub container_port: Option<i32>,
33    #[serde(rename = "containerPullUser", skip_serializing_if = "Option::is_none")]
34    pub container_pull_user: Option<String>,
35    #[serde(rename = "containerPullPwd", skip_serializing_if = "Option::is_none")]
36    pub container_pull_pwd: Option<String>,
37    #[serde(rename = "envVariables", skip_serializing_if = "Option::is_none")]
38    pub env_variables: Option<std::collections::HashMap<String, models::CreateJobRequestEnvVariablesValue>>,
39    #[serde(rename = "rewrite", skip_serializing_if = "Option::is_none")]
40    pub rewrite: Option<Box<models::ServiceRewrite>>,
41    #[serde(rename = "login", skip_serializing_if = "Option::is_none")]
42    pub login: Option<Box<models::ServiceLogin>>,
43    #[serde(rename = "mounts", skip_serializing_if = "Option::is_none")]
44    pub mounts: Option<Vec<models::VolumeMount>>,
45}
46
47impl CreateServiceRequest {
48    pub fn new(enabled: bool, prefix: String, container_image: String) -> CreateServiceRequest {
49        CreateServiceRequest {
50            enabled,
51            domain: None,
52            prefix,
53            container_image,
54            container_image_version: None,
55            container_port: None,
56            container_pull_user: None,
57            container_pull_pwd: None,
58            env_variables: None,
59            rewrite: None,
60            login: None,
61            mounts: None,
62        }
63    }
64}
65