Repository: hetznercloud/hcloud-go (go)

Issue:
Change price_per_gb in pricing API
It will be renamed to `price_per_tb` shortly.

Pull request description:
Traffic is billed per-TB
Closes #57.

Patch:
diff --git a/hcloud/pricing.go b/hcloud/pricing.go
index 3bf7ec4..f2849a6 100644
--- a/hcloud/pricing.go
+++ b/hcloud/pricing.go
@@ -37,7 +37,7 @@ type FloatingIPPricing struct {
 
 // TrafficPricing provides pricing information for traffic.
 type TrafficPricing struct {
-	PerGB Price
+	PerTB Price
 }
 
 // ServerBackupPricing provides pricing information for server backups.
diff --git a/hcloud/schema.go b/hcloud/schema.go
index 69dbf75..90f9bd4 100644
--- a/hcloud/schema.go
+++ b/hcloud/schema.go
@@ -298,11 +298,11 @@ func PricingFromSchema(s schema.Pricing) Pricing {
 			},
 		},
 		Traffic: TrafficPricing{
-			PerGB: Price{
+			PerTB: Price{
 				Currency: s.Currency,
 				VATRate:  s.VATRate,
-				Net:      s.Traffic.PricePerGB.Net,
-				Gross:    s.Traffic.PricePerGB.Gross,
+				Net:      s.Traffic.PricePerTB.Net,
+				Gross:    s.Traffic.PricePerTB.Gross,
 			},
 		},
 		ServerBackup: ServerBackupPricing{
diff --git a/hcloud/schema/pricing.go b/hcloud/schema/pricing.go
index 4bf9e07..05c2808 100644
--- a/hcloud/schema/pricing.go
+++ b/hcloud/schema/pricing.go
@@ -29,7 +29,7 @@ type PricingFloatingIP struct {
 
 // PricingTraffic defines the schema of pricing information for traffic.
 type PricingTraffic struct {
-	PricePerGB Price `json:"price_per_gb"`
+	PricePerTB Price `json:"price_per_tb"`
 }
 
 // PricingServerBackup defines the schema of pricing information for server backups.


Test patch:
diff --git a/hcloud/schema_test.go b/hcloud/schema_test.go
index ee2258d..352cf00 100644
--- a/hcloud/schema_test.go
+++ b/hcloud/schema_test.go
@@ -772,7 +772,7 @@ func TestPricingFromSchema(t *testing.T) {
 			}
 		},
 		"traffic": {
-			"price_per_gb": {
+			"price_per_tb": {
 				"net": "1",
 				"gross": "1.19"
 			}
@@ -833,17 +833,17 @@ func TestPricingFromSchema(t *testing.T) {
 		t.Errorf("unexpected FloatingIP.Monthly.Gross: %v", pricing.FloatingIP.Monthly.Gross)
 	}
 
-	if pricing.Traffic.PerGB.Currency != "EUR" {
-		t.Errorf("unexpected Traffic.PerGB.Currency: %v", pricing.Traffic.PerGB.Currency)
+	if pricing.Traffic.PerTB.Currency != "EUR" {
+		t.Errorf("unexpected Traffic.PerTB.Currency: %v", pricing.Traffic.PerTB.Currency)
 	}
-	if pricing.Traffic.PerGB.VATRate != "19.00" {
-		t.Errorf("unexpected Traffic.PerGB.VATRate: %v", pricing.Traffic.PerGB.VATRate)
+	if pricing.Traffic.PerTB.VATRate != "19.00" {
+		t.Errorf("unexpected Traffic.PerTB.VATRate: %v", pricing.Traffic.PerTB.VATRate)
 	}
-	if pricing.Traffic.PerGB.Net != "1" {
-		t.Errorf("unexpected Traffic.PerGB.Net: %v", pricing.Traffic.PerGB.Net)
+	if pricing.Traffic.PerTB.Net != "1" {
+		t.Errorf("unexpected Traffic.PerTB.Net: %v", pricing.Traffic.PerTB.Net)
 	}
-	if pricing.Traffic.PerGB.Gross != "1.19" {
-		t.Errorf("unexpected Traffic.PerGB.Gross: %v", pricing.Traffic.PerGB.Gross)
+	if pricing.Traffic.PerTB.Gross != "1.19" {
+		t.Errorf("unexpected Traffic.PerTB.Gross: %v", pricing.Traffic.PerTB.Gross)
 	}
 
 	if pricing.ServerBackup.Percentage != "20" {