-
Notifications
You must be signed in to change notification settings - Fork 13
/
buagentschedulehistoryresponse.go
91 lines (66 loc) · 3.06 KB
/
buagentschedulehistoryresponse.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
package platformclientv2
import (
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Buagentschedulehistoryresponse
type Buagentschedulehistoryresponse struct {
// PriorPublishedSchedules - The list of previously published schedules
PriorPublishedSchedules *[]Buschedulereference `json:"priorPublishedSchedules,omitempty"`
// BasePublishedSchedule - The originally published agent schedules
BasePublishedSchedule *Buagentschedulehistorychange `json:"basePublishedSchedule,omitempty"`
// DroppedChanges - The changes dropped from the schedule history. This will happen if the schedule history is too large
DroppedChanges *[]Buagentschedulehistorydroppedchange `json:"droppedChanges,omitempty"`
// Changes - The list of changes for the schedule history
Changes *[]Buagentschedulehistorychange `json:"changes,omitempty"`
}
func (o *Buagentschedulehistoryresponse) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Buagentschedulehistoryresponse
return json.Marshal(&struct {
PriorPublishedSchedules *[]Buschedulereference `json:"priorPublishedSchedules,omitempty"`
BasePublishedSchedule *Buagentschedulehistorychange `json:"basePublishedSchedule,omitempty"`
DroppedChanges *[]Buagentschedulehistorydroppedchange `json:"droppedChanges,omitempty"`
Changes *[]Buagentschedulehistorychange `json:"changes,omitempty"`
*Alias
}{
PriorPublishedSchedules: o.PriorPublishedSchedules,
BasePublishedSchedule: o.BasePublishedSchedule,
DroppedChanges: o.DroppedChanges,
Changes: o.Changes,
Alias: (*Alias)(o),
})
}
func (o *Buagentschedulehistoryresponse) UnmarshalJSON(b []byte) error {
var BuagentschedulehistoryresponseMap map[string]interface{}
err := json.Unmarshal(b, &BuagentschedulehistoryresponseMap)
if err != nil {
return err
}
if PriorPublishedSchedules, ok := BuagentschedulehistoryresponseMap["priorPublishedSchedules"].([]interface{}); ok {
PriorPublishedSchedulesString, _ := json.Marshal(PriorPublishedSchedules)
json.Unmarshal(PriorPublishedSchedulesString, &o.PriorPublishedSchedules)
}
if BasePublishedSchedule, ok := BuagentschedulehistoryresponseMap["basePublishedSchedule"].(map[string]interface{}); ok {
BasePublishedScheduleString, _ := json.Marshal(BasePublishedSchedule)
json.Unmarshal(BasePublishedScheduleString, &o.BasePublishedSchedule)
}
if DroppedChanges, ok := BuagentschedulehistoryresponseMap["droppedChanges"].([]interface{}); ok {
DroppedChangesString, _ := json.Marshal(DroppedChanges)
json.Unmarshal(DroppedChangesString, &o.DroppedChanges)
}
if Changes, ok := BuagentschedulehistoryresponseMap["changes"].([]interface{}); ok {
ChangesString, _ := json.Marshal(Changes)
json.Unmarshal(ChangesString, &o.Changes)
}
return nil
}
// String returns a JSON representation of the model
func (o *Buagentschedulehistoryresponse) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}