+
Skip to content

Change total_minutes_used and included_minutes from int to float64 #2643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions github/billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ type BillingService service

// ActionBilling represents a GitHub Action billing.
type ActionBilling struct {
TotalMinutesUsed int `json:"total_minutes_used"`
TotalMinutesUsed float64 `json:"total_minutes_used"`
TotalPaidMinutesUsed float64 `json:"total_paid_minutes_used"`
IncludedMinutes int `json:"included_minutes"`
IncludedMinutes float64 `json:"included_minutes"`
MinutesUsedBreakdown MinutesUsedBreakdown `json:"minutes_used_breakdown"`
}

Expand All @@ -29,16 +29,16 @@ type MinutesUsedBreakdown = map[string]int

// PackageBilling represents a GitHub Package billing.
type PackageBilling struct {
TotalGigabytesBandwidthUsed int `json:"total_gigabytes_bandwidth_used"`
TotalPaidGigabytesBandwidthUsed int `json:"total_paid_gigabytes_bandwidth_used"`
IncludedGigabytesBandwidth int `json:"included_gigabytes_bandwidth"`
TotalGigabytesBandwidthUsed int `json:"total_gigabytes_bandwidth_used"`
TotalPaidGigabytesBandwidthUsed int `json:"total_paid_gigabytes_bandwidth_used"`
IncludedGigabytesBandwidth float64 `json:"included_gigabytes_bandwidth"`
}

// StorageBilling represents a GitHub Storage billing.
type StorageBilling struct {
DaysLeftInBillingCycle int `json:"days_left_in_billing_cycle"`
EstimatedPaidStorageForMonth float64 `json:"estimated_paid_storage_for_month"`
EstimatedStorageForMonth int `json:"estimated_storage_for_month"`
EstimatedStorageForMonth float64 `json:"estimated_storage_for_month"`
}

// ActiveCommitters represents the total active committers across all repositories in an Organization.
Expand Down
10 changes: 5 additions & 5 deletions github/billing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ func TestBillingService_GetActionsBillingOrg(t *testing.T) {
mux.HandleFunc("/orgs/o/settings/billing/actions", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
fmt.Fprint(w, `{
"total_minutes_used": 305,
"total_minutes_used": 305.0,
"total_paid_minutes_used": 0.0,
"included_minutes": 3000,
"included_minutes": 3000.0,
"minutes_used_breakdown": {
"UBUNTU": 205,
"MACOS": 10,
Expand All @@ -39,9 +39,9 @@ func TestBillingService_GetActionsBillingOrg(t *testing.T) {
}

want := &ActionBilling{
TotalMinutesUsed: 305,
TotalPaidMinutesUsed: 0,
IncludedMinutes: 3000,
TotalMinutesUsed: 305.0,
TotalPaidMinutesUsed: 0.0,
IncludedMinutes: 3000.0,
MinutesUsedBreakdown: MinutesUsedBreakdown{
"UBUNTU": 205,
"MACOS": 10,
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载