From 40590828e7ad89b896379cf87770186e0b5ad182 Mon Sep 17 00:00:00 2001 From: Andrew Starr-Bochicchio Date: Tue, 18 Jul 2023 16:39:19 -0400 Subject: [PATCH 1/2] account: add name field. (#620) --- account.go | 1 + account_test.go | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/account.go b/account.go index 48582c9e..7f619008 100644 --- a/account.go +++ b/account.go @@ -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"` diff --git a/account_test.go b/account_test.go index 934cddf3..8b31d7a6 100644 --- a/account_test.go +++ b/account_test.go @@ -21,6 +21,7 @@ func TestAccountGet(t *testing.T) { "reserved_ip_limit": 25, "volume_limit": 22, "email": "sammy@digitalocean.com", + "name": "Sammy the Shark", "uuid": "b6fr89dbf6d9156cace5f3c78dc9851d957381ef", "email_verified": true } @@ -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: "sammy@digitalocean.com", - UUID: "b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified: true, VolumeLimit: 22} + expected := &Account{ + DropletLimit: 25, + FloatingIPLimit: 25, + ReservedIPLimit: 25, + Email: "sammy@digitalocean.com", + 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) } @@ -48,6 +57,7 @@ func TestAccountString(t *testing.T) { ReservedIPLimit: 25, VolumeLimit: 22, Email: "sammy@digitalocean.com", + Name: "Sammy the Shark", UUID: "b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified: true, Status: "active", @@ -55,7 +65,7 @@ func TestAccountString(t *testing.T) { } stringified := acct.String() - expected := `godo.Account{DropletLimit:25, FloatingIPLimit:25, ReservedIPLimit:25, VolumeLimit:22, Email:"sammy@digitalocean.com", UUID:"b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified:true, Status:"active", StatusMessage:"message"}` + expected := `godo.Account{DropletLimit:25, FloatingIPLimit:25, ReservedIPLimit:25, VolumeLimit:22, Email:"sammy@digitalocean.com", Name:"Sammy the Shark", UUID:"b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified:true, Status:"active", StatusMessage:"message"}` if expected != stringified { t.Errorf("\n got %+v\nexpected %+v", stringified, expected) } @@ -75,6 +85,7 @@ func TestAccountGetWithTeam(t *testing.T) { "floating_ip_limit": 25, "volume_limit": 22, "email": "sammy@digitalocean.com", + "name": "Sammy the Shark", "uuid": "b6fr89dbf6d9156cace5f3c78dc9851d957381ef", "email_verified": true, "team": { @@ -96,6 +107,7 @@ func TestAccountGetWithTeam(t *testing.T) { DropletLimit: 25, FloatingIPLimit: 25, Email: "sammy@digitalocean.com", + Name: "Sammy the Shark", UUID: "b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified: true, VolumeLimit: 22, @@ -116,6 +128,7 @@ func TestAccountStringWithTeam(t *testing.T) { ReservedIPLimit: 25, VolumeLimit: 22, Email: "sammy@digitalocean.com", + Name: "Sammy the Shark", UUID: "b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified: true, Status: "active", @@ -127,7 +140,7 @@ func TestAccountStringWithTeam(t *testing.T) { } stringified := acct.String() - expected := `godo.Account{DropletLimit:25, FloatingIPLimit:25, ReservedIPLimit:25, VolumeLimit:22, Email:"sammy@digitalocean.com", 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:"sammy@digitalocean.com", 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) } From b3e4882c205efbd6debe7bfe2a70c5d2f342300b Mon Sep 17 00:00:00 2001 From: Aditya Saha Date: Thu, 20 Jul 2023 13:46:32 -0400 Subject: [PATCH 2/2] Prepare to release v1.100.0 (#622) * Prepare to release v2.0.0 * Only update minor version --- CHANGELOG.md | 5 +++++ godo.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c1849b2..fb90e99e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/godo.go b/godo.go index c48a5f78..b858f67e 100644 --- a/godo.go +++ b/godo.go @@ -21,7 +21,7 @@ import ( ) const ( - libraryVersion = "1.99.0" + libraryVersion = "1.100.0" defaultBaseURL = "https://api.digitalocean.com/" userAgent = "godo/" + libraryVersion mediaType = "application/json"