Skip to content

Commit 400777a

Browse files
Added missing account struct fields and added unit tests (#612)
1 parent 86d1af4 commit 400777a

31 files changed

+891
-467
lines changed

account.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ type Account struct {
2929
BillingSource string `json:"billing_source"`
3030
Capabilities []string `json:"capabilities"`
3131
ActiveSince *time.Time `json:"active_since"`
32+
ActivePromotions []Promotion `json:"active_promotions"`
3233
}
3334

3435
// AccountUpdateOptions fields are those accepted by UpdateAccount

account_events.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ type Event struct {
4646

4747
// When this Event was created.
4848
Created *time.Time `json:"-"`
49+
50+
// Provides additional information about the event.
51+
Message string `json:"message"`
52+
53+
// The total duration in seconds that it takes for the Event to complete.
54+
Duration float64 `json:"duration"`
4955
}
5056

5157
// EventAction constants start with Action and include all known Linode API Event Actions.

account_invoices.go

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,33 @@ import (
1010

1111
// Invoice structs reflect an invoice for billable activity on the account.
1212
type Invoice struct {
13-
ID int `json:"id"`
14-
Label string `json:"label"`
15-
Total float32 `json:"total"`
16-
Date *time.Time `json:"-"`
13+
ID int `json:"id"`
14+
Label string `json:"label"`
15+
Total float32 `json:"total"`
16+
Date *time.Time `json:"-"`
17+
Tax float32 `json:"tax"`
18+
Subtotal float32 `json:"subtotal"`
19+
BillingSource string `json:"billing_source"`
20+
TaxSummary []InvoiceTaxSummary `json:"tax_summary"`
21+
}
22+
23+
type InvoiceTaxSummary struct {
24+
Tax float32 `json:"tax"`
25+
Name string `json:"name"`
1726
}
1827

1928
// InvoiceItem structs reflect a single billable activity associate with an Invoice
2029
type InvoiceItem struct {
2130
Label string `json:"label"`
2231
Type string `json:"type"`
23-
UnitPrice int `json:"unitprice"`
32+
UnitPrice float32 `json:"unit_price"`
2433
Quantity int `json:"quantity"`
2534
Amount float32 `json:"amount"`
2635
Tax float32 `json:"tax"`
2736
Region *string `json:"region"`
2837
From *time.Time `json:"-"`
2938
To *time.Time `json:"-"`
39+
Total float32 `json:"total"`
3040
}
3141

3242
// ListInvoices gets a paginated list of Invoices against the Account

profile.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,19 @@ type ProfileReferrals struct {
2626

2727
// Profile represents a Profile object
2828
type Profile struct {
29-
UID int `json:"uid"`
30-
Username string `json:"username"`
31-
Email string `json:"email"`
32-
Timezone string `json:"timezone"`
33-
EmailNotifications bool `json:"email_notifications"`
34-
IPWhitelistEnabled bool `json:"ip_whitelist_enabled"`
35-
TwoFactorAuth bool `json:"two_factor_auth"`
36-
Restricted bool `json:"restricted"`
37-
LishAuthMethod LishAuthMethod `json:"lish_auth_method"`
38-
Referrals ProfileReferrals `json:"referrals"`
39-
AuthorizedKeys []string `json:"authorized_keys"`
29+
UID int `json:"uid"`
30+
Username string `json:"username"`
31+
Email string `json:"email"`
32+
Timezone string `json:"timezone"`
33+
EmailNotifications bool `json:"email_notifications"`
34+
IPWhitelistEnabled bool `json:"ip_whitelist_enabled"`
35+
TwoFactorAuth bool `json:"two_factor_auth"`
36+
Restricted bool `json:"restricted"`
37+
LishAuthMethod LishAuthMethod `json:"lish_auth_method"`
38+
Referrals ProfileReferrals `json:"referrals"`
39+
AuthorizedKeys []string `json:"authorized_keys"`
40+
AuthenticationType string `json:"authentication_type"`
41+
VerifiedPhoneNumber string `json:"verified_phone_number,omitempty"`
4042
}
4143

4244
// ProfileUpdateOptions fields are those accepted by UpdateProfile

support.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type Ticket struct {
1919
Summary string `json:"summary"`
2020
Updated *time.Time `json:"-"`
2121
UpdatedBy string `json:"updated_by"`
22+
Closeable bool `json:"closeable"`
2223
}
2324

2425
// TicketEntity refers a ticket to a specific entity

test/integration/account_invoice_test.go

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)