-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel_action_amount.go
84 lines (68 loc) · 2.58 KB
/
model_action_amount.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
/*
* VM Auto Scaling API
*
* The VM Auto Scaling Service enables IONOS clients to horizontally scale the number of VM replicas based on configured rules. You can use VM Auto Scaling to ensure that you have a sufficient number of replicas to handle your application loads at all times. For this purpose, create a VM Auto Scaling Group that contains the server replicas. The VM Auto Scaling Service ensures that the number of replicas in the group is always within the defined limits. When scaling policies are set, VM Auto Scaling creates or deletes replicas according to the requirements of your applications. For each policy, specified 'scale-in' and 'scale-out' actions are performed when the corresponding thresholds are reached.
*
* API version: 1-SDK.1
* Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package ionoscloud
import (
"encoding/json"
"fmt"
)
// ActionAmount 'amountType=ABSOLUTE' specifies the absolute number of VMs that are added or removed. The value must be between 1 to 10. 'amountType=PERCENTAGE' specifies the percentage value that is applied to the current number of replicas of the VM Auto Scaling Group. The value must be between 1 to 200.
type ActionAmount string
// List of ActionAmount
const (
ACTIONAMOUNT_ABSOLUTE ActionAmount = "ABSOLUTE"
ACTIONAMOUNT_PERCENTAGE ActionAmount = "PERCENTAGE"
)
func (v *ActionAmount) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := ActionAmount(value)
for _, existing := range []ActionAmount{"ABSOLUTE", "PERCENTAGE"} {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid ActionAmount", value)
}
// Ptr returns reference to ActionAmount value
func (v ActionAmount) Ptr() *ActionAmount {
return &v
}
type NullableActionAmount struct {
value *ActionAmount
isSet bool
}
func (v NullableActionAmount) Get() *ActionAmount {
return v.value
}
func (v *NullableActionAmount) Set(val *ActionAmount) {
v.value = val
v.isSet = true
}
func (v NullableActionAmount) IsSet() bool {
return v.isSet
}
func (v *NullableActionAmount) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableActionAmount(val *ActionAmount) *NullableActionAmount {
return &NullableActionAmount{value: val, isSet: true}
}
func (v NullableActionAmount) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableActionAmount) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}