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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
#[allow(unused_imports)]
use super::*;
/// Provides summary information for a software source mirror.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MirrorSummary {
/// The [OCID](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the software source.
pub id: String,
/// Current state of the software source mirror.
pub state: MirrorState,
/// A decimal number representing the percentage of the software source that has been synced. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
pub percentage: i64,
/// Time that the software source was last synced (in [RFC 3339](https://tools.ietf.org/rfc/rfc3339) format).
pub time_last_synced: DateTime<Utc>,
/// The current log from the management station plugin.
pub log: String,
/// The number of packages within the mirrored software source. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
pub package_count: i64,
/// The size the mirrored software source in bytes. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
pub size: i64,
/// Display name of the mirror.
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
/// Type of software source.
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub r#type: Option<MirrorType>,
/// The OS family of the software source.
#[serde(skip_serializing_if = "Option::is_none")]
pub os_family: Option<OsFamily>,
/// The architecture type supported by the software source.
#[serde(skip_serializing_if = "Option::is_none")]
pub arch_type: Option<ArchType>,
}
/// Required fields for MirrorSummary
pub struct MirrorSummaryRequired {
/// The [OCID](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the software source.
pub id: String,
/// Current state of the software source mirror.
pub state: MirrorState,
/// A decimal number representing the percentage of the software source that has been synced. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
pub percentage: i64,
/// Time that the software source was last synced (in [RFC 3339](https://tools.ietf.org/rfc/rfc3339) format).
pub time_last_synced: DateTime<Utc>,
/// The current log from the management station plugin.
pub log: String,
/// The number of packages within the mirrored software source. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
pub package_count: i64,
/// The size the mirrored software source in bytes. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
pub size: i64,
}
impl MirrorSummary {
/// Create a new MirrorSummary with required fields
pub fn new(required: MirrorSummaryRequired) -> Self {
Self {
id: required.id,
state: required.state,
percentage: required.percentage,
time_last_synced: required.time_last_synced,
log: required.log,
package_count: required.package_count,
size: required.size,
display_name: None,
r#type: None,
os_family: None,
arch_type: None,
}
}
/// Set id
pub fn set_id(mut self, value: String) -> Self {
self.id = value;
self
}
/// Set display_name
pub fn set_display_name(mut self, value: Option<String>) -> Self {
self.display_name = value;
self
}
/// Set r#type
pub fn set_type(mut self, value: Option<MirrorType>) -> Self {
self.r#type = value;
self
}
/// Set os_family
pub fn set_os_family(mut self, value: Option<OsFamily>) -> Self {
self.os_family = value;
self
}
/// Set arch_type
pub fn set_arch_type(mut self, value: Option<ArchType>) -> Self {
self.arch_type = value;
self
}
/// Set state
pub fn set_state(mut self, value: MirrorState) -> Self {
self.state = value;
self
}
/// Set percentage
pub fn set_percentage(mut self, value: i64) -> Self {
self.percentage = value;
self
}
/// Set time_last_synced
pub fn set_time_last_synced(mut self, value: DateTime<Utc>) -> Self {
self.time_last_synced = value;
self
}
/// Set log
pub fn set_log(mut self, value: String) -> Self {
self.log = value;
self
}
/// Set package_count
pub fn set_package_count(mut self, value: i64) -> Self {
self.package_count = value;
self
}
/// Set size
pub fn set_size(mut self, value: i64) -> Self {
self.size = value;
self
}
/// Set display_name (unwraps Option)
pub fn with_display_name(mut self, value: impl Into<String>) -> Self {
self.display_name = Some(value.into());
self
}
/// Set r#type (unwraps Option)
pub fn with_type(mut self, value: MirrorType) -> Self {
self.r#type = Some(value);
self
}
/// Set os_family (unwraps Option)
pub fn with_os_family(mut self, value: OsFamily) -> Self {
self.os_family = Some(value);
self
}
/// Set arch_type (unwraps Option)
pub fn with_arch_type(mut self, value: ArchType) -> Self {
self.arch_type = Some(value);
self
}
}