Skip to main content

dtz_containers/models/
update_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/// UpdateServiceRequest : Full update for a service; all fields are required and will overwrite existing values
16#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
17pub struct UpdateServiceRequest {
18    /// whether this service is active and should be propagated to ingress
19    #[serde(rename = "enabled")]
20    pub enabled: bool,
21    /// 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.
22    #[serde(rename = "domain", skip_serializing_if = "Option::is_none")]
23    pub domain: Option<Vec<String>>,
24    #[serde(rename = "prefix")]
25    pub prefix: String,
26    #[serde(rename = "containerImage")]
27    pub container_image: String,
28    /// the version of the container image; either empty string to reset or a sha256 digest in the form of \"sha256:digest\"
29    #[serde(rename = "containerImageVersion", skip_serializing_if = "Option::is_none")]
30    pub container_image_version: Option<String>,
31    /// Optional port to expose externally; when omitted the first open container port is exposed automatically.
32    #[serde(rename = "containerPort", skip_serializing_if = "Option::is_none")]
33    pub container_port: Option<i32>,
34    #[serde(rename = "containerPullUser", skip_serializing_if = "Option::is_none")]
35    pub container_pull_user: Option<String>,
36    #[serde(rename = "containerPullPwd", skip_serializing_if = "Option::is_none")]
37    pub container_pull_pwd: Option<String>,
38    #[serde(rename = "envVariables")]
39    pub env_variables: std::collections::HashMap<String, models::CreateJobRequestEnvVariablesValue>,
40    #[serde(rename = "rewrite", skip_serializing_if = "Option::is_none")]
41    pub rewrite: Option<Box<models::ServiceRewrite>>,
42    #[serde(rename = "login", skip_serializing_if = "Option::is_none")]
43    pub login: Option<Box<models::UpdateServiceRequestLogin>>,
44    #[serde(rename = "mounts", skip_serializing_if = "Option::is_none")]
45    pub mounts: Option<Vec<models::VolumeMount>>,
46}
47
48impl UpdateServiceRequest {
49    /// Full update for a service; all fields are required and will overwrite existing values
50    pub fn new(enabled: bool, prefix: String, container_image: String, env_variables: std::collections::HashMap<String, models::CreateJobRequestEnvVariablesValue>) -> UpdateServiceRequest {
51        UpdateServiceRequest {
52            enabled,
53            domain: None,
54            prefix,
55            container_image,
56            container_image_version: None,
57            container_port: None,
58            container_pull_user: None,
59            container_pull_pwd: None,
60            env_variables,
61            rewrite: None,
62            login: None,
63            mounts: None,
64        }
65    }
66}
67