-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathproject.rs
More file actions
87 lines (85 loc) · 3.24 KB
/
project.rs
File metadata and controls
87 lines (85 loc) · 3.24 KB
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
/*
* CloudTruth Management API
*
* CloudTruth centralizes your configuration parameters and secrets making them easier to manage and use as a team.
*
* The version of the OpenAPI document: v1
* Contact: support@cloudtruth.com
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Project {
/// The URL for the project.
#[serde(rename = "url")]
pub url: String,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "ledger_id")]
pub ledger_id: String,
/// The project name.
#[serde(rename = "name")]
pub name: String,
/// A regular expression parameter names must match
#[serde(
rename = "parameter_name_pattern",
skip_serializing_if = "Option::is_none"
)]
pub parameter_name_pattern: Option<String>,
/// A description of the project. You may find it helpful to document how this project is used to assist others when they need to maintain software that uses this content.
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// This is the opposite of `depends_on`, see that field for more details.
#[serde(rename = "dependents")]
pub dependents: Vec<String>,
/// Project dependencies allow projects to be used for shared configuration, for example a database used by many applications needs to advertise its port number. Projects can depend on another project which will add the parameters from the parent project into the current project. All of the parameter names between the two projects must be unique. When retrieving values or rendering templates, all of the parameters from the parent project will also be available in the current project.
#[serde(rename = "depends_on")]
pub depends_on: Option<String>,
/// Indicates if access control is being enforced through grants.
#[serde(rename = "access_controlled", skip_serializing_if = "Option::is_none")]
pub access_controlled: Option<bool>,
/// Your role in the project, if the project is access-controlled.
#[serde(rename = "role")]
pub role: Option<Box<crate::models::RoleEnum>>,
/// Deprecated. Blank.
#[serde(rename = "pushes")]
pub pushes: Vec<String>,
/// Deprecated. Blank.
#[serde(rename = "push_urls")]
pub push_urls: Vec<String>,
#[serde(rename = "created_at")]
pub created_at: String,
#[serde(rename = "modified_at")]
pub modified_at: Option<String>,
}
impl Project {
pub fn new(
url: String,
id: String,
ledger_id: String,
name: String,
dependents: Vec<String>,
depends_on: Option<String>,
role: Option<crate::models::RoleEnum>,
pushes: Vec<String>,
push_urls: Vec<String>,
created_at: String,
modified_at: Option<String>,
) -> Project {
Project {
url,
id,
ledger_id,
name,
parameter_name_pattern: None,
description: None,
dependents,
depends_on,
access_controlled: None,
role: role.map(Box::new),
pushes,
push_urls,
created_at,
modified_at,
}
}
}