@@ -30,14 +30,15 @@ type CostCenters struct {
3030 CostCenters []* CostCenter `json:"costCenters,omitempty"`
3131}
3232
33- // CostCenterListOptions specifies optional parameters to the EnterpriseService.ListCostCenters method.
34- type CostCenterListOptions struct {
33+ // ListCostCenterOptions specifies optional parameters to the EnterpriseService.ListCostCenters method.
34+ type ListCostCenterOptions struct {
35+ // Set to `active` or `deleted` to only list cost centers in a specific state.
3536 State * string `url:"state,omitempty"`
3637}
3738
3839// CostCenterRequest represents a request to create or update a cost center.
3940type CostCenterRequest struct {
40- Name * string `json:"name,omitempty "`
41+ Name string `json:"name"`
4142}
4243
4344// CostCenterResourceRequest represents a request to add or remove resources from a cost center.
@@ -47,8 +48,8 @@ type CostCenterResourceRequest struct {
4748 Repositories []string `json:"repositories,omitempty"`
4849}
4950
50- // CostCenterAddResourceResponse represents a response from adding resources to a cost center.
51- type CostCenterAddResourceResponse struct {
51+ // AddResourcesToCostCenterResponse represents a response from adding resources to a cost center.
52+ type AddResourcesToCostCenterResponse struct {
5253 Message * string `json:"message,omitempty"`
5354 ReassignedResources []* ReassignedResource `json:"reassigned_resources,omitempty"`
5455}
@@ -60,25 +61,25 @@ type ReassignedResource struct {
6061 PreviousCostCenter * string `json:"previous_cost_center,omitempty"`
6162}
6263
63- // CostCenterRemoveResourceResponse represents a response from removing resources from a cost center.
64- type CostCenterRemoveResourceResponse struct {
64+ // RemoveResourcesFromCostCenterResponse represents a response from removing resources from a cost center.
65+ type RemoveResourcesFromCostCenterResponse struct {
6566 Message * string `json:"message,omitempty"`
6667}
6768
68- // CostCenterDeleteResponse represents a response from deleting a cost center.
69- type CostCenterDeleteResponse struct {
70- Message * string `json:"message,omitempty "`
71- ID * string `json:"id,omitempty "`
72- Name * string `json:"name,omitempty "`
73- CostCenterState * string `json:"costCenterState,omitempty "`
69+ // DeleteCostCenterResponse represents a response from deleting a cost center.
70+ type DeleteCostCenterResponse struct {
71+ Message string `json:"message"`
72+ ID string `json:"id"`
73+ Name string `json:"name"`
74+ CostCenterState string `json:"costCenterState"`
7475}
7576
7677// ListCostCenters lists all cost centers for an enterprise.
7778//
7879// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/billing#get-all-cost-centers-for-an-enterprise
7980//
8081//meta:operation GET /enterprises/{enterprise}/settings/billing/cost-centers
81- func (s * EnterpriseService ) ListCostCenters (ctx context.Context , enterprise string , opts * CostCenterListOptions ) (* CostCenters , * Response , error ) {
82+ func (s * EnterpriseService ) ListCostCenters (ctx context.Context , enterprise string , opts * ListCostCenterOptions ) (* CostCenters , * Response , error ) {
8283 u := fmt .Sprintf ("enterprises/%v/settings/billing/cost-centers" , enterprise )
8384 u , err := addOptions (u , opts )
8485 if err != nil {
@@ -170,15 +171,15 @@ func (s *EnterpriseService) UpdateCostCenter(ctx context.Context, enterprise, co
170171// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/billing#delete-a-cost-center
171172//
172173//meta:operation DELETE /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}
173- func (s * EnterpriseService ) DeleteCostCenter (ctx context.Context , enterprise , costCenterID string ) (* CostCenterDeleteResponse , * Response , error ) {
174+ func (s * EnterpriseService ) DeleteCostCenter (ctx context.Context , enterprise , costCenterID string ) (* DeleteCostCenterResponse , * Response , error ) {
174175 u := fmt .Sprintf ("enterprises/%v/settings/billing/cost-centers/%v" , enterprise , costCenterID )
175176
176177 req , err := s .client .NewRequest ("DELETE" , u , nil )
177178 if err != nil {
178179 return nil , nil , err
179180 }
180181
181- result := & CostCenterDeleteResponse {}
182+ result := & DeleteCostCenterResponse {}
182183 resp , err := s .client .Do (ctx , req , result )
183184 if err != nil {
184185 return nil , resp , err
@@ -192,15 +193,15 @@ func (s *EnterpriseService) DeleteCostCenter(ctx context.Context, enterprise, co
192193// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/billing#add-resources-to-a-cost-center
193194//
194195//meta:operation POST /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource
195- func (s * EnterpriseService ) AddResourcesToCostCenter (ctx context.Context , enterprise , costCenterID string , resources CostCenterResourceRequest ) (* CostCenterAddResourceResponse , * Response , error ) {
196+ func (s * EnterpriseService ) AddResourcesToCostCenter (ctx context.Context , enterprise , costCenterID string , resources CostCenterResourceRequest ) (* AddResourcesToCostCenterResponse , * Response , error ) {
196197 u := fmt .Sprintf ("enterprises/%v/settings/billing/cost-centers/%v/resource" , enterprise , costCenterID )
197198
198199 req , err := s .client .NewRequest ("POST" , u , resources )
199200 if err != nil {
200201 return nil , nil , err
201202 }
202203
203- result := & CostCenterAddResourceResponse {}
204+ result := & AddResourcesToCostCenterResponse {}
204205 resp , err := s .client .Do (ctx , req , result )
205206 if err != nil {
206207 return nil , resp , err
@@ -214,15 +215,15 @@ func (s *EnterpriseService) AddResourcesToCostCenter(ctx context.Context, enterp
214215// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/billing#remove-resources-from-a-cost-center
215216//
216217//meta:operation DELETE /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource
217- func (s * EnterpriseService ) RemoveResourcesFromCostCenter (ctx context.Context , enterprise , costCenterID string , resources CostCenterResourceRequest ) (* CostCenterRemoveResourceResponse , * Response , error ) {
218+ func (s * EnterpriseService ) RemoveResourcesFromCostCenter (ctx context.Context , enterprise , costCenterID string , resources CostCenterResourceRequest ) (* RemoveResourcesFromCostCenterResponse , * Response , error ) {
218219 u := fmt .Sprintf ("enterprises/%v/settings/billing/cost-centers/%v/resource" , enterprise , costCenterID )
219220
220221 req , err := s .client .NewRequest ("DELETE" , u , resources )
221222 if err != nil {
222223 return nil , nil , err
223224 }
224225
225- result := & CostCenterRemoveResourceResponse {}
226+ result := & RemoveResourcesFromCostCenterResponse {}
226227 resp , err := s .client .Do (ctx , req , result )
227228 if err != nil {
228229 return nil , resp , err
0 commit comments