-
Notifications
You must be signed in to change notification settings - Fork 37
/
model_legacyusagedetailproperties.go
95 lines (85 loc) · 4.96 KB
/
model_legacyusagedetailproperties.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
92
93
94
95
package usagedetails
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 LegacyUsageDetailProperties struct {
AccountName *string `json:"accountName,omitempty"`
AccountOwnerId *string `json:"accountOwnerId,omitempty"`
AdditionalInfo *string `json:"additionalInfo,omitempty"`
BenefitId *string `json:"benefitId,omitempty"`
BenefitName *string `json:"benefitName,omitempty"`
BillingAccountId *string `json:"billingAccountId,omitempty"`
BillingAccountName *string `json:"billingAccountName,omitempty"`
BillingCurrency *string `json:"billingCurrency,omitempty"`
BillingPeriodEndDate *string `json:"billingPeriodEndDate,omitempty"`
BillingPeriodStartDate *string `json:"billingPeriodStartDate,omitempty"`
BillingProfileId *string `json:"billingProfileId,omitempty"`
BillingProfileName *string `json:"billingProfileName,omitempty"`
ChargeType *string `json:"chargeType,omitempty"`
ConsumedService *string `json:"consumedService,omitempty"`
Cost *float64 `json:"cost,omitempty"`
CostCenter *string `json:"costCenter,omitempty"`
Date *string `json:"date,omitempty"`
EffectivePrice *float64 `json:"effectivePrice,omitempty"`
Frequency *string `json:"frequency,omitempty"`
InvoiceSection *string `json:"invoiceSection,omitempty"`
IsAzureCreditEligible *bool `json:"isAzureCreditEligible,omitempty"`
MeterDetails *MeterDetailsResponse `json:"meterDetails,omitempty"`
MeterId *string `json:"meterId,omitempty"`
OfferId *string `json:"offerId,omitempty"`
PartNumber *string `json:"partNumber,omitempty"`
PayGPrice *float64 `json:"payGPrice,omitempty"`
PlanName *string `json:"planName,omitempty"`
PricingModel *PricingModelType `json:"pricingModel,omitempty"`
Product *string `json:"product,omitempty"`
ProductOrderId *string `json:"productOrderId,omitempty"`
ProductOrderName *string `json:"productOrderName,omitempty"`
PublisherName *string `json:"publisherName,omitempty"`
PublisherType *string `json:"publisherType,omitempty"`
Quantity *float64 `json:"quantity,omitempty"`
ReservationId *string `json:"reservationId,omitempty"`
ReservationName *string `json:"reservationName,omitempty"`
ResourceGroup *string `json:"resourceGroup,omitempty"`
ResourceId *string `json:"resourceId,omitempty"`
ResourceLocation *string `json:"resourceLocation,omitempty"`
ResourceName *string `json:"resourceName,omitempty"`
ServiceInfo1 *string `json:"serviceInfo1,omitempty"`
ServiceInfo2 *string `json:"serviceInfo2,omitempty"`
SubscriptionId *string `json:"subscriptionId,omitempty"`
SubscriptionName *string `json:"subscriptionName,omitempty"`
Term *string `json:"term,omitempty"`
UnitPrice *float64 `json:"unitPrice,omitempty"`
}
func (o *LegacyUsageDetailProperties) GetBillingPeriodEndDateAsTime() (*time.Time, error) {
if o.BillingPeriodEndDate == nil {
return nil, nil
}
return dates.ParseAsFormat(o.BillingPeriodEndDate, "2006-01-02T15:04:05Z07:00")
}
func (o *LegacyUsageDetailProperties) SetBillingPeriodEndDateAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.BillingPeriodEndDate = &formatted
}
func (o *LegacyUsageDetailProperties) GetBillingPeriodStartDateAsTime() (*time.Time, error) {
if o.BillingPeriodStartDate == nil {
return nil, nil
}
return dates.ParseAsFormat(o.BillingPeriodStartDate, "2006-01-02T15:04:05Z07:00")
}
func (o *LegacyUsageDetailProperties) SetBillingPeriodStartDateAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.BillingPeriodStartDate = &formatted
}
func (o *LegacyUsageDetailProperties) GetDateAsTime() (*time.Time, error) {
if o.Date == nil {
return nil, nil
}
return dates.ParseAsFormat(o.Date, "2006-01-02T15:04:05Z07:00")
}
func (o *LegacyUsageDetailProperties) SetDateAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.Date = &formatted
}