Description
go-github v84 exposes a new, richer Cost Centers API under EnterpriseService (file: enterprise_billing_cost_centers.go), separate from and more capable than the BillingService methods currently used in the cost-centers branch.
The new API supports individual GetCostCenter lookups, explicit AddResources/RemoveResources operations, and a ListCostCenterOptions filter — all missing from the current implementation.
go-github v84 API (EnterpriseService)
func (s *EnterpriseService) ListCostCenters(ctx context.Context, enterprise string, opts *ListCostCenterOptions) (*CostCenters, *Response, error)
func (s *EnterpriseService) GetCostCenter(ctx context.Context, enterprise, costCenterID string) (*CostCenter, *Response, error)
func (s *EnterpriseService) CreateCostCenter(ctx context.Context, enterprise string, costCenter CostCenterRequest) (*CostCenter, *Response, error)
func (s *EnterpriseService) UpdateCostCenter(ctx context.Context, enterprise, costCenterID string, costCenter CostCenterRequest) (*CostCenter, *Response, error)
func (s *EnterpriseService) DeleteCostCenter(ctx context.Context, enterprise, costCenterID string) (*DeleteCostCenterResponse, *Response, error)
func (s *EnterpriseService) AddResourcesToCostCenter(ctx context.Context, enterprise, costCenterID string, resources CostCenterResourceRequest) (*AddResourcesToCostCenterResponse, *Response, error)
func (s *EnterpriseService) RemoveResourcesFromCostCenter(ctx context.Context, enterprise, costCenterID string, resources CostCenterResourceRequest) (*RemoveResourcesFromCostCenterResponse, *Response, error)
Current State
The cost-centers branch uses client.Billing.GetCostCenters / CreateCostCenter / UpdateCostCenterResources / DeleteCostCenter (BillingService). These lack individual GetCostCenter and have a different resource mutation model.
Acceptance Criteria
Description
go-github v84 exposes a new, richer Cost Centers API under
EnterpriseService(file:enterprise_billing_cost_centers.go), separate from and more capable than theBillingServicemethods currently used in the cost-centers branch.The new API supports individual
GetCostCenterlookups, explicitAddResources/RemoveResourcesoperations, and aListCostCenterOptionsfilter — all missing from the current implementation.go-github v84 API (EnterpriseService)
Current State
The cost-centers branch uses
client.Billing.GetCostCenters/CreateCostCenter/UpdateCostCenterResources/DeleteCostCenter(BillingService). These lack individualGetCostCenterand have a different resource mutation model.Acceptance Criteria
resource_github_enterprise_cost_center.goto the newEnterpriseServicemethods or keep both pathsEnterpriseService.GetCostCenterin Read (instead of scanning list)EnterpriseService.AddResourcesToCostCenter/RemoveResourcesFromCostCenterfor reconciliation in UpdateListCostCenterOptions(state filter) in the data sourceutil_enterprise_cost_center.goaccordingly