-
Notifications
You must be signed in to change notification settings - Fork 2
/
accounts.go
75 lines (70 loc) · 3.35 KB
/
accounts.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
package brightbox
import (
"time"
"github.com/brightbox/gobrightbox/v2/enums/accountstatus"
)
//go:generate ./generate_enum accountstatus pending active overdue warning suspended terminated closed deleted
// Account represents a Brightbox Cloud Account
// https://api.gb1.brightbox.com/1.0/#account
type Account struct {
ResourceRef
ID string
Name string
Status accountstatus.Enum `json:"status"`
Address1 string `json:"address_1"`
Address2 string `json:"address_2"`
City string
County string
Postcode string
CountryCode string `json:"country_code"`
CountryName string `json:"country_name"`
VatRegistrationNumber string `json:"vat_registration_number"`
TelephoneNumber string `json:"telephone_number"`
TelephoneVerified bool `json:"telephone_verified"`
VerifiedTelephone string `json:"verified_telephone"`
VerifiedIP string `json:"verified_ip"`
ValidCreditCard bool `json:"valid_credit_card"`
ServersUsed uint `json:"servers_used"`
RAMLimit uint `json:"ram_limit"`
RAMUsed uint `json:"ram_used"`
DbsInstancesUsed uint `json:"dbs_instances_used"`
DbsRAMLimit uint `json:"dbs_ram_limit"`
DbsRAMUsed uint `json:"dbs_ram_used"`
BlockStorageLimit uint `json:"block_storage_limit"`
BlockStorageUsed uint `json:"block_storage_used"`
CloudIPsLimit uint `json:"cloud_ips_limit"`
CloudIPsUsed uint `json:"cloud_ips_used"`
LoadBalancersLimit uint `json:"load_balancers_limit"`
LoadBalancersUsed uint `json:"load_balancers_used"`
LibraryFtpHost string `json:"library_ftp_host"`
LibraryFtpUser string `json:"library_ftp_user"`
LibraryFtpPassword string `json:"library_ftp_password"`
CreatedAt *time.Time `json:"created_at"`
VerifiedAt *time.Time `json:"verified_at"`
Owner *User
Clients []APIClient
Images []Image
Servers []Server
LoadBalancers []LoadBalancer `json:"load_balancers"`
DatabaseServers []DatabaseServer `json:"database_servers"`
DatabaseSnapshots []DatabaseSnapshot `json:"database_snapshots"`
CloudIPs []CloudIP `json:"cloud_ips"`
ServerGroups []ServerGroup `json:"server_groups"`
FirewallPolicies []FirewallPolicy `json:"firewall_policies"`
Users []User
Volumes []Volume
Zones []Zone
}
// AccountOptions is used to update objects
type AccountOptions struct {
ID string `json:"-"`
Name *string `json:"name,omitempty"`
Address1 *string `json:"address_1,omitempty"`
Address2 *string `json:"address_2,omitempty"`
City *string `json:"city,omitempty"`
County *string `json:"county,omitempty"`
Postcode *string `json:"postcode,omitempty"`
CountryCode *string `json:"country_code,omitempty"`
VatRegistrationNumber *string `json:"vat_registration_number,omitempty"`
TelephoneNumber *string `json:"telephone_number,omitempty"`
}