-
Notifications
You must be signed in to change notification settings - Fork 37
/
model_subscriptioncontractproperties.go
86 lines (72 loc) · 2.97 KB
/
model_subscriptioncontractproperties.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
package usersubscription
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 SubscriptionContractProperties struct {
AllowTracing *bool `json:"allowTracing,omitempty"`
CreatedDate *string `json:"createdDate,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
EndDate *string `json:"endDate,omitempty"`
ExpirationDate *string `json:"expirationDate,omitempty"`
NotificationDate *string `json:"notificationDate,omitempty"`
OwnerId *string `json:"ownerId,omitempty"`
PrimaryKey *string `json:"primaryKey,omitempty"`
Scope string `json:"scope"`
SecondaryKey *string `json:"secondaryKey,omitempty"`
StartDate *string `json:"startDate,omitempty"`
State SubscriptionState `json:"state"`
StateComment *string `json:"stateComment,omitempty"`
}
func (o *SubscriptionContractProperties) GetCreatedDateAsTime() (*time.Time, error) {
if o.CreatedDate == nil {
return nil, nil
}
return dates.ParseAsFormat(o.CreatedDate, "2006-01-02T15:04:05Z07:00")
}
func (o *SubscriptionContractProperties) SetCreatedDateAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.CreatedDate = &formatted
}
func (o *SubscriptionContractProperties) GetEndDateAsTime() (*time.Time, error) {
if o.EndDate == nil {
return nil, nil
}
return dates.ParseAsFormat(o.EndDate, "2006-01-02T15:04:05Z07:00")
}
func (o *SubscriptionContractProperties) SetEndDateAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.EndDate = &formatted
}
func (o *SubscriptionContractProperties) GetExpirationDateAsTime() (*time.Time, error) {
if o.ExpirationDate == nil {
return nil, nil
}
return dates.ParseAsFormat(o.ExpirationDate, "2006-01-02T15:04:05Z07:00")
}
func (o *SubscriptionContractProperties) SetExpirationDateAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.ExpirationDate = &formatted
}
func (o *SubscriptionContractProperties) GetNotificationDateAsTime() (*time.Time, error) {
if o.NotificationDate == nil {
return nil, nil
}
return dates.ParseAsFormat(o.NotificationDate, "2006-01-02T15:04:05Z07:00")
}
func (o *SubscriptionContractProperties) SetNotificationDateAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.NotificationDate = &formatted
}
func (o *SubscriptionContractProperties) GetStartDateAsTime() (*time.Time, error) {
if o.StartDate == nil {
return nil, nil
}
return dates.ParseAsFormat(o.StartDate, "2006-01-02T15:04:05Z07:00")
}
func (o *SubscriptionContractProperties) SetStartDateAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.StartDate = &formatted
}