diff --git a/descriptions-next/api.github.com/api.github.com.2022-11-28.json b/descriptions-next/api.github.com/api.github.com.2022-11-28.json index 0c01d0e879..0237bef279 100644 --- a/descriptions-next/api.github.com/api.github.com.2022-11-28.json +++ b/descriptions-next/api.github.com/api.github.com.2022-11-28.json @@ -38263,6 +38263,9 @@ "409": { "$ref": "#/components/responses/code_scanning_conflict" }, + "422": { + "$ref": "#/components/responses/code_scanning_invalid_state" + }, "503": { "$ref": "#/components/responses/service_unavailable" } @@ -311974,6 +311977,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-next/api.github.com/api.github.com.2022-11-28.yaml b/descriptions-next/api.github.com/api.github.com.2022-11-28.yaml index aea5cfa304..e9592468d8 100644 --- a/descriptions-next/api.github.com/api.github.com.2022-11-28.yaml +++ b/descriptions-next/api.github.com/api.github.com.2022-11-28.yaml @@ -27800,6 +27800,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: @@ -233669,6 +233671,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-next/api.github.com/api.github.com.json b/descriptions-next/api.github.com/api.github.com.json index 0c01d0e879..0237bef279 100644 --- a/descriptions-next/api.github.com/api.github.com.json +++ b/descriptions-next/api.github.com/api.github.com.json @@ -38263,6 +38263,9 @@ "409": { "$ref": "#/components/responses/code_scanning_conflict" }, + "422": { + "$ref": "#/components/responses/code_scanning_invalid_state" + }, "503": { "$ref": "#/components/responses/service_unavailable" } @@ -311974,6 +311977,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-next/api.github.com/api.github.com.yaml b/descriptions-next/api.github.com/api.github.com.yaml index aea5cfa304..e9592468d8 100644 --- a/descriptions-next/api.github.com/api.github.com.yaml +++ b/descriptions-next/api.github.com/api.github.com.yaml @@ -27800,6 +27800,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: @@ -233669,6 +233671,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-next/api.github.com/dereferenced/api.github.com.2022-11-28.deref.json b/descriptions-next/api.github.com/dereferenced/api.github.com.2022-11-28.deref.json index 007cfef382..c3c820017e 100644 --- a/descriptions-next/api.github.com/dereferenced/api.github.com.2022-11-28.deref.json +++ b/descriptions-next/api.github.com/dereferenced/api.github.com.2022-11-28.deref.json @@ -271137,6 +271137,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-next/api.github.com/dereferenced/api.github.com.2022-11-28.deref.yaml b/descriptions-next/api.github.com/dereferenced/api.github.com.2022-11-28.deref.yaml index 6fae45b599..d366c5e131 100644 --- a/descriptions-next/api.github.com/dereferenced/api.github.com.2022-11-28.deref.yaml +++ b/descriptions-next/api.github.com/dereferenced/api.github.com.2022-11-28.deref.yaml @@ -59360,6 +59360,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': *62 x-github: githubCloudOnly: false diff --git a/descriptions-next/api.github.com/dereferenced/api.github.com.deref.json b/descriptions-next/api.github.com/dereferenced/api.github.com.deref.json index 007cfef382..c3c820017e 100644 --- a/descriptions-next/api.github.com/dereferenced/api.github.com.deref.json +++ b/descriptions-next/api.github.com/dereferenced/api.github.com.deref.json @@ -271137,6 +271137,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-next/api.github.com/dereferenced/api.github.com.deref.yaml b/descriptions-next/api.github.com/dereferenced/api.github.com.deref.yaml index 6fae45b599..d366c5e131 100644 --- a/descriptions-next/api.github.com/dereferenced/api.github.com.deref.yaml +++ b/descriptions-next/api.github.com/dereferenced/api.github.com.deref.yaml @@ -59360,6 +59360,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': *62 x-github: githubCloudOnly: false diff --git a/descriptions-next/ghec/dereferenced/ghec.2022-11-28.deref.json b/descriptions-next/ghec/dereferenced/ghec.2022-11-28.deref.json index 8c848c42f1..3ff4b11742 100644 --- a/descriptions-next/ghec/dereferenced/ghec.2022-11-28.deref.json +++ b/descriptions-next/ghec/dereferenced/ghec.2022-11-28.deref.json @@ -57246,6 +57246,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}": { @@ -58077,15 +58233,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": [ { @@ -58120,6 +58276,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 @@ -58335,15 +58505,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": [ { @@ -58378,6 +58548,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 @@ -316073,6 +316257,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-next/ghec/dereferenced/ghec.2022-11-28.deref.yaml b/descriptions-next/ghec/dereferenced/ghec.2022-11-28.deref.yaml index b4cce4f297..2a070e8d23 100644 --- a/descriptions-next/ghec/dereferenced/ghec.2022-11-28.deref.yaml +++ b/descriptions-next/ghec/dereferenced/ghec.2022-11-28.deref.yaml @@ -19736,6 +19736,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: + - *39 + 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 @@ -19924,17 +20023,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: - *39 - *136 @@ -19950,6 +20049,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: @@ -19981,17 +20090,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: - *39 - *136 @@ -20008,6 +20117,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: @@ -68868,6 +68987,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': *133 x-github: githubCloudOnly: false diff --git a/descriptions-next/ghec/dereferenced/ghec.deref.json b/descriptions-next/ghec/dereferenced/ghec.deref.json index 8c848c42f1..3ff4b11742 100644 --- a/descriptions-next/ghec/dereferenced/ghec.deref.json +++ b/descriptions-next/ghec/dereferenced/ghec.deref.json @@ -57246,6 +57246,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}": { @@ -58077,15 +58233,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": [ { @@ -58120,6 +58276,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 @@ -58335,15 +58505,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": [ { @@ -58378,6 +58548,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 @@ -316073,6 +316257,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-next/ghec/dereferenced/ghec.deref.yaml b/descriptions-next/ghec/dereferenced/ghec.deref.yaml index b4cce4f297..2a070e8d23 100644 --- a/descriptions-next/ghec/dereferenced/ghec.deref.yaml +++ b/descriptions-next/ghec/dereferenced/ghec.deref.yaml @@ -19736,6 +19736,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: + - *39 + 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 @@ -19924,17 +20023,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: - *39 - *136 @@ -19950,6 +20049,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: @@ -19981,17 +20090,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: - *39 - *136 @@ -20008,6 +20117,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: @@ -68868,6 +68987,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': *133 x-github: githubCloudOnly: false diff --git a/descriptions-next/ghec/ghec.2022-11-28.json b/descriptions-next/ghec/ghec.2022-11-28.json index d42d467ac7..9aa72b1585 100644 --- a/descriptions-next/ghec/ghec.2022-11-28.json +++ b/descriptions-next/ghec/ghec.2022-11-28.json @@ -9302,6 +9302,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}": { @@ -9485,15 +9635,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": [ { @@ -9516,6 +9666,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 @@ -9560,15 +9724,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": [ { @@ -9591,6 +9755,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 @@ -47383,6 +47561,9 @@ "409": { "$ref": "#/components/responses/code_scanning_conflict" }, + "422": { + "$ref": "#/components/responses/code_scanning_invalid_state" + }, "503": { "$ref": "#/components/responses/service_unavailable" } @@ -331931,6 +332112,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-next/ghec/ghec.2022-11-28.yaml b/descriptions-next/ghec/ghec.2022-11-28.yaml index d1b581a289..390af3079f 100644 --- a/descriptions-next/ghec/ghec.2022-11-28.yaml +++ b/descriptions-next/ghec/ghec.2022-11-28.yaml @@ -6564,6 +6564,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 @@ -6686,17 +6785,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" @@ -6712,6 +6811,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: @@ -6737,17 +6846,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" @@ -6764,6 +6873,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: @@ -34285,6 +34404,8 @@ paths: "$ref": "#/components/responses/not_found" '409': "$ref": "#/components/responses/code_scanning_conflict" + '422': + "$ref": "#/components/responses/code_scanning_invalid_state" {"code":"internal","msg":"git-diff-tree: context deadline exceeded","meta":{"cause":"*fmt.wrapError"}}