-
Notifications
You must be signed in to change notification settings - Fork 46
/
model_incidentproperties.go
78 lines (66 loc) · 3.22 KB
/
model_incidentproperties.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
package incidents
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 IncidentProperties struct {
AdditionalData *IncidentAdditionalData `json:"additionalData,omitempty"`
Classification *IncidentClassification `json:"classification,omitempty"`
ClassificationComment *string `json:"classificationComment,omitempty"`
ClassificationReason *IncidentClassificationReason `json:"classificationReason,omitempty"`
CreatedTimeUtc *string `json:"createdTimeUtc,omitempty"`
Description *string `json:"description,omitempty"`
FirstActivityTimeUtc *string `json:"firstActivityTimeUtc,omitempty"`
IncidentNumber *int64 `json:"incidentNumber,omitempty"`
IncidentUrl *string `json:"incidentUrl,omitempty"`
Labels *[]IncidentLabel `json:"labels,omitempty"`
LastActivityTimeUtc *string `json:"lastActivityTimeUtc,omitempty"`
LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"`
Owner *IncidentOwnerInfo `json:"owner,omitempty"`
RelatedAnalyticRuleIds *[]string `json:"relatedAnalyticRuleIds,omitempty"`
Severity IncidentSeverity `json:"severity"`
Status IncidentStatus `json:"status"`
Title string `json:"title"`
}
func (o *IncidentProperties) GetCreatedTimeUtcAsTime() (*time.Time, error) {
if o.CreatedTimeUtc == nil {
return nil, nil
}
return dates.ParseAsFormat(o.CreatedTimeUtc, "2006-01-02T15:04:05Z07:00")
}
func (o *IncidentProperties) SetCreatedTimeUtcAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.CreatedTimeUtc = &formatted
}
func (o *IncidentProperties) GetFirstActivityTimeUtcAsTime() (*time.Time, error) {
if o.FirstActivityTimeUtc == nil {
return nil, nil
}
return dates.ParseAsFormat(o.FirstActivityTimeUtc, "2006-01-02T15:04:05Z07:00")
}
func (o *IncidentProperties) SetFirstActivityTimeUtcAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.FirstActivityTimeUtc = &formatted
}
func (o *IncidentProperties) GetLastActivityTimeUtcAsTime() (*time.Time, error) {
if o.LastActivityTimeUtc == nil {
return nil, nil
}
return dates.ParseAsFormat(o.LastActivityTimeUtc, "2006-01-02T15:04:05Z07:00")
}
func (o *IncidentProperties) SetLastActivityTimeUtcAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.LastActivityTimeUtc = &formatted
}
func (o *IncidentProperties) GetLastModifiedTimeUtcAsTime() (*time.Time, error) {
if o.LastModifiedTimeUtc == nil {
return nil, nil
}
return dates.ParseAsFormat(o.LastModifiedTimeUtc, "2006-01-02T15:04:05Z07:00")
}
func (o *IncidentProperties) SetLastModifiedTimeUtcAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.LastModifiedTimeUtc = &formatted
}