-
Notifications
You must be signed in to change notification settings - Fork 40
/
model_mastertargetserver.go
67 lines (57 loc) · 2.73 KB
/
model_mastertargetserver.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
package replicationfabrics
import (
"time"
"github.com/hashicorp/go-azure-helpers/lang/dates"
)
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
type MasterTargetServer struct {
AgentExpiryDate *string `json:"agentExpiryDate,omitempty"`
AgentVersion *string `json:"agentVersion,omitempty"`
AgentVersionDetails *VersionDetails `json:"agentVersionDetails,omitempty"`
DataStores *[]DataStore `json:"dataStores,omitempty"`
DiskCount *int64 `json:"diskCount,omitempty"`
HealthErrors *[]HealthError `json:"healthErrors,omitempty"`
IPAddress *string `json:"ipAddress,omitempty"`
Id *string `json:"id,omitempty"`
LastHeartbeat *string `json:"lastHeartbeat,omitempty"`
MarsAgentExpiryDate *string `json:"marsAgentExpiryDate,omitempty"`
MarsAgentVersion *string `json:"marsAgentVersion,omitempty"`
MarsAgentVersionDetails *VersionDetails `json:"marsAgentVersionDetails,omitempty"`
Name *string `json:"name,omitempty"`
OsType *string `json:"osType,omitempty"`
OsVersion *string `json:"osVersion,omitempty"`
RetentionVolumes *[]RetentionVolume `json:"retentionVolumes,omitempty"`
ValidationErrors *[]HealthError `json:"validationErrors,omitempty"`
VersionStatus *string `json:"versionStatus,omitempty"`
}
func (o *MasterTargetServer) GetAgentExpiryDateAsTime() (*time.Time, error) {
if o.AgentExpiryDate == nil {
return nil, nil
}
return dates.ParseAsFormat(o.AgentExpiryDate, "2006-01-02T15:04:05Z07:00")
}
func (o *MasterTargetServer) SetAgentExpiryDateAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.AgentExpiryDate = &formatted
}
func (o *MasterTargetServer) GetLastHeartbeatAsTime() (*time.Time, error) {
if o.LastHeartbeat == nil {
return nil, nil
}
return dates.ParseAsFormat(o.LastHeartbeat, "2006-01-02T15:04:05Z07:00")
}
func (o *MasterTargetServer) SetLastHeartbeatAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.LastHeartbeat = &formatted
}
func (o *MasterTargetServer) GetMarsAgentExpiryDateAsTime() (*time.Time, error) {
if o.MarsAgentExpiryDate == nil {
return nil, nil
}
return dates.ParseAsFormat(o.MarsAgentExpiryDate, "2006-01-02T15:04:05Z07:00")
}
func (o *MasterTargetServer) SetMarsAgentExpiryDateAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.MarsAgentExpiryDate = &formatted
}