-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_penalty_settings.go
More file actions
234 lines (193 loc) · 6.54 KB
/
Copy pathmodel_penalty_settings.go
File metadata and controls
234 lines (193 loc) · 6.54 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
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
/*
Codio API
Documentation APIs v1.0
API version: 1.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package codioapi
import (
"encoding/json"
)
// checks if the PenaltySettings type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PenaltySettings{}
// PenaltySettings struct for PenaltySettings
type PenaltySettings struct {
Enabled *bool `json:"enabled,omitempty"`
DeductionIntervalMinutes *int32 `json:"deductionIntervalMinutes,omitempty"`
DeductionPercent *int32 `json:"deductionPercent,omitempty"`
LowestGradePercent *int32 `json:"lowestGradePercent,omitempty"`
}
// NewPenaltySettings instantiates a new PenaltySettings 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 NewPenaltySettings() *PenaltySettings {
this := PenaltySettings{}
return &this
}
// NewPenaltySettingsWithDefaults instantiates a new PenaltySettings 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 NewPenaltySettingsWithDefaults() *PenaltySettings {
this := PenaltySettings{}
return &this
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *PenaltySettings) GetEnabled() bool {
if o == nil || IsNil(o.Enabled) {
var ret bool
return ret
}
return *o.Enabled
}
// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PenaltySettings) GetEnabledOk() (*bool, bool) {
if o == nil || IsNil(o.Enabled) {
return nil, false
}
return o.Enabled, true
}
// HasEnabled returns a boolean if a field has been set.
func (o *PenaltySettings) HasEnabled() bool {
if o != nil && !IsNil(o.Enabled) {
return true
}
return false
}
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
func (o *PenaltySettings) SetEnabled(v bool) {
o.Enabled = &v
}
// GetDeductionIntervalMinutes returns the DeductionIntervalMinutes field value if set, zero value otherwise.
func (o *PenaltySettings) GetDeductionIntervalMinutes() int32 {
if o == nil || IsNil(o.DeductionIntervalMinutes) {
var ret int32
return ret
}
return *o.DeductionIntervalMinutes
}
// GetDeductionIntervalMinutesOk returns a tuple with the DeductionIntervalMinutes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PenaltySettings) GetDeductionIntervalMinutesOk() (*int32, bool) {
if o == nil || IsNil(o.DeductionIntervalMinutes) {
return nil, false
}
return o.DeductionIntervalMinutes, true
}
// HasDeductionIntervalMinutes returns a boolean if a field has been set.
func (o *PenaltySettings) HasDeductionIntervalMinutes() bool {
if o != nil && !IsNil(o.DeductionIntervalMinutes) {
return true
}
return false
}
// SetDeductionIntervalMinutes gets a reference to the given int32 and assigns it to the DeductionIntervalMinutes field.
func (o *PenaltySettings) SetDeductionIntervalMinutes(v int32) {
o.DeductionIntervalMinutes = &v
}
// GetDeductionPercent returns the DeductionPercent field value if set, zero value otherwise.
func (o *PenaltySettings) GetDeductionPercent() int32 {
if o == nil || IsNil(o.DeductionPercent) {
var ret int32
return ret
}
return *o.DeductionPercent
}
// GetDeductionPercentOk returns a tuple with the DeductionPercent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PenaltySettings) GetDeductionPercentOk() (*int32, bool) {
if o == nil || IsNil(o.DeductionPercent) {
return nil, false
}
return o.DeductionPercent, true
}
// HasDeductionPercent returns a boolean if a field has been set.
func (o *PenaltySettings) HasDeductionPercent() bool {
if o != nil && !IsNil(o.DeductionPercent) {
return true
}
return false
}
// SetDeductionPercent gets a reference to the given int32 and assigns it to the DeductionPercent field.
func (o *PenaltySettings) SetDeductionPercent(v int32) {
o.DeductionPercent = &v
}
// GetLowestGradePercent returns the LowestGradePercent field value if set, zero value otherwise.
func (o *PenaltySettings) GetLowestGradePercent() int32 {
if o == nil || IsNil(o.LowestGradePercent) {
var ret int32
return ret
}
return *o.LowestGradePercent
}
// GetLowestGradePercentOk returns a tuple with the LowestGradePercent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PenaltySettings) GetLowestGradePercentOk() (*int32, bool) {
if o == nil || IsNil(o.LowestGradePercent) {
return nil, false
}
return o.LowestGradePercent, true
}
// HasLowestGradePercent returns a boolean if a field has been set.
func (o *PenaltySettings) HasLowestGradePercent() bool {
if o != nil && !IsNil(o.LowestGradePercent) {
return true
}
return false
}
// SetLowestGradePercent gets a reference to the given int32 and assigns it to the LowestGradePercent field.
func (o *PenaltySettings) SetLowestGradePercent(v int32) {
o.LowestGradePercent = &v
}
func (o PenaltySettings) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PenaltySettings) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Enabled) {
toSerialize["enabled"] = o.Enabled
}
if !IsNil(o.DeductionIntervalMinutes) {
toSerialize["deductionIntervalMinutes"] = o.DeductionIntervalMinutes
}
if !IsNil(o.DeductionPercent) {
toSerialize["deductionPercent"] = o.DeductionPercent
}
if !IsNil(o.LowestGradePercent) {
toSerialize["lowestGradePercent"] = o.LowestGradePercent
}
return toSerialize, nil
}
type NullablePenaltySettings struct {
value *PenaltySettings
isSet bool
}
func (v NullablePenaltySettings) Get() *PenaltySettings {
return v.value
}
func (v *NullablePenaltySettings) Set(val *PenaltySettings) {
v.value = val
v.isSet = true
}
func (v NullablePenaltySettings) IsSet() bool {
return v.isSet
}
func (v *NullablePenaltySettings) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePenaltySettings(val *PenaltySettings) *NullablePenaltySettings {
return &NullablePenaltySettings{value: val, isSet: true}
}
func (v NullablePenaltySettings) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePenaltySettings) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}