From ca2f3c241db38ad450ef5b5a1edc60b651a1c8ee Mon Sep 17 00:00:00 2001 From: Gunadhya <6939749+gunadhya@users.noreply.github.com> Date: Mon, 15 Nov 2021 21:17:22 +0530 Subject: [PATCH] Change StorageBilling.EstimatedPaidStorageForMonth from int to float64 (#2205) Fixes: #2203. --- github/billing.go | 6 +++--- github/billing_test.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/github/billing.go b/github/billing.go index fa0e034d0f..190140a4cd 100644 --- a/github/billing.go +++ b/github/billing.go @@ -39,9 +39,9 @@ type PackageBilling struct { // StorageBilling represents a GitHub Storage billing. type StorageBilling struct { - DaysLeftInBillingCycle int `json:"days_left_in_billing_cycle"` - EstimatedPaidStorageForMonth int `json:"estimated_paid_storage_for_month"` - EstimatedStorageForMonth int `json:"estimated_storage_for_month"` + DaysLeftInBillingCycle int `json:"days_left_in_billing_cycle"` + EstimatedPaidStorageForMonth float64 `json:"estimated_paid_storage_for_month"` + EstimatedStorageForMonth int `json:"estimated_storage_for_month"` } // GetActionsBillingOrg returns the summary of the free and paid GitHub Actions minutes used for an Org. diff --git a/github/billing_test.go b/github/billing_test.go index 7d1c2a1d05..2693e68a76 100644 --- a/github/billing_test.go +++ b/github/billing_test.go @@ -120,7 +120,7 @@ func TestBillingService_GetStorageBillingOrg(t *testing.T) { testMethod(t, r, "GET") fmt.Fprint(w, `{ "days_left_in_billing_cycle": 20, - "estimated_paid_storage_for_month": 15, + "estimated_paid_storage_for_month": 15.25, "estimated_storage_for_month": 40 }`) }) @@ -133,7 +133,7 @@ func TestBillingService_GetStorageBillingOrg(t *testing.T) { want := &StorageBilling{ DaysLeftInBillingCycle: 20, - EstimatedPaidStorageForMonth: 15, + EstimatedPaidStorageForMonth: 15.25, EstimatedStorageForMonth: 40, } if !cmp.Equal(hook, want) { @@ -262,7 +262,7 @@ func TestBillingService_GetStorageBillingUser(t *testing.T) { testMethod(t, r, "GET") fmt.Fprint(w, `{ "days_left_in_billing_cycle": 20, - "estimated_paid_storage_for_month": 15, + "estimated_paid_storage_for_month": 15.25, "estimated_storage_for_month": 40 }`) }) @@ -275,7 +275,7 @@ func TestBillingService_GetStorageBillingUser(t *testing.T) { want := &StorageBilling{ DaysLeftInBillingCycle: 20, - EstimatedPaidStorageForMonth: 15, + EstimatedPaidStorageForMonth: 15.25, EstimatedStorageForMonth: 40, } if !cmp.Equal(hook, want) {