Skip to content

Commit

Permalink
Update active committers struct (google#3257)
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshkumarsv authored Sep 5, 2024
1 parent 00caddc commit bd3e889
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 5 additions & 2 deletions github/billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ type StorageBilling struct {

// ActiveCommitters represents the total active committers across all repositories in an Organization.
type ActiveCommitters struct {
TotalAdvancedSecurityCommitters int `json:"total_advanced_security_committers"`
Repositories []*RepositoryActiveCommitters `json:"repositories,omitempty"`
TotalAdvancedSecurityCommitters int `json:"total_advanced_security_committers"`
TotalCount int `json:"total_count"`
MaximumAdvancedSecurityCommitters int `json:"maximum_advanced_security_committers"`
PurchasedAdvancedSecurityCommitters int `json:"purchased_advanced_security_committers"`
Repositories []*RepositoryActiveCommitters `json:"repositories,omitempty"`
}

// RepositoryActiveCommitters represents active committers on each repository.
Expand Down
9 changes: 8 additions & 1 deletion github/billing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,14 @@ func TestBillingService_GetAdvancedSecurityActiveCommittersOrg(t *testing.T) {
testMethod(t, r, "GET")
fmt.Fprint(w, `{
"total_advanced_security_committers": 2,
"total_count": 2,
"maximum_advanced_security_committers": 3,
"purchased_advanced_security_committers": 4,
"repositories": [
{
"name": "octocat-org/Hello-World",
"advanced_security_committers": 2,
"advanced_security_committers_breakdown": [
{
"user_login": "octokitten",
Expand All @@ -459,7 +463,10 @@ func TestBillingService_GetAdvancedSecurityActiveCommittersOrg(t *testing.T) {
}

want := &ActiveCommitters{
TotalAdvancedSecurityCommitters: 2,
TotalAdvancedSecurityCommitters: 2,
TotalCount: 2,
MaximumAdvancedSecurityCommitters: 3,
PurchasedAdvancedSecurityCommitters: 4,
Repositories: []*RepositoryActiveCommitters{
{
Name: String("octocat-org/Hello-World"),
Expand Down

0 comments on commit bd3e889

Please sign in to comment.