-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_metric_report_definition_v1_4_0_metric.go
319 lines (270 loc) · 11.1 KB
/
model_metric_report_definition_v1_4_0_metric.go
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
/*
* Redfish
*
* This contains the definition of a Redfish service.
*
* API version: 2020.4
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package redfish
import (
"encoding/json"
)
// MetricReportDefinitionV140Metric Specifies a metric to include in the metric report. The metrics are derived by applying a calculation on each of the listed metric properties.
type MetricReportDefinitionV140Metric struct {
// The duration over which the function is computed.
CollectionDuration NullableString `json:"CollectionDuration,omitempty"`
CollectionFunction *MetricReportDefinitionV140CalculationAlgorithmEnum `json:"CollectionFunction,omitempty"`
CollectionTimeScope *MetricReportDefinitionV140CollectionTimeScope `json:"CollectionTimeScope,omitempty"`
// The label for the metric definition that is derived by applying the CollectionFunction to the metric property. It matches the Id property of the corresponding metric definition.
MetricId NullableString `json:"MetricId,omitempty"`
// The set of URIs for the properties on which this metric is collected.
MetricProperties *[]string `json:"MetricProperties,omitempty"`
// The OEM extension.
Oem *map[string]map[string]interface{} `json:"Oem,omitempty"`
}
// NewMetricReportDefinitionV140Metric instantiates a new MetricReportDefinitionV140Metric object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewMetricReportDefinitionV140Metric() *MetricReportDefinitionV140Metric {
this := MetricReportDefinitionV140Metric{}
return &this
}
// NewMetricReportDefinitionV140MetricWithDefaults instantiates a new MetricReportDefinitionV140Metric object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewMetricReportDefinitionV140MetricWithDefaults() *MetricReportDefinitionV140Metric {
this := MetricReportDefinitionV140Metric{}
return &this
}
// GetCollectionDuration returns the CollectionDuration field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MetricReportDefinitionV140Metric) GetCollectionDuration() string {
if o == nil || o.CollectionDuration.Get() == nil {
var ret string
return ret
}
return *o.CollectionDuration.Get()
}
// GetCollectionDurationOk returns a tuple with the CollectionDuration field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MetricReportDefinitionV140Metric) GetCollectionDurationOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.CollectionDuration.Get(), o.CollectionDuration.IsSet()
}
// HasCollectionDuration returns a boolean if a field has been set.
func (o *MetricReportDefinitionV140Metric) HasCollectionDuration() bool {
if o != nil && o.CollectionDuration.IsSet() {
return true
}
return false
}
// SetCollectionDuration gets a reference to the given NullableString and assigns it to the CollectionDuration field.
func (o *MetricReportDefinitionV140Metric) SetCollectionDuration(v string) {
o.CollectionDuration.Set(&v)
}
// SetCollectionDurationNil sets the value for CollectionDuration to be an explicit nil
func (o *MetricReportDefinitionV140Metric) SetCollectionDurationNil() {
o.CollectionDuration.Set(nil)
}
// UnsetCollectionDuration ensures that no value is present for CollectionDuration, not even an explicit nil
func (o *MetricReportDefinitionV140Metric) UnsetCollectionDuration() {
o.CollectionDuration.Unset()
}
// GetCollectionFunction returns the CollectionFunction field value if set, zero value otherwise.
func (o *MetricReportDefinitionV140Metric) GetCollectionFunction() MetricReportDefinitionV140CalculationAlgorithmEnum {
if o == nil || o.CollectionFunction == nil {
var ret MetricReportDefinitionV140CalculationAlgorithmEnum
return ret
}
return *o.CollectionFunction
}
// GetCollectionFunctionOk returns a tuple with the CollectionFunction field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricReportDefinitionV140Metric) GetCollectionFunctionOk() (*MetricReportDefinitionV140CalculationAlgorithmEnum, bool) {
if o == nil || o.CollectionFunction == nil {
return nil, false
}
return o.CollectionFunction, true
}
// HasCollectionFunction returns a boolean if a field has been set.
func (o *MetricReportDefinitionV140Metric) HasCollectionFunction() bool {
if o != nil && o.CollectionFunction != nil {
return true
}
return false
}
// SetCollectionFunction gets a reference to the given MetricReportDefinitionV140CalculationAlgorithmEnum and assigns it to the CollectionFunction field.
func (o *MetricReportDefinitionV140Metric) SetCollectionFunction(v MetricReportDefinitionV140CalculationAlgorithmEnum) {
o.CollectionFunction = &v
}
// GetCollectionTimeScope returns the CollectionTimeScope field value if set, zero value otherwise.
func (o *MetricReportDefinitionV140Metric) GetCollectionTimeScope() MetricReportDefinitionV140CollectionTimeScope {
if o == nil || o.CollectionTimeScope == nil {
var ret MetricReportDefinitionV140CollectionTimeScope
return ret
}
return *o.CollectionTimeScope
}
// GetCollectionTimeScopeOk returns a tuple with the CollectionTimeScope field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricReportDefinitionV140Metric) GetCollectionTimeScopeOk() (*MetricReportDefinitionV140CollectionTimeScope, bool) {
if o == nil || o.CollectionTimeScope == nil {
return nil, false
}
return o.CollectionTimeScope, true
}
// HasCollectionTimeScope returns a boolean if a field has been set.
func (o *MetricReportDefinitionV140Metric) HasCollectionTimeScope() bool {
if o != nil && o.CollectionTimeScope != nil {
return true
}
return false
}
// SetCollectionTimeScope gets a reference to the given MetricReportDefinitionV140CollectionTimeScope and assigns it to the CollectionTimeScope field.
func (o *MetricReportDefinitionV140Metric) SetCollectionTimeScope(v MetricReportDefinitionV140CollectionTimeScope) {
o.CollectionTimeScope = &v
}
// GetMetricId returns the MetricId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MetricReportDefinitionV140Metric) GetMetricId() string {
if o == nil || o.MetricId.Get() == nil {
var ret string
return ret
}
return *o.MetricId.Get()
}
// GetMetricIdOk returns a tuple with the MetricId field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MetricReportDefinitionV140Metric) GetMetricIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.MetricId.Get(), o.MetricId.IsSet()
}
// HasMetricId returns a boolean if a field has been set.
func (o *MetricReportDefinitionV140Metric) HasMetricId() bool {
if o != nil && o.MetricId.IsSet() {
return true
}
return false
}
// SetMetricId gets a reference to the given NullableString and assigns it to the MetricId field.
func (o *MetricReportDefinitionV140Metric) SetMetricId(v string) {
o.MetricId.Set(&v)
}
// SetMetricIdNil sets the value for MetricId to be an explicit nil
func (o *MetricReportDefinitionV140Metric) SetMetricIdNil() {
o.MetricId.Set(nil)
}
// UnsetMetricId ensures that no value is present for MetricId, not even an explicit nil
func (o *MetricReportDefinitionV140Metric) UnsetMetricId() {
o.MetricId.Unset()
}
// GetMetricProperties returns the MetricProperties field value if set, zero value otherwise.
func (o *MetricReportDefinitionV140Metric) GetMetricProperties() []string {
if o == nil || o.MetricProperties == nil {
var ret []string
return ret
}
return *o.MetricProperties
}
// GetMetricPropertiesOk returns a tuple with the MetricProperties field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricReportDefinitionV140Metric) GetMetricPropertiesOk() (*[]string, bool) {
if o == nil || o.MetricProperties == nil {
return nil, false
}
return o.MetricProperties, true
}
// HasMetricProperties returns a boolean if a field has been set.
func (o *MetricReportDefinitionV140Metric) HasMetricProperties() bool {
if o != nil && o.MetricProperties != nil {
return true
}
return false
}
// SetMetricProperties gets a reference to the given []string and assigns it to the MetricProperties field.
func (o *MetricReportDefinitionV140Metric) SetMetricProperties(v []string) {
o.MetricProperties = &v
}
// GetOem returns the Oem field value if set, zero value otherwise.
func (o *MetricReportDefinitionV140Metric) GetOem() map[string]map[string]interface{} {
if o == nil || o.Oem == nil {
var ret map[string]map[string]interface{}
return ret
}
return *o.Oem
}
// GetOemOk returns a tuple with the Oem field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricReportDefinitionV140Metric) GetOemOk() (*map[string]map[string]interface{}, bool) {
if o == nil || o.Oem == nil {
return nil, false
}
return o.Oem, true
}
// HasOem returns a boolean if a field has been set.
func (o *MetricReportDefinitionV140Metric) HasOem() bool {
if o != nil && o.Oem != nil {
return true
}
return false
}
// SetOem gets a reference to the given map[string]map[string]interface{} and assigns it to the Oem field.
func (o *MetricReportDefinitionV140Metric) SetOem(v map[string]map[string]interface{}) {
o.Oem = &v
}
func (o MetricReportDefinitionV140Metric) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CollectionDuration.IsSet() {
toSerialize["CollectionDuration"] = o.CollectionDuration.Get()
}
if o.CollectionFunction != nil {
toSerialize["CollectionFunction"] = o.CollectionFunction
}
if o.CollectionTimeScope != nil {
toSerialize["CollectionTimeScope"] = o.CollectionTimeScope
}
if o.MetricId.IsSet() {
toSerialize["MetricId"] = o.MetricId.Get()
}
if o.MetricProperties != nil {
toSerialize["MetricProperties"] = o.MetricProperties
}
if o.Oem != nil {
toSerialize["Oem"] = o.Oem
}
return json.Marshal(toSerialize)
}
type NullableMetricReportDefinitionV140Metric struct {
value *MetricReportDefinitionV140Metric
isSet bool
}
func (v NullableMetricReportDefinitionV140Metric) Get() *MetricReportDefinitionV140Metric {
return v.value
}
func (v *NullableMetricReportDefinitionV140Metric) Set(val *MetricReportDefinitionV140Metric) {
v.value = val
v.isSet = true
}
func (v NullableMetricReportDefinitionV140Metric) IsSet() bool {
return v.isSet
}
func (v *NullableMetricReportDefinitionV140Metric) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetricReportDefinitionV140Metric(val *MetricReportDefinitionV140Metric) *NullableMetricReportDefinitionV140Metric {
return &NullableMetricReportDefinitionV140Metric{value: val, isSet: true}
}
func (v NullableMetricReportDefinitionV140Metric) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetricReportDefinitionV140Metric) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}