diff --git a/descriptions/api.github.com/api.github.com.2022-11-28.json b/descriptions/api.github.com/api.github.com.2022-11-28.json index 6124b70391..07ece2e4e0 100644 --- a/descriptions/api.github.com/api.github.com.2022-11-28.json +++ b/descriptions/api.github.com/api.github.com.2022-11-28.json @@ -12385,7 +12385,9 @@ "properties": { "selected_repository_ids": { "type": "array", - "description": "An array of repository IDs to detach from configurations.", + "description": "An array of repository IDs to detach from configurations. Up to 1000 IDs can be provided.", + "minItems": 1, + "maxItems": 1000, "items": { "type": "integer", "description": "Unique identifier of the repository." @@ -38109,6 +38111,9 @@ "409": { "$ref": "#/components/responses/code_scanning_conflict" }, + "422": { + "$ref": "#/components/responses/code_scanning_invalid_state" + }, "503": { "$ref": "#/components/responses/service_unavailable" } @@ -303166,6 +303171,16 @@ } } }, + "code_scanning_invalid_state": { + "description": "Response if the configuration change cannot be made because the repository is not in the required state", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/basic-error" + } + } + } + }, "dependency_review_forbidden": { "description": "Response for a private repository when GitHub Advanced Security is not enabled, or if used against a fork", "content": { diff --git a/descriptions/api.github.com/api.github.com.2022-11-28.yaml b/descriptions/api.github.com/api.github.com.2022-11-28.yaml index 855c96a36e..57338896b1 100644 --- a/descriptions/api.github.com/api.github.com.2022-11-28.yaml +++ b/descriptions/api.github.com/api.github.com.2022-11-28.yaml @@ -9014,6 +9014,9 @@ paths: selected_repository_ids: type: array description: An array of repository IDs to detach from configurations. + Up to 1000 IDs can be provided. + minItems: 1 + maxItems: 1000 items: type: integer description: Unique identifier of the repository. @@ -27726,6 +27729,8 @@ paths: "$ref": "#/components/responses/not_found" '409': "$ref": "#/components/responses/code_scanning_conflict" + '422': + "$ref": "#/components/responses/code_scanning_invalid_state" '503': "$ref": "#/components/responses/service_unavailable" x-github: @@ -230438,6 +230443,13 @@ components: application/json: schema: "$ref": "#/components/schemas/basic-error" + code_scanning_invalid_state: + description: Response if the configuration change cannot be made because the + repository is not in the required state + content: + application/json: + schema: + "$ref": "#/components/schemas/basic-error" dependency_review_forbidden: description: Response for a private repository when GitHub Advanced Security is not enabled, or if used against a fork diff --git a/descriptions/api.github.com/api.github.com.json b/descriptions/api.github.com/api.github.com.json index 6124b70391..07ece2e4e0 100644 --- a/descriptions/api.github.com/api.github.com.json +++ b/descriptions/api.github.com/api.github.com.json @@ -12385,7 +12385,9 @@ "properties": { "selected_repository_ids": { "type": "array", - "description": "An array of repository IDs to detach from configurations.", + "description": "An array of repository IDs to detach from configurations. Up to 1000 IDs can be provided.", + "minItems": 1, + "maxItems": 1000, "items": { "type": "integer", "description": "Unique identifier of the repository." @@ -38109,6 +38111,9 @@ "409": { "$ref": "#/components/responses/code_scanning_conflict" }, + "422": { + "$ref": "#/components/responses/code_scanning_invalid_state" + }, "503": { "$ref": "#/components/responses/service_unavailable" } @@ -303166,6 +303171,16 @@ } } }, + "code_scanning_invalid_state": { + "description": "Response if the configuration change cannot be made because the repository is not in the required state", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/basic-error" + } + } + } + }, "dependency_review_forbidden": { "description": "Response for a private repository when GitHub Advanced Security is not enabled, or if used against a fork", "content": { diff --git a/descriptions/api.github.com/api.github.com.yaml b/descriptions/api.github.com/api.github.com.yaml index 855c96a36e..57338896b1 100644 --- a/descriptions/api.github.com/api.github.com.yaml +++ b/descriptions/api.github.com/api.github.com.yaml @@ -9014,6 +9014,9 @@ paths: selected_repository_ids: type: array description: An array of repository IDs to detach from configurations. + Up to 1000 IDs can be provided. + minItems: 1 + maxItems: 1000 items: type: integer description: Unique identifier of the repository. @@ -27726,6 +27729,8 @@ paths: "$ref": "#/components/responses/not_found" '409': "$ref": "#/components/responses/code_scanning_conflict" + '422': + "$ref": "#/components/responses/code_scanning_invalid_state" '503': "$ref": "#/components/responses/service_unavailable" x-github: @@ -230438,6 +230443,13 @@ components: application/json: schema: "$ref": "#/components/schemas/basic-error" + code_scanning_invalid_state: + description: Response if the configuration change cannot be made because the + repository is not in the required state + content: + application/json: + schema: + "$ref": "#/components/schemas/basic-error" dependency_review_forbidden: description: Response for a private repository when GitHub Advanced Security is not enabled, or if used against a fork diff --git a/descriptions/api.github.com/dereferenced/api.github.com.2022-11-28.deref.json b/descriptions/api.github.com/dereferenced/api.github.com.2022-11-28.deref.json index 2189c39cf1..d461afae64 100644 --- a/descriptions/api.github.com/dereferenced/api.github.com.2022-11-28.deref.json +++ b/descriptions/api.github.com/dereferenced/api.github.com.2022-11-28.deref.json @@ -72857,7 +72857,9 @@ "properties": { "selected_repository_ids": { "type": "array", - "description": "An array of repository IDs to detach from configurations.", + "description": "An array of repository IDs to detach from configurations. Up to 1000 IDs can be provided.", + "minItems": 1, + "maxItems": 1000, "items": { "type": "integer", "description": "Unique identifier of the repository." @@ -234699,6 +234701,32 @@ } } }, + "422": { + "description": "Response if the configuration change cannot be made because the repository is not in the required state", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, "503": { "description": "Service unavailable", "content": { diff --git a/descriptions/api.github.com/dereferenced/api.github.com.2022-11-28.deref.yaml b/descriptions/api.github.com/dereferenced/api.github.com.2022-11-28.deref.yaml index 91c1ba760d..6d6e6c8816 100644 --- a/descriptions/api.github.com/dereferenced/api.github.com.2022-11-28.deref.yaml +++ b/descriptions/api.github.com/dereferenced/api.github.com.2022-11-28.deref.yaml @@ -23135,6 +23135,9 @@ paths: selected_repository_ids: type: array description: An array of repository IDs to detach from configurations. + Up to 1000 IDs can be provided. + minItems: 1 + maxItems: 1000 items: type: integer description: Unique identifier of the repository. @@ -57769,6 +57772,12 @@ paths: content: application/json: schema: *3 + '422': + description: Response if the configuration change cannot be made because + the repository is not in the required state + content: + application/json: + schema: *3 '503': *65 x-github: githubCloudOnly: false diff --git a/descriptions/api.github.com/dereferenced/api.github.com.deref.json b/descriptions/api.github.com/dereferenced/api.github.com.deref.json index 2189c39cf1..d461afae64 100644 --- a/descriptions/api.github.com/dereferenced/api.github.com.deref.json +++ b/descriptions/api.github.com/dereferenced/api.github.com.deref.json @@ -72857,7 +72857,9 @@ "properties": { "selected_repository_ids": { "type": "array", - "description": "An array of repository IDs to detach from configurations.", + "description": "An array of repository IDs to detach from configurations. Up to 1000 IDs can be provided.", + "minItems": 1, + "maxItems": 1000, "items": { "type": "integer", "description": "Unique identifier of the repository." @@ -234699,6 +234701,32 @@ } } }, + "422": { + "description": "Response if the configuration change cannot be made because the repository is not in the required state", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, "503": { "description": "Service unavailable", "content": { diff --git a/descriptions/api.github.com/dereferenced/api.github.com.deref.yaml b/descriptions/api.github.com/dereferenced/api.github.com.deref.yaml index 91c1ba760d..6d6e6c8816 100644 --- a/descriptions/api.github.com/dereferenced/api.github.com.deref.yaml +++ b/descriptions/api.github.com/dereferenced/api.github.com.deref.yaml @@ -23135,6 +23135,9 @@ paths: selected_repository_ids: type: array description: An array of repository IDs to detach from configurations. + Up to 1000 IDs can be provided. + minItems: 1 + maxItems: 1000 items: type: integer description: Unique identifier of the repository. @@ -57769,6 +57772,12 @@ paths: content: application/json: schema: *3 + '422': + description: Response if the configuration change cannot be made because + the repository is not in the required state + content: + application/json: + schema: *3 '503': *65 x-github: githubCloudOnly: false diff --git a/descriptions/ghec/dereferenced/ghec.2022-11-28.deref.json b/descriptions/ghec/dereferenced/ghec.2022-11-28.deref.json index c01a8c90bd..b066fb8366 100644 --- a/descriptions/ghec/dereferenced/ghec.2022-11-28.deref.json +++ b/descriptions/ghec/dereferenced/ghec.2022-11-28.deref.json @@ -52361,6 +52361,162 @@ "category": "enterprise-admin", "subcategory": "billing" } + }, + "post": { + "summary": "Create a new cost center", + "description": "Creates a new cost center for an enterprise. The authenticated user must be an enterprise admin.", + "tags": [ + "billing" + ], + "operationId": "billing/create-cost-center", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#create-a-new-cost-center" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the cost center (max length 255 characters)" + } + } + }, + "examples": { + "example-1": { + "summary": "Example request to create a cost center", + "value": { + "name": "Engineering Team" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Cost center created successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the cost center" + }, + "name": { + "type": "string", + "description": "Name of the cost center" + }, + "resources": { + "type": "array", + "description": "List of resources assigned to this cost center", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of resource (User, Org, or Repo)" + }, + "name": { + "type": "string", + "description": "Name/login of the resource" + } + } + } + } + } + }, + "examples": { + "example-1": { + "summary": "Example response for a created cost center", + "value": { + "id": "abc123", + "name": "Engineering Team", + "resources": [] + } + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "examples": { + "missing-name": { + "summary": "Missing name", + "value": { + "message": "Bad request: name is required." + } + }, + "limit-reached": { + "summary": "Cost center limit reached", + "value": { + "message": "This enterprise is already at the cost center limit of 1000 active cost centers." + } + } + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "examples": { + "duplicate-name": { + "summary": "Duplicate name", + "value": { + "message": "There's already a cost center created with that name." + } + } + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "examples": { + "internal-error": { + "summary": "Internal error", + "value": { + "message": "An internal server error occurred. Please try again later." + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": true, + "enabledForGitHubApps": false, + "category": "enterprise-admin", + "subcategory": "billing" + } } }, "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": { @@ -53168,15 +53324,15 @@ }, "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource": { "post": { - "summary": "Add users to a cost center", - "description": "Adds users to a cost center.\n\nThe usage for the users will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", + "summary": "Add resources to a cost center", + "description": "Adds resources to a cost center.\n\nThe usage for the resources will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", "tags": [ "billing" ], "operationId": "billing/add-resource-to-cost-center", "externalDocs": { "description": "API method documentation", - "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-users-to-a-cost-center" + "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-resources-to-a-cost-center" }, "parameters": [ { @@ -53211,6 +53367,20 @@ "items": { "type": "string" } + }, + "organizations": { + "description": "The organizations to add to the cost center.", + "type": "array", + "items": { + "type": "string" + } + }, + "repositories": { + "description": "The repositories to add to the cost center.", + "type": "array", + "items": { + "type": "string" + } } }, "minProperties": 1 @@ -53418,15 +53588,15 @@ } }, "delete": { - "summary": "Remove users from a cost center", - "description": "Remove users from a cost center.\n\nThe usage for the users will no longer be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", + "summary": "Remove resources from a cost center", + "description": "Remove resources from a cost center.\n\nThe usage for the resources will no longer be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", "tags": [ "billing" ], "operationId": "billing/remove-resource-from-cost-center", "externalDocs": { "description": "API method documentation", - "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#remove-users-from-a-cost-center" + "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#remove-resources-from-a-cost-center" }, "parameters": [ { @@ -53461,6 +53631,20 @@ "items": { "type": "string" } + }, + "organizations": { + "description": "The organizations to remove from the cost center.", + "type": "array", + "items": { + "type": "string" + } + }, + "repositories": { + "description": "The repositories to remove from the cost center.", + "type": "array", + "items": { + "type": "string" + } } }, "minProperties": 1 @@ -105791,7 +105975,9 @@ "properties": { "selected_repository_ids": { "type": "array", - "description": "An array of repository IDs to detach from configurations.", + "description": "An array of repository IDs to detach from configurations. Up to 1000 IDs can be provided.", + "minItems": 1, + "maxItems": 1000, "items": { "type": "integer", "description": "Unique identifier of the repository." @@ -276530,6 +276716,32 @@ } } }, + "422": { + "description": "Response if the configuration change cannot be made because the repository is not in the required state", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, "503": { "description": "Service unavailable", "content": { diff --git a/descriptions/ghec/dereferenced/ghec.2022-11-28.deref.yaml b/descriptions/ghec/dereferenced/ghec.2022-11-28.deref.yaml index c6f0ef8aa7..536375a897 100644 --- a/descriptions/ghec/dereferenced/ghec.2022-11-28.deref.yaml +++ b/descriptions/ghec/dereferenced/ghec.2022-11-28.deref.yaml @@ -19148,6 +19148,105 @@ paths: enabledForGitHubApps: false category: enterprise-admin subcategory: billing + post: + summary: Create a new cost center + description: Creates a new cost center for an enterprise. The authenticated + user must be an enterprise admin. + tags: + - billing + operationId: billing/create-cost-center + externalDocs: + description: API method documentation + url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#create-a-new-cost-center + parameters: + - *41 + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - name + properties: + name: + type: string + description: The name of the cost center (max length 255 characters) + examples: + example-1: + summary: Example request to create a cost center + value: + name: Engineering Team + responses: + '200': + description: Cost center created successfully + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: Unique identifier for the cost center + name: + type: string + description: Name of the cost center + resources: + type: array + description: List of resources assigned to this cost center + items: + type: object + properties: + type: + type: string + description: Type of resource (User, Org, or Repo) + name: + type: string + description: Name/login of the resource + examples: + example-1: + summary: Example response for a created cost center + value: + id: abc123 + name: Engineering Team + resources: [] + '400': + description: Bad request + content: + application/json: + examples: + missing-name: + summary: Missing name + value: + message: 'Bad request: name is required.' + limit-reached: + summary: Cost center limit reached + value: + message: This enterprise is already at the cost center limit of + 1000 active cost centers. + '409': + description: Conflict + content: + application/json: + examples: + duplicate-name: + summary: Duplicate name + value: + message: There's already a cost center created with that name. + '500': + description: Internal server error + content: + application/json: + examples: + internal-error: + summary: Internal error + value: + message: An internal server error occurred. Please try again later. + x-github: + githubCloudOnly: true + enabledForGitHubApps: false + category: enterprise-admin + subcategory: billing "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": get: summary: Get a cost center by ID @@ -19336,17 +19435,17 @@ paths: subcategory: billing "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource": post: - summary: Add users to a cost center + summary: Add resources to a cost center description: |- - Adds users to a cost center. + Adds resources to a cost center. - The usage for the users will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint. + The usage for the resources will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint. tags: - billing operationId: billing/add-resource-to-cost-center externalDocs: description: API method documentation - url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-users-to-a-cost-center + url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-resources-to-a-cost-center parameters: - *41 - *140 @@ -19362,6 +19461,16 @@ paths: type: array items: type: string + organizations: + description: The organizations to add to the cost center. + type: array + items: + type: string + repositories: + description: The repositories to add to the cost center. + type: array + items: + type: string minProperties: 1 examples: default: @@ -19393,17 +19502,17 @@ paths: category: enterprise-admin subcategory: billing delete: - summary: Remove users from a cost center + summary: Remove resources from a cost center description: |- - Remove users from a cost center. + Remove resources from a cost center. - The usage for the users will no longer be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint. + The usage for the resources will no longer be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint. tags: - billing operationId: billing/remove-resource-from-cost-center externalDocs: description: API method documentation - url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#remove-users-from-a-cost-center + url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#remove-resources-from-a-cost-center parameters: - *41 - *140 @@ -19420,6 +19529,16 @@ paths: type: array items: type: string + organizations: + description: The organizations to remove from the cost center. + type: array + items: + type: string + repositories: + description: The repositories to remove from the cost center. + type: array + items: + type: string minProperties: 1 examples: default: @@ -32037,6 +32156,9 @@ paths: selected_repository_ids: type: array description: An array of repository IDs to detach from configurations. + Up to 1000 IDs can be provided. + minItems: 1 + maxItems: 1000 items: type: integer description: Unique identifier of the repository. @@ -67158,6 +67280,12 @@ paths: content: application/json: schema: *3 + '422': + description: Response if the configuration change cannot be made because + the repository is not in the required state + content: + application/json: + schema: *3 '503': *137 x-github: githubCloudOnly: false diff --git a/descriptions/ghec/dereferenced/ghec.deref.json b/descriptions/ghec/dereferenced/ghec.deref.json index c01a8c90bd..b066fb8366 100644 --- a/descriptions/ghec/dereferenced/ghec.deref.json +++ b/descriptions/ghec/dereferenced/ghec.deref.json @@ -52361,6 +52361,162 @@ "category": "enterprise-admin", "subcategory": "billing" } + }, + "post": { + "summary": "Create a new cost center", + "description": "Creates a new cost center for an enterprise. The authenticated user must be an enterprise admin.", + "tags": [ + "billing" + ], + "operationId": "billing/create-cost-center", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#create-a-new-cost-center" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the cost center (max length 255 characters)" + } + } + }, + "examples": { + "example-1": { + "summary": "Example request to create a cost center", + "value": { + "name": "Engineering Team" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Cost center created successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the cost center" + }, + "name": { + "type": "string", + "description": "Name of the cost center" + }, + "resources": { + "type": "array", + "description": "List of resources assigned to this cost center", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of resource (User, Org, or Repo)" + }, + "name": { + "type": "string", + "description": "Name/login of the resource" + } + } + } + } + } + }, + "examples": { + "example-1": { + "summary": "Example response for a created cost center", + "value": { + "id": "abc123", + "name": "Engineering Team", + "resources": [] + } + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "examples": { + "missing-name": { + "summary": "Missing name", + "value": { + "message": "Bad request: name is required." + } + }, + "limit-reached": { + "summary": "Cost center limit reached", + "value": { + "message": "This enterprise is already at the cost center limit of 1000 active cost centers." + } + } + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "examples": { + "duplicate-name": { + "summary": "Duplicate name", + "value": { + "message": "There's already a cost center created with that name." + } + } + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "examples": { + "internal-error": { + "summary": "Internal error", + "value": { + "message": "An internal server error occurred. Please try again later." + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": true, + "enabledForGitHubApps": false, + "category": "enterprise-admin", + "subcategory": "billing" + } } }, "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": { @@ -53168,15 +53324,15 @@ }, "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource": { "post": { - "summary": "Add users to a cost center", - "description": "Adds users to a cost center.\n\nThe usage for the users will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", + "summary": "Add resources to a cost center", + "description": "Adds resources to a cost center.\n\nThe usage for the resources will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", "tags": [ "billing" ], "operationId": "billing/add-resource-to-cost-center", "externalDocs": { "description": "API method documentation", - "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-users-to-a-cost-center" + "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-resources-to-a-cost-center" }, "parameters": [ { @@ -53211,6 +53367,20 @@ "items": { "type": "string" } + }, + "organizations": { + "description": "The organizations to add to the cost center.", + "type": "array", + "items": { + "type": "string" + } + }, + "repositories": { + "description": "The repositories to add to the cost center.", + "type": "array", + "items": { + "type": "string" + } } }, "minProperties": 1 @@ -53418,15 +53588,15 @@ } }, "delete": { - "summary": "Remove users from a cost center", - "description": "Remove users from a cost center.\n\nThe usage for the users will no longer be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", + "summary": "Remove resources from a cost center", + "description": "Remove resources from a cost center.\n\nThe usage for the resources will no longer be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", "tags": [ "billing" ], "operationId": "billing/remove-resource-from-cost-center", "externalDocs": { "description": "API method documentation", - "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#remove-users-from-a-cost-center" + "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#remove-resources-from-a-cost-center" }, "parameters": [ { @@ -53461,6 +53631,20 @@ "items": { "type": "string" } + }, + "organizations": { + "description": "The organizations to remove from the cost center.", + "type": "array", + "items": { + "type": "string" + } + }, + "repositories": { + "description": "The repositories to remove from the cost center.", + "type": "array", + "items": { + "type": "string" + } } }, "minProperties": 1 @@ -105791,7 +105975,9 @@ "properties": { "selected_repository_ids": { "type": "array", - "description": "An array of repository IDs to detach from configurations.", + "description": "An array of repository IDs to detach from configurations. Up to 1000 IDs can be provided.", + "minItems": 1, + "maxItems": 1000, "items": { "type": "integer", "description": "Unique identifier of the repository." @@ -276530,6 +276716,32 @@ } } }, + "422": { + "description": "Response if the configuration change cannot be made because the repository is not in the required state", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, "503": { "description": "Service unavailable", "content": { diff --git a/descriptions/ghec/dereferenced/ghec.deref.yaml b/descriptions/ghec/dereferenced/ghec.deref.yaml index c6f0ef8aa7..536375a897 100644 --- a/descriptions/ghec/dereferenced/ghec.deref.yaml +++ b/descriptions/ghec/dereferenced/ghec.deref.yaml @@ -19148,6 +19148,105 @@ paths: enabledForGitHubApps: false category: enterprise-admin subcategory: billing + post: + summary: Create a new cost center + description: Creates a new cost center for an enterprise. The authenticated + user must be an enterprise admin. + tags: + - billing + operationId: billing/create-cost-center + externalDocs: + description: API method documentation + url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#create-a-new-cost-center + parameters: + - *41 + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - name + properties: + name: + type: string + description: The name of the cost center (max length 255 characters) + examples: + example-1: + summary: Example request to create a cost center + value: + name: Engineering Team + responses: + '200': + description: Cost center created successfully + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: Unique identifier for the cost center + name: + type: string + description: Name of the cost center + resources: + type: array + description: List of resources assigned to this cost center + items: + type: object + properties: + type: + type: string + description: Type of resource (User, Org, or Repo) + name: + type: string + description: Name/login of the resource + examples: + example-1: + summary: Example response for a created cost center + value: + id: abc123 + name: Engineering Team + resources: [] + '400': + description: Bad request + content: + application/json: + examples: + missing-name: + summary: Missing name + value: + message: 'Bad request: name is required.' + limit-reached: + summary: Cost center limit reached + value: + message: This enterprise is already at the cost center limit of + 1000 active cost centers. + '409': + description: Conflict + content: + application/json: + examples: + duplicate-name: + summary: Duplicate name + value: + message: There's already a cost center created with that name. + '500': + description: Internal server error + content: + application/json: + examples: + internal-error: + summary: Internal error + value: + message: An internal server error occurred. Please try again later. + x-github: + githubCloudOnly: true + enabledForGitHubApps: false + category: enterprise-admin + subcategory: billing "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": get: summary: Get a cost center by ID @@ -19336,17 +19435,17 @@ paths: subcategory: billing "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource": post: - summary: Add users to a cost center + summary: Add resources to a cost center description: |- - Adds users to a cost center. + Adds resources to a cost center. - The usage for the users will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint. + The usage for the resources will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint. tags: - billing operationId: billing/add-resource-to-cost-center externalDocs: description: API method documentation - url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-users-to-a-cost-center + url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-resources-to-a-cost-center parameters: - *41 - *140 @@ -19362,6 +19461,16 @@ paths: type: array items: type: string + organizations: + description: The organizations to add to the cost center. + type: array + items: + type: string + repositories: + description: The repositories to add to the cost center. + type: array + items: + type: string minProperties: 1 examples: default: @@ -19393,17 +19502,17 @@ paths: category: enterprise-admin subcategory: billing delete: - summary: Remove users from a cost center + summary: Remove resources from a cost center description: |- - Remove users from a cost center. + Remove resources from a cost center. - The usage for the users will no longer be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint. + The usage for the resources will no longer be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint. tags: - billing operationId: billing/remove-resource-from-cost-center externalDocs: description: API method documentation - url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#remove-users-from-a-cost-center + url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#remove-resources-from-a-cost-center parameters: - *41 - *140 @@ -19420,6 +19529,16 @@ paths: type: array items: type: string + organizations: + description: The organizations to remove from the cost center. + type: array + items: + type: string + repositories: + description: The repositories to remove from the cost center. + type: array + items: + type: string minProperties: 1 examples: default: @@ -32037,6 +32156,9 @@ paths: selected_repository_ids: type: array description: An array of repository IDs to detach from configurations. + Up to 1000 IDs can be provided. + minItems: 1 + maxItems: 1000 items: type: integer description: Unique identifier of the repository. @@ -67158,6 +67280,12 @@ paths: content: application/json: schema: *3 + '422': + description: Response if the configuration change cannot be made because + the repository is not in the required state + content: + application/json: + schema: *3 '503': *137 x-github: githubCloudOnly: false diff --git a/descriptions/ghec/ghec.2022-11-28.json b/descriptions/ghec/ghec.2022-11-28.json index 0375807074..601ac3804b 100644 --- a/descriptions/ghec/ghec.2022-11-28.json +++ b/descriptions/ghec/ghec.2022-11-28.json @@ -9280,6 +9280,156 @@ "category": "enterprise-admin", "subcategory": "billing" } + }, + "post": { + "summary": "Create a new cost center", + "description": "Creates a new cost center for an enterprise. The authenticated user must be an enterprise admin.", + "tags": [ + "billing" + ], + "operationId": "billing/create-cost-center", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#create-a-new-cost-center" + }, + "parameters": [ + { + "$ref": "#/components/parameters/enterprise" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the cost center (max length 255 characters)" + } + } + }, + "examples": { + "example-1": { + "summary": "Example request to create a cost center", + "value": { + "name": "Engineering Team" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Cost center created successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the cost center" + }, + "name": { + "type": "string", + "description": "Name of the cost center" + }, + "resources": { + "type": "array", + "description": "List of resources assigned to this cost center", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of resource (User, Org, or Repo)" + }, + "name": { + "type": "string", + "description": "Name/login of the resource" + } + } + } + } + } + }, + "examples": { + "example-1": { + "summary": "Example response for a created cost center", + "value": { + "id": "abc123", + "name": "Engineering Team", + "resources": [] + } + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "examples": { + "missing-name": { + "summary": "Missing name", + "value": { + "message": "Bad request: name is required." + } + }, + "limit-reached": { + "summary": "Cost center limit reached", + "value": { + "message": "This enterprise is already at the cost center limit of 1000 active cost centers." + } + } + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "examples": { + "duplicate-name": { + "summary": "Duplicate name", + "value": { + "message": "There's already a cost center created with that name." + } + } + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "examples": { + "internal-error": { + "summary": "Internal error", + "value": { + "message": "An internal server error occurred. Please try again later." + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": true, + "enabledForGitHubApps": false, + "category": "enterprise-admin", + "subcategory": "billing" + } } }, "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": { @@ -9463,15 +9613,15 @@ }, "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource": { "post": { - "summary": "Add users to a cost center", - "description": "Adds users to a cost center.\n\nThe usage for the users will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", + "summary": "Add resources to a cost center", + "description": "Adds resources to a cost center.\n\nThe usage for the resources will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", "tags": [ "billing" ], "operationId": "billing/add-resource-to-cost-center", "externalDocs": { "description": "API method documentation", - "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-users-to-a-cost-center" + "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-resources-to-a-cost-center" }, "parameters": [ { @@ -9494,6 +9644,20 @@ "items": { "type": "string" } + }, + "organizations": { + "description": "The organizations to add to the cost center.", + "type": "array", + "items": { + "type": "string" + } + }, + "repositories": { + "description": "The repositories to add to the cost center.", + "type": "array", + "items": { + "type": "string" + } } }, "minProperties": 1 @@ -9538,15 +9702,15 @@ } }, "delete": { - "summary": "Remove users from a cost center", - "description": "Remove users from a cost center.\n\nThe usage for the users will no longer be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", + "summary": "Remove resources from a cost center", + "description": "Remove resources from a cost center.\n\nThe usage for the resources will no longer be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", "tags": [ "billing" ], "operationId": "billing/remove-resource-from-cost-center", "externalDocs": { "description": "API method documentation", - "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#remove-users-from-a-cost-center" + "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#remove-resources-from-a-cost-center" }, "parameters": [ { @@ -9569,6 +9733,20 @@ "items": { "type": "string" } + }, + "organizations": { + "description": "The organizations to remove from the cost center.", + "type": "array", + "items": { + "type": "string" + } + }, + "repositories": { + "description": "The repositories to remove from the cost center.", + "type": "array", + "items": { + "type": "string" + } } }, "minProperties": 1 @@ -19385,7 +19563,9 @@ "properties": { "selected_repository_ids": { "type": "array", - "description": "An array of repository IDs to detach from configurations.", + "description": "An array of repository IDs to detach from configurations. Up to 1000 IDs can be provided.", + "minItems": 1, + "maxItems": 1000, "items": { "type": "integer", "description": "Unique identifier of the repository." @@ -47213,6 +47393,9 @@ "409": { "$ref": "#/components/responses/code_scanning_conflict" }, + "422": { + "$ref": "#/components/responses/code_scanning_invalid_state" + }, "503": { "$ref": "#/components/responses/service_unavailable" } @@ -322703,6 +322886,16 @@ } } }, + "code_scanning_invalid_state": { + "description": "Response if the configuration change cannot be made because the repository is not in the required state", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/basic-error" + } + } + } + }, "dependency_review_forbidden": { "description": "Response for a private repository when GitHub Advanced Security is not enabled, or if used against a fork", "content": { diff --git a/descriptions/ghec/ghec.2022-11-28.yaml b/descriptions/ghec/ghec.2022-11-28.yaml index 180c211572..ea98a3765e 100644 --- a/descriptions/ghec/ghec.2022-11-28.yaml +++ b/descriptions/ghec/ghec.2022-11-28.yaml @@ -6553,6 +6553,105 @@ paths: enabledForGitHubApps: false category: enterprise-admin subcategory: billing + post: + summary: Create a new cost center + description: Creates a new cost center for an enterprise. The authenticated + user must be an enterprise admin. + tags: + - billing + operationId: billing/create-cost-center + externalDocs: + description: API method documentation + url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#create-a-new-cost-center + parameters: + - "$ref": "#/components/parameters/enterprise" + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - name + properties: + name: + type: string + description: The name of the cost center (max length 255 characters) + examples: + example-1: + summary: Example request to create a cost center + value: + name: Engineering Team + responses: + '200': + description: Cost center created successfully + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: Unique identifier for the cost center + name: + type: string + description: Name of the cost center + resources: + type: array + description: List of resources assigned to this cost center + items: + type: object + properties: + type: + type: string + description: Type of resource (User, Org, or Repo) + name: + type: string + description: Name/login of the resource + examples: + example-1: + summary: Example response for a created cost center + value: + id: abc123 + name: Engineering Team + resources: [] + '400': + description: Bad request + content: + application/json: + examples: + missing-name: + summary: Missing name + value: + message: 'Bad request: name is required.' + limit-reached: + summary: Cost center limit reached + value: + message: This enterprise is already at the cost center limit of + 1000 active cost centers. + '409': + description: Conflict + content: + application/json: + examples: + duplicate-name: + summary: Duplicate name + value: + message: There's already a cost center created with that name. + '500': + description: Internal server error + content: + application/json: + examples: + internal-error: + summary: Internal error + value: + message: An internal server error occurred. Please try again later. + x-github: + githubCloudOnly: true + enabledForGitHubApps: false + category: enterprise-admin + subcategory: billing "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": get: summary: Get a cost center by ID @@ -6675,17 +6774,17 @@ paths: subcategory: billing "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource": post: - summary: Add users to a cost center + summary: Add resources to a cost center description: |- - Adds users to a cost center. + Adds resources to a cost center. - The usage for the users will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint. + The usage for the resources will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint. tags: - billing operationId: billing/add-resource-to-cost-center externalDocs: description: API method documentation - url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-users-to-a-cost-center + url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-resources-to-a-cost-center parameters: - "$ref": "#/components/parameters/enterprise" - "$ref": "#/components/parameters/cost-center" @@ -6701,6 +6800,16 @@ paths: type: array items: type: string + organizations: + description: The organizations to add to the cost center. + type: array + items: + type: string + repositories: + description: The repositories to add to the cost center. + type: array + items: + type: string minProperties: 1 examples: default: @@ -6726,17 +6835,17 @@ paths: category: enterprise-admin subcategory: billing delete: - summary: Remove users from a cost center + summary: Remove resources from a cost center description: |- - Remove users from a cost center. + Remove resources from a cost center. - The usage for the users will no longer be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint. + The usage for the resources will no longer be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint. tags: - billing operationId: billing/remove-resource-from-cost-center externalDocs: description: API method documentation - url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#remove-users-from-a-cost-center + url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#remove-resources-from-a-cost-center parameters: - "$ref": "#/components/parameters/enterprise" - "$ref": "#/components/parameters/cost-center" @@ -6753,6 +6862,16 @@ paths: type: array items: type: string + organizations: + description: The organizations to remove from the cost center. + type: array + items: + type: string + repositories: + description: The repositories to remove from the cost center. + type: array + items: + type: string minProperties: 1 examples: default: @@ -13960,6 +14079,9 @@ paths: selected_repository_ids: type: array description: An array of repository IDs to detach from configurations. + Up to 1000 IDs can be provided. + minItems: 1 + maxItems: 1000 items: type: integer description: Unique identifier of the repository. @@ -34203,6 +34325,8 @@ paths: "$ref": "#/components/responses/not_found" '409': "$ref": "#/components/responses/code_scanning_conflict" + '422': + "$ref": "#/components/responses/code_scanning_invalid_state" '503': "$ref": "#/components/responses/service_unavailable" x-github: @@ -244579,6 +244703,13 @@ components: application/json: schema: "$ref": "#/components/schemas/basic-error" + code_scanning_invalid_state: + description: Response if the configuration change cannot be made because the + repository is not in the required state + content: + application/json: + schema: + "$ref": "#/components/schemas/basic-error" dependency_review_forbidden: description: Response for a private repository when GitHub Advanced Security is not enabled, or if used against a fork diff --git a/descriptions/ghec/ghec.json b/descriptions/ghec/ghec.json index 0375807074..601ac3804b 100644 --- a/descriptions/ghec/ghec.json +++ b/descriptions/ghec/ghec.json @@ -9280,6 +9280,156 @@ "category": "enterprise-admin", "subcategory": "billing" } + }, + "post": { + "summary": "Create a new cost center", + "description": "Creates a new cost center for an enterprise. The authenticated user must be an enterprise admin.", + "tags": [ + "billing" + ], + "operationId": "billing/create-cost-center", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#create-a-new-cost-center" + }, + "parameters": [ + { + "$ref": "#/components/parameters/enterprise" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the cost center (max length 255 characters)" + } + } + }, + "examples": { + "example-1": { + "summary": "Example request to create a cost center", + "value": { + "name": "Engineering Team" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Cost center created successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the cost center" + }, + "name": { + "type": "string", + "description": "Name of the cost center" + }, + "resources": { + "type": "array", + "description": "List of resources assigned to this cost center", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of resource (User, Org, or Repo)" + }, + "name": { + "type": "string", + "description": "Name/login of the resource" + } + } + } + } + } + }, + "examples": { + "example-1": { + "summary": "Example response for a created cost center", + "value": { + "id": "abc123", + "name": "Engineering Team", + "resources": [] + } + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "examples": { + "missing-name": { + "summary": "Missing name", + "value": { + "message": "Bad request: name is required." + } + }, + "limit-reached": { + "summary": "Cost center limit reached", + "value": { + "message": "This enterprise is already at the cost center limit of 1000 active cost centers." + } + } + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "examples": { + "duplicate-name": { + "summary": "Duplicate name", + "value": { + "message": "There's already a cost center created with that name." + } + } + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "examples": { + "internal-error": { + "summary": "Internal error", + "value": { + "message": "An internal server error occurred. Please try again later." + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": true, + "enabledForGitHubApps": false, + "category": "enterprise-admin", + "subcategory": "billing" + } } }, "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": { @@ -9463,15 +9613,15 @@ }, "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource": { "post": { - "summary": "Add users to a cost center", - "description": "Adds users to a cost center.\n\nThe usage for the users will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", + "summary": "Add resources to a cost center", + "description": "Adds resources to a cost center.\n\nThe usage for the resources will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", "tags": [ "billing" ], "operationId": "billing/add-resource-to-cost-center", "externalDocs": { "description": "API method documentation", - "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-users-to-a-cost-center" + "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-resources-to-a-cost-center" }, "parameters": [ { @@ -9494,6 +9644,20 @@ "items": { "type": "string" } + }, + "organizations": { + "description": "The organizations to add to the cost center.", + "type": "array", + "items": { + "type": "string" + } + }, + "repositories": { + "description": "The repositories to add to the cost center.", + "type": "array", + "items": { + "type": "string" + } } }, "minProperties": 1 @@ -9538,15 +9702,15 @@ } }, "delete": { - "summary": "Remove users from a cost center", - "description": "Remove users from a cost center.\n\nThe usage for the users will no longer be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", + "summary": "Remove resources from a cost center", + "description": "Remove resources from a cost center.\n\nThe usage for the resources will no longer be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint.", "tags": [ "billing" ], "operationId": "billing/remove-resource-from-cost-center", "externalDocs": { "description": "API method documentation", - "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#remove-users-from-a-cost-center" + "url": "https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#remove-resources-from-a-cost-center" }, "parameters": [ { @@ -9569,6 +9733,20 @@ "items": { "type": "string" } + }, + "organizations": { + "description": "The organizations to remove from the cost center.", + "type": "array", + "items": { + "type": "string" + } + }, + "repositories": { + "description": "The repositories to remove from the cost center.", + "type": "array", + "items": { + "type": "string" + } } }, "minProperties": 1 @@ -19385,7 +19563,9 @@ "properties": { "selected_repository_ids": { "type": "array", - "description": "An array of repository IDs to detach from configurations.", + "description": "An array of repository IDs to detach from configurations. Up to 1000 IDs can be provided.", + "minItems": 1, + "maxItems": 1000, "items": { "type": "integer", "description": "Unique identifier of the repository." @@ -47213,6 +47393,9 @@ "409": { "$ref": "#/components/responses/code_scanning_conflict" }, + "422": { + "$ref": "#/components/responses/code_scanning_invalid_state" + }, "503": { "$ref": "#/components/responses/service_unavailable" } @@ -322703,6 +322886,16 @@ } } }, + "code_scanning_invalid_state": { + "description": "Response if the configuration change cannot be made because the repository is not in the required state", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/basic-error" + } + } + } + }, "dependency_review_forbidden": { "description": "Response for a private repository when GitHub Advanced Security is not enabled, or if used against a fork", "content": { diff --git a/descriptions/ghec/ghec.yaml b/descriptions/ghec/ghec.yaml index 180c211572..ea98a3765e 100644 --- a/descriptions/ghec/ghec.yaml +++ b/descriptions/ghec/ghec.yaml @@ -6553,6 +6553,105 @@ paths: enabledForGitHubApps: false category: enterprise-admin subcategory: billing + post: + summary: Create a new cost center + description: Creates a new cost center for an enterprise. The authenticated + user must be an enterprise admin. + tags: + - billing + operationId: billing/create-cost-center + externalDocs: + description: API method documentation + url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#create-a-new-cost-center + parameters: + - "$ref": "#/components/parameters/enterprise" + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - name + properties: + name: + type: string + description: The name of the cost center (max length 255 characters) + examples: + example-1: + summary: Example request to create a cost center + value: + name: Engineering Team + responses: + '200': + description: Cost center created successfully + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: Unique identifier for the cost center + name: + type: string + description: Name of the cost center + resources: + type: array + description: List of resources assigned to this cost center + items: + type: object + properties: + type: + type: string + description: Type of resource (User, Org, or Repo) + name: + type: string + description: Name/login of the resource + examples: + example-1: + summary: Example response for a created cost center + value: + id: abc123 + name: Engineering Team + resources: [] + '400': + description: Bad request + content: + application/json: + examples: + missing-name: + summary: Missing name + value: + message: 'Bad request: name is required.' + limit-reached: + summary: Cost center limit reached + value: + message: This enterprise is already at the cost center limit of + 1000 active cost centers. + '409': + description: Conflict + content: + application/json: + examples: + duplicate-name: + summary: Duplicate name + value: + message: There's already a cost center created with that name. + '500': + description: Internal server error + content: + application/json: + examples: + internal-error: + summary: Internal error + value: + message: An internal server error occurred. Please try again later. + x-github: + githubCloudOnly: true + enabledForGitHubApps: false + category: enterprise-admin + subcategory: billing "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": get: summary: Get a cost center by ID @@ -6675,17 +6774,17 @@ paths: subcategory: billing "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource": post: - summary: Add users to a cost center + summary: Add resources to a cost center description: |- - Adds users to a cost center. + Adds resources to a cost center. - The usage for the users will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint. + The usage for the resources will be charged to the cost center's budget. The authenticated user must be an enterprise admin in order to use this endpoint. tags: - billing operationId: billing/add-resource-to-cost-center externalDocs: description: API method documentation - url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-users-to-a-cost-center + url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/billing#add-resources-to-a-cost-center parameters: - "$ref": "#/components/parameters/enterprise" - "$ref": "#/components/parameters/cost-center" @@ -6701,6 +6800,16 @@ paths: type: array items: type: string + organizations: + description: The organizations to add to the cost center. + type: array + items: + type: string + repositories: + description: The repositories to add to the cost center. + type: array + items: + type: string minProperties: 1 examples: default: @@ -6726,17 +6835,17 @@ paths: category: enterprise-admin subcateg{"code":"internal","msg":"git-diff-tree: context deadline exceeded","meta":{"cause":"*fmt.wrapError"}}