-
Notifications
You must be signed in to change notification settings - Fork 13
/
freeseatingconfiguration.go
64 lines (49 loc) · 1.87 KB
/
freeseatingconfiguration.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
package platformclientv2
import (
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Freeseatingconfiguration
type Freeseatingconfiguration struct {
// FreeSeatingState - The FreeSeatingState for FreeSeatingConfiguration. Can be ON, OFF, or PARTIAL. ON meaning disassociate the user after the ttl expires, OFF meaning never disassociate the user, and PARTIAL meaning only disassociate when a user explicitly clicks log out.
FreeSeatingState *string `json:"freeSeatingState,omitempty"`
// TtlMinutes - The amount of time in minutes until an offline user is disassociated from their station
TtlMinutes *int `json:"ttlMinutes,omitempty"`
}
func (o *Freeseatingconfiguration) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Freeseatingconfiguration
return json.Marshal(&struct {
FreeSeatingState *string `json:"freeSeatingState,omitempty"`
TtlMinutes *int `json:"ttlMinutes,omitempty"`
*Alias
}{
FreeSeatingState: o.FreeSeatingState,
TtlMinutes: o.TtlMinutes,
Alias: (*Alias)(o),
})
}
func (o *Freeseatingconfiguration) UnmarshalJSON(b []byte) error {
var FreeseatingconfigurationMap map[string]interface{}
err := json.Unmarshal(b, &FreeseatingconfigurationMap)
if err != nil {
return err
}
if FreeSeatingState, ok := FreeseatingconfigurationMap["freeSeatingState"].(string); ok {
o.FreeSeatingState = &FreeSeatingState
}
if TtlMinutes, ok := FreeseatingconfigurationMap["ttlMinutes"].(float64); ok {
TtlMinutesInt := int(TtlMinutes)
o.TtlMinutes = &TtlMinutesInt
}
return nil
}
// String returns a JSON representation of the model
func (o *Freeseatingconfiguration) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}