Skip to content

Commit

Permalink
Merge branch 'main' into godo_retryablehttp
Browse files Browse the repository at this point in the history
  • Loading branch information
danaelhe authored Jul 21, 2023
2 parents 6778bc0 + b3e4882 commit 0bef781
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## [v1.100.0] - 2023-07-20

- #618 - @asaha - load balancers: introduce new type field
- #620 - @andrewsomething - account: add name field.

## [v1.99.0] - 2023-04-24

- #616 - @bentranter - Bump CI version for Go 1.20
Expand Down
1 change: 1 addition & 0 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type Account struct {
ReservedIPLimit int `json:"reserved_ip_limit,omitempty"`
VolumeLimit int `json:"volume_limit,omitempty"`
Email string `json:"email,omitempty"`
Name string `json:"name,omitempty"`
UUID string `json:"uuid,omitempty"`
EmailVerified bool `json:"email_verified,omitempty"`
Status string `json:"status,omitempty"`
Expand Down
21 changes: 17 additions & 4 deletions account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func TestAccountGet(t *testing.T) {
"reserved_ip_limit": 25,
"volume_limit": 22,
"email": "[email protected]",
"name": "Sammy the Shark",
"uuid": "b6fr89dbf6d9156cace5f3c78dc9851d957381ef",
"email_verified": true
}
Expand All @@ -34,8 +35,16 @@ func TestAccountGet(t *testing.T) {
t.Errorf("Account.Get returned error: %v", err)
}

expected := &Account{DropletLimit: 25, FloatingIPLimit: 25, ReservedIPLimit: 25, Email: "[email protected]",
UUID: "b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified: true, VolumeLimit: 22}
expected := &Account{
DropletLimit: 25,
FloatingIPLimit: 25,
ReservedIPLimit: 25,
Email: "[email protected]",
Name: "Sammy the Shark",
UUID: "b6fr89dbf6d9156cace5f3c78dc9851d957381ef",
EmailVerified: true,
VolumeLimit: 22,
}
if !reflect.DeepEqual(acct, expected) {
t.Errorf("Account.Get returned %+v, expected %+v", acct, expected)
}
Expand All @@ -48,14 +57,15 @@ func TestAccountString(t *testing.T) {
ReservedIPLimit: 25,
VolumeLimit: 22,
Email: "[email protected]",
Name: "Sammy the Shark",
UUID: "b6fr89dbf6d9156cace5f3c78dc9851d957381ef",
EmailVerified: true,
Status: "active",
StatusMessage: "message",
}

stringified := acct.String()
expected := `godo.Account{DropletLimit:25, FloatingIPLimit:25, ReservedIPLimit:25, VolumeLimit:22, Email:"[email protected]", UUID:"b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified:true, Status:"active", StatusMessage:"message"}`
expected := `godo.Account{DropletLimit:25, FloatingIPLimit:25, ReservedIPLimit:25, VolumeLimit:22, Email:"[email protected]", Name:"Sammy the Shark", UUID:"b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified:true, Status:"active", StatusMessage:"message"}`
if expected != stringified {
t.Errorf("\n got %+v\nexpected %+v", stringified, expected)
}
Expand All @@ -75,6 +85,7 @@ func TestAccountGetWithTeam(t *testing.T) {
"floating_ip_limit": 25,
"volume_limit": 22,
"email": "[email protected]",
"name": "Sammy the Shark",
"uuid": "b6fr89dbf6d9156cace5f3c78dc9851d957381ef",
"email_verified": true,
"team": {
Expand All @@ -96,6 +107,7 @@ func TestAccountGetWithTeam(t *testing.T) {
DropletLimit: 25,
FloatingIPLimit: 25,
Email: "[email protected]",
Name: "Sammy the Shark",
UUID: "b6fr89dbf6d9156cace5f3c78dc9851d957381ef",
EmailVerified: true,
VolumeLimit: 22,
Expand All @@ -116,6 +128,7 @@ func TestAccountStringWithTeam(t *testing.T) {
ReservedIPLimit: 25,
VolumeLimit: 22,
Email: "[email protected]",
Name: "Sammy the Shark",
UUID: "b6fr89dbf6d9156cace5f3c78dc9851d957381ef",
EmailVerified: true,
Status: "active",
Expand All @@ -127,7 +140,7 @@ func TestAccountStringWithTeam(t *testing.T) {
}

stringified := acct.String()
expected := `godo.Account{DropletLimit:25, FloatingIPLimit:25, ReservedIPLimit:25, VolumeLimit:22, Email:"[email protected]", UUID:"b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified:true, Status:"active", StatusMessage:"message", Team:godo.TeamInfo{Name:"My Team", UUID:"b6fr89dbf6d9156cace5f3c78dc9851d957381ef"}}`
expected := `godo.Account{DropletLimit:25, FloatingIPLimit:25, ReservedIPLimit:25, VolumeLimit:22, Email:"[email protected]", Name:"Sammy the Shark", UUID:"b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified:true, Status:"active", StatusMessage:"message", Team:godo.TeamInfo{Name:"My Team", UUID:"b6fr89dbf6d9156cace5f3c78dc9851d957381ef"}}`
if expected != stringified {
t.Errorf("\n got %+v\nexpected %+v", stringified, expected)
}
Expand Down
2 changes: 1 addition & 1 deletion godo.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
)

const (
libraryVersion = "1.99.0"
libraryVersion = "1.100.0"
defaultBaseURL = "https://api.digitalocean.com/"
userAgent = "godo/" + libraryVersion
mediaType = "application/json"
Expand Down

0 comments on commit 0bef781

Please sign in to comment.