Skip to content

Commit 34ba363

Browse files
committed
fix: quantity being a float and not an int
The API doc is not consistent with the actual output from the api. The quantity is not an int, but a float.
1 parent 2e26546 commit 34ba363

File tree

4 files changed

+123
-156
lines changed

4 files changed

+123
-156
lines changed

github/billing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ type UsageItem struct {
8787
Date *string `json:"date"`
8888
Product *string `json:"product"`
8989
SKU *string `json:"sku"`
90-
Quantity *int `json:"quantity"`
90+
Quantity *float64 `json:"quantity"`
9191
UnitType *string `json:"unitType"`
9292
PricePerUnit *float64 `json:"pricePerUnit"`
9393
GrossAmount *float64 `json:"grossAmount"`

github/billing_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ func TestBillingService_GetUsageReportOrg(t *testing.T) {
556556
Date: Ptr("2023-08-01"),
557557
Product: Ptr("Actions"),
558558
SKU: Ptr("Actions Linux"),
559-
Quantity: Ptr(100),
559+
Quantity: Ptr(100.0),
560560
UnitType: Ptr("minutes"),
561561
PricePerUnit: Ptr(0.008),
562562
GrossAmount: Ptr(0.8),
@@ -637,7 +637,7 @@ func TestBillingService_GetUsageReportUser(t *testing.T) {
637637
Date: Ptr("2023-08-15"),
638638
Product: Ptr("Codespaces"),
639639
SKU: Ptr("Codespaces Linux"),
640-
Quantity: Ptr(50),
640+
Quantity: Ptr(50.0),
641641
UnitType: Ptr("hours"),
642642
PricePerUnit: Ptr(0.18),
643643
GrossAmount: Ptr(9.0),

github/github-accessors.go

Lines changed: 120 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 0 additions & 153 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)