-
Notifications
You must be signed in to change notification settings - Fork 13
/
externalmetricdefinitioncreaterequest.go
112 lines (77 loc) · 3.01 KB
/
externalmetricdefinitioncreaterequest.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
package platformclientv2
import (
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Externalmetricdefinitioncreaterequest
type Externalmetricdefinitioncreaterequest struct {
// Name - The name of the External Metric Definition
Name *string `json:"name,omitempty"`
// Unit - The unit of the External Metric Definition
Unit *string `json:"unit,omitempty"`
// UnitDefinition - The unit definition of the External Metric Definition
UnitDefinition *string `json:"unitDefinition,omitempty"`
// Precision - The decimal precision of the External Metric Definition. Must be at least 0 and at most 5
Precision *int `json:"precision,omitempty"`
// DefaultObjectiveType - The default objective type of the External Metric Definition
DefaultObjectiveType *string `json:"defaultObjectiveType,omitempty"`
// Enabled - True if the External Metric Definition is enabled
Enabled *bool `json:"enabled,omitempty"`
}
func (o *Externalmetricdefinitioncreaterequest) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Externalmetricdefinitioncreaterequest
return json.Marshal(&struct {
Name *string `json:"name,omitempty"`
Unit *string `json:"unit,omitempty"`
UnitDefinition *string `json:"unitDefinition,omitempty"`
Precision *int `json:"precision,omitempty"`
DefaultObjectiveType *string `json:"defaultObjectiveType,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
*Alias
}{
Name: o.Name,
Unit: o.Unit,
UnitDefinition: o.UnitDefinition,
Precision: o.Precision,
DefaultObjectiveType: o.DefaultObjectiveType,
Enabled: o.Enabled,
Alias: (*Alias)(o),
})
}
func (o *Externalmetricdefinitioncreaterequest) UnmarshalJSON(b []byte) error {
var ExternalmetricdefinitioncreaterequestMap map[string]interface{}
err := json.Unmarshal(b, &ExternalmetricdefinitioncreaterequestMap)
if err != nil {
return err
}
if Name, ok := ExternalmetricdefinitioncreaterequestMap["name"].(string); ok {
o.Name = &Name
}
if Unit, ok := ExternalmetricdefinitioncreaterequestMap["unit"].(string); ok {
o.Unit = &Unit
}
if UnitDefinition, ok := ExternalmetricdefinitioncreaterequestMap["unitDefinition"].(string); ok {
o.UnitDefinition = &UnitDefinition
}
if Precision, ok := ExternalmetricdefinitioncreaterequestMap["precision"].(float64); ok {
PrecisionInt := int(Precision)
o.Precision = &PrecisionInt
}
if DefaultObjectiveType, ok := ExternalmetricdefinitioncreaterequestMap["defaultObjectiveType"].(string); ok {
o.DefaultObjectiveType = &DefaultObjectiveType
}
if Enabled, ok := ExternalmetricdefinitioncreaterequestMap["enabled"].(bool); ok {
o.Enabled = &Enabled
}
return nil
}
// String returns a JSON representation of the model
func (o *Externalmetricdefinitioncreaterequest) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}