diff --git a/droplets_test.go b/droplets_test.go index 3bbef9e4..464b9bd6 100644 --- a/droplets_test.go +++ b/droplets_test.go @@ -363,7 +363,7 @@ func TestDroplet_String(t *testing.T) { } stringified := droplet.String() - expected := `godo.Droplet{ID:1, Name:"droplet", Memory:123, Vcpus:456, Disk:789, Region:godo.Region{Slug:"region", Name:"Region", Sizes:["1" "2"], Available:true}, Image:godo.Image{ID:1, Name:"Image", Type:"snapshot", Distribution:"Ubuntu", Slug:"image", Public:true, Regions:["one" "two"], MinDiskSize:20}, Size:godo.Size{Slug:"size", Memory:0, Vcpus:0, Disk:0, PriceMonthly:123, PriceHourly:456, Regions:["1" "2"]}, BackupIDs:[1], SnapshotIDs:[1], Locked:false, Status:"active", Networks:godo.Networks{V4:[godo.NetworkV4{IPAddress:"192.168.1.2", Netmask:"255.255.255.0", Gateway:"192.168.1.1", Type:""}]}, ActionIDs:[1], Created:""}` + expected := `godo.Droplet{ID:1, Name:"droplet", Memory:123, Vcpus:456, Disk:789, Region:godo.Region{Slug:"region", Name:"Region", Sizes:["1" "2"], Available:true}, Image:godo.Image{ID:1, Name:"Image", Type:"snapshot", Distribution:"Ubuntu", Slug:"image", Public:true, Regions:["one" "two"], MinDiskSize:20}, Size:godo.Size{Slug:"size", Memory:0, Vcpus:0, Disk:0, PriceMonthly:123, PriceHourly:456, Regions:["1" "2"], Available:false, Transfer:0}, BackupIDs:[1], SnapshotIDs:[1], Locked:false, Status:"active", Networks:godo.Networks{V4:[godo.NetworkV4{IPAddress:"192.168.1.2", Netmask:"255.255.255.0", Gateway:"192.168.1.1", Type:""}]}, ActionIDs:[1], Created:""}` if expected != stringified { t.Errorf("Droplet.String returned %+v, expected %+v", stringified, expected) } diff --git a/sizes.go b/sizes.go index d9bbd7d6..56812e26 100644 --- a/sizes.go +++ b/sizes.go @@ -24,6 +24,8 @@ type Size struct { PriceMonthly float64 `json:"price_monthly,omitempty"` PriceHourly float64 `json:"price_hourly,omitempty"` Regions []string `json:"regions,omitempty"` + Available bool `json:"available,omitempty"` + Transfer float64 `json:"transfer,omitempty"` } func (s Size) String() string { diff --git a/sizes_test.go b/sizes_test.go index 55312bf9..390ddf4d 100644 --- a/sizes_test.go +++ b/sizes_test.go @@ -84,10 +84,12 @@ func TestSize_String(t *testing.T) { PriceMonthly: 123, PriceHourly: 456, Regions: []string{"1", "2"}, + Available: true, + Transfer: 789, } stringified := size.String() - expected := `godo.Size{Slug:"slize", Memory:123, Vcpus:456, Disk:789, PriceMonthly:123, PriceHourly:456, Regions:["1" "2"]}` + expected := `godo.Size{Slug:"slize", Memory:123, Vcpus:456, Disk:789, PriceMonthly:123, PriceHourly:456, Regions:["1" "2"], Available:true, Transfer:789}` if expected != stringified { t.Errorf("Size.String returned %+v, expected %+v", stringified, expected) }