Skip to content
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
4 changes: 2 additions & 2 deletions github/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (m Enterprise) String() string {

// UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.18/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user
// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user
//
//meta:operation PATCH /admin/ldap/users/{username}/mapping
func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) {
Expand All @@ -103,7 +103,7 @@ func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, m

// UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.18/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team
// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team
//
//meta:operation PATCH /admin/ldap/teams/{team_id}/mapping
func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) {
Expand Down
6 changes: 3 additions & 3 deletions github/admin_orgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type createOrgRequest struct {
// Note that only a subset of the org fields are used and org must
// not be nil.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.18/rest/enterprise-admin/orgs#create-an-organization
// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/orgs#create-an-organization
//
//meta:operation POST /admin/organizations
func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) {
Expand Down Expand Up @@ -62,7 +62,7 @@ type RenameOrgResponse struct {

// RenameOrg renames an organization in GitHub Enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.18/rest/enterprise-admin/orgs#update-an-organization-name
// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/orgs#update-an-organization-name
//
//meta:operation PATCH /admin/organizations/{org}
func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) {
Expand All @@ -78,7 +78,7 @@ func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName

// RenameOrgByName renames an organization in GitHub Enterprise using its current name.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.18/rest/enterprise-admin/orgs#update-an-organization-name
// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/orgs#update-an-organization-name
//
//meta:operation PATCH /admin/organizations/{org}
func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) {
Expand Down
2 changes: 1 addition & 1 deletion github/admin_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (s RepoStats) String() string {
// Please note that this is only available to site administrators,
// otherwise it will error with a 404 not found (instead of 401 or 403).
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.18/rest/enterprise-admin/admin-stats#get-all-statistics
// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/admin-stats#get-all-statistics
//
//meta:operation GET /enterprise/stats/all
func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) {
Expand Down
8 changes: 4 additions & 4 deletions github/admin_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type CreateUserRequest struct {

// CreateUser creates a new user in GitHub Enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.18/rest/enterprise-admin/users#create-a-user
// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#create-a-user
//
//meta:operation POST /admin/users
func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest) (*User, *Response, error) {
Expand All @@ -42,7 +42,7 @@ func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest

// DeleteUser deletes a user in GitHub Enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.18/rest/enterprise-admin/users#delete-a-user
// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#delete-a-user
//
//meta:operation DELETE /admin/users/{username}
func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) {
Expand Down Expand Up @@ -95,7 +95,7 @@ type UserAuthorization struct {

// CreateUserImpersonation creates an impersonation OAuth token.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.18/rest/enterprise-admin/users#create-an-impersonation-oauth-token
// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#create-an-impersonation-oauth-token
//
//meta:operation POST /admin/users/{username}/authorizations
func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) {
Expand All @@ -117,7 +117,7 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str

// DeleteUserImpersonation deletes an impersonation OAuth token.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.18/rest/enterprise-admin/users#delete-an-impersonation-oauth-token
// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#delete-an-impersonation-oauth-token
//
//meta:operation DELETE /admin/users/{username}/authorizations
func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) {
Expand Down
4 changes: 2 additions & 2 deletions github/authorizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, acces
// you can e.g. create or delete a user's public SSH key. NOTE: creating a
// new token automatically revokes an existing one.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.18/rest/enterprise-admin/users#create-an-impersonation-oauth-token
// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#create-an-impersonation-oauth-token
//
//meta:operation POST /admin/users/{username}/authorizations
func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) {
Expand All @@ -279,7 +279,7 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam
//
// NOTE: there can be only one at a time.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.18/rest/enterprise-admin/users#delete-an-impersonation-oauth-token
// GitHub API docs: https://docs.github.com/enterprise-server@3.19/rest/enterprise-admin/users#delete-an-impersonation-oauth-token
//
//meta:operation DELETE /admin/users/{username}/authorizations
func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) {
Expand Down
28 changes: 12 additions & 16 deletions github/billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,8 @@ type PremiumRequestUsageReport struct {

// GetOrganizationPackagesBilling returns the free and paid storage used for GitHub Packages in gigabytes for an Org.
//
// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization
//
//meta:operation GET /orgs/{org}/settings/billing/packages
// This endpoint appears to have disappeared from the official GitHub v3 API documentation website.
// See https://github.com/google/go-github/issues/3894 for details.
func (s *BillingService) GetOrganizationPackagesBilling(ctx context.Context, org string) (*PackagesBilling, *Response, error) {
u := fmt.Sprintf("orgs/%v/settings/billing/packages", org)
req, err := s.client.NewRequest("GET", u, nil)
Expand All @@ -195,9 +194,8 @@ func (s *BillingService) GetOrganizationPackagesBilling(ctx context.Context, org
// GetOrganizationStorageBilling returns the estimated paid and estimated total storage used for GitHub Actions
// and GitHub Packages in gigabytes for an Org.
//
// GitHub API docs: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-an-organization
//
//meta:operation GET /orgs/{org}/settings/billing/shared-storage
// This endpoint appears to have disappeared from the official GitHub v3 API documentation website.
// See https://github.com/google/go-github/issues/3894 for details.
func (s *BillingService) GetOrganizationStorageBilling(ctx context.Context, org string) (*StorageBilling, *Response, error) {
u := fmt.Sprintf("orgs/%v/settings/billing/shared-storage", org)
req, err := s.client.NewRequest("GET", u, nil)
Expand Down Expand Up @@ -242,9 +240,8 @@ func (s *BillingService) GetOrganizationAdvancedSecurityActiveCommitters(ctx con

// GetPackagesBilling returns the free and paid storage used for GitHub Packages in gigabytes for a user.
//
// GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-a-user
//
//meta:operation GET /users/{username}/settings/billing/packages
// This endpoint appears to have disappeared from the official GitHub v3 API documentation website.
// See https://github.com/google/go-github/issues/3894 for details.
func (s *BillingService) GetPackagesBilling(ctx context.Context, user string) (*PackagesBilling, *Response, error) {
u := fmt.Sprintf("users/%v/settings/billing/packages", user)
req, err := s.client.NewRequest("GET", u, nil)
Expand All @@ -264,9 +261,8 @@ func (s *BillingService) GetPackagesBilling(ctx context.Context, user string) (*
// GetStorageBilling returns the estimated paid and estimated total storage used for GitHub Actions
// and GitHub Packages in gigabytes for a user.
//
// GitHub API docs: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-a-user
//
//meta:operation GET /users/{username}/settings/billing/shared-storage
// This endpoint appears to have disappeared from the official GitHub v3 API documentation website.
// See https://github.com/google/go-github/issues/3894 for details.
func (s *BillingService) GetStorageBilling(ctx context.Context, user string) (*StorageBilling, *Response, error) {
u := fmt.Sprintf("users/%v/settings/billing/shared-storage", user)
req, err := s.client.NewRequest("GET", u, nil)
Expand All @@ -287,7 +283,7 @@ func (s *BillingService) GetStorageBilling(ctx context.Context, user string) (*S
//
// Note: This endpoint is only available to organizations with access to the enhanced billing platform.
//
// GitHub API docs: https://docs.github.com/rest/billing/enhanced-billing#get-billing-usage-report-for-an-organization
// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-usage-report-for-an-organization
//
//meta:operation GET /organizations/{org}/settings/billing/usage
func (s *BillingService) GetOrganizationUsageReport(ctx context.Context, org string, opts *UsageReportOptions) (*UsageReport, *Response, error) {
Expand Down Expand Up @@ -315,7 +311,7 @@ func (s *BillingService) GetOrganizationUsageReport(ctx context.Context, org str
//
// Note: This endpoint is only available to users with access to the enhanced billing platform.
//
// GitHub API docs: https://docs.github.com/rest/billing/enhanced-billing#get-billing-usage-report-for-a-user
// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-usage-report-for-a-user
//
//meta:operation GET /users/{username}/settings/billing/usage
func (s *BillingService) GetUsageReport(ctx context.Context, user string, opts *UsageReportOptions) (*UsageReport, *Response, error) {
Expand Down Expand Up @@ -344,7 +340,7 @@ func (s *BillingService) GetUsageReport(ctx context.Context, user string, opts *
//
// Note: This endpoint is only available to organizations with access to the enhanced billing platform.
//
// GitHub API docs: https://docs.github.com/rest/billing/enhanced-billing#get-billing-premium-request-usage-report-for-an-organization
// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-premium-request-usage-report-for-an-organization
//
//meta:operation GET /organizations/{org}/settings/billing/premium_request/usage
func (s *BillingService) GetOrganizationPremiumRequestUsageReport(ctx context.Context, org string, opts *PremiumRequestUsageReportOptions) (*PremiumRequestUsageReport, *Response, error) {
Expand Down Expand Up @@ -373,7 +369,7 @@ func (s *BillingService) GetOrganizationPremiumRequestUsageReport(ctx context.Co
//
// Note: This endpoint is only available to users with access to the enhanced billing platform.
//
// GitHub API docs: https://docs.github.com/rest/billing/enhanced-billing#get-billing-premium-request-usage-report-for-a-user
// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-premium-request-usage-report-for-a-user
//
//meta:operation GET /users/{username}/settings/billing/premium_request/usage
func (s *BillingService) GetPremiumRequestUsageReport(ctx context.Context, user string, opts *PremiumRequestUsageReportOptions) (*PremiumRequestUsageReport, *Response, error) {
Expand Down
14 changes: 7 additions & 7 deletions github/enterprise_billing_cost_centers.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type DeleteCostCenterResponse struct {

// ListCostCenters lists all cost centers for an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/billing#get-all-cost-centers-for-an-enterprise
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-all-cost-centers-for-an-enterprise
//
//meta:operation GET /enterprises/{enterprise}/settings/billing/cost-centers
func (s *EnterpriseService) ListCostCenters(ctx context.Context, enterprise string, opts *ListCostCenterOptions) (*CostCenters, *Response, error) {
Expand All @@ -102,7 +102,7 @@ func (s *EnterpriseService) ListCostCenters(ctx context.Context, enterprise stri

// CreateCostCenter creates a new cost center for an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/billing#create-a-new-cost-center
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#create-a-new-cost-center
//
//meta:operation POST /enterprises/{enterprise}/settings/billing/cost-centers
func (s *EnterpriseService) CreateCostCenter(ctx context.Context, enterprise string, costCenter CostCenterRequest) (*CostCenter, *Response, error) {
Expand All @@ -124,7 +124,7 @@ func (s *EnterpriseService) CreateCostCenter(ctx context.Context, enterprise str

// GetCostCenter gets a cost center by ID for an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/billing#get-a-cost-center-by-id
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-a-cost-center-by-id
//
//meta:operation GET /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}
func (s *EnterpriseService) GetCostCenter(ctx context.Context, enterprise, costCenterID string) (*CostCenter, *Response, error) {
Expand All @@ -146,7 +146,7 @@ func (s *EnterpriseService) GetCostCenter(ctx context.Context, enterprise, costC

// UpdateCostCenter updates the name of a cost center.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/billing#update-a-cost-center-name
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#update-a-cost-center-name
//
//meta:operation PATCH /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}
func (s *EnterpriseService) UpdateCostCenter(ctx context.Context, enterprise, costCenterID string, costCenter CostCenterRequest) (*CostCenter, *Response, error) {
Expand All @@ -168,7 +168,7 @@ func (s *EnterpriseService) UpdateCostCenter(ctx context.Context, enterprise, co

// DeleteCostCenter deletes a cost center.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/billing#delete-a-cost-center
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#delete-a-cost-center
//
//meta:operation DELETE /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}
func (s *EnterpriseService) DeleteCostCenter(ctx context.Context, enterprise, costCenterID string) (*DeleteCostCenterResponse, *Response, error) {
Expand All @@ -190,7 +190,7 @@ func (s *EnterpriseService) DeleteCostCenter(ctx context.Context, enterprise, co

// AddResourcesToCostCenter adds resources to a cost center.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/billing#add-resources-to-a-cost-center
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#add-resources-to-a-cost-center
//
//meta:operation POST /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource
func (s *EnterpriseService) AddResourcesToCostCenter(ctx context.Context, enterprise, costCenterID string, resources CostCenterResourceRequest) (*AddResourcesToCostCenterResponse, *Response, error) {
Expand All @@ -212,7 +212,7 @@ func (s *EnterpriseService) AddResourcesToCostCenter(ctx context.Context, enterp

// RemoveResourcesFromCostCenter removes resources from a cost center.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/billing#remove-resources-from-a-cost-center
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#remove-resources-from-a-cost-center
//
//meta:operation DELETE /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource
func (s *EnterpriseService) RemoveResourcesFromCostCenter(ctx context.Context, enterprise, costCenterID string, resources CostCenterResourceRequest) (*RemoveResourcesFromCostCenterResponse, *Response, error) {
Expand Down
4 changes: 2 additions & 2 deletions github/enterprise_licenses.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ type LastLicenseSyncProperties struct {

// GetConsumedLicenses collect information about the number of consumed licenses and a collection with all the users with consumed enterprise licenses.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/license#list-enterprise-consumed-licenses
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/licensing#list-enterprise-consumed-licenses
//
//meta:operation GET /enterprises/{enterprise}/consumed-licenses
func (s *EnterpriseService) GetConsumedLicenses(ctx context.Context, enterprise string, opts *ListOptions) (*EnterpriseConsumedLicenses, *Response, error) {
Expand All @@ -117,7 +117,7 @@ func (s *EnterpriseService) GetConsumedLicenses(ctx context.Context, enterprise

// GetLicenseSyncStatus collects information about the status of a license sync job for an enterprise.
//
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/license#get-a-license-sync-status
// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/licensing#get-a-license-sync-status
//
//meta:operation GET /enterprises/{enterprise}/license-sync-status
func (s *EnterpriseService) GetLicenseSyncStatus(ctx context.Context, enterprise string) (*EnterpriseLicenseSyncStatus, *Response, error) {
Expand Down
Loading
Loading