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 a1811ba1b8..efb71c366c 100644 --- a/descriptions-next/ghec/dereferenced/ghec.2022-11-28.deref.json +++ b/descriptions-next/ghec/dereferenced/ghec.2022-11-28.deref.json @@ -120190,6 +120190,418 @@ } } }, + "/enterprises/{enterprise}/settings/billing/cost-centers/memberships": { + "get": { + "summary": "Get cost center membership for a resource", + "description": "Gets the cost center membership information for a specified resource (user, organization, repository, or enterprise team).\nEnterprise owners, billing managers, and organization owners in the enterprise can view membership information. A custom role holder with fine-grained read access to enterprise billing can also view membership information. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get cost center membership information for any resource in the enterprise.\nOrganization owners are limited to organizations they own, users who belong to those organizations, repositories they can see, and enterprise teams visible to them.", + "tags": [ + "billing" + ], + "operationId": "billing/get-cost-center-membership", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-cost-center-membership-for-a-resource" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "resource_type", + "in": "query", + "required": true, + "description": "The type of resource to lookup. Must be one of: user, repository, organization, team.", + "schema": { + "type": "string", + "enum": [ + "user", + "repository", + "organization", + "team" + ] + } + }, + { + "name": "name", + "in": "query", + "required": true, + "description": "The identifier for the resource. For users and organizations, this is the login or organization name. For repositories, use the format \"owner/repo\". For teams, use the enterprise team slug.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "resource": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "user", + "organization", + "repository", + "team" + ], + "description": "The type of resource." + }, + "identifier": { + "type": "object", + "oneOf": [ + { + "properties": { + "login": { + "type": "string", + "description": "The login name for a user." + } + }, + "required": [ + "login" + ], + "additionalProperties": false + }, + { + "properties": { + "name": { + "type": "string", + "description": "The name for an organization." + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + { + "properties": { + "owner": { + "type": "string", + "description": "The owner of the repository." + }, + "name": { + "type": "string", + "description": "The name of the repository." + } + }, + "required": [ + "owner", + "name" + ], + "additionalProperties": false + }, + { + "properties": { + "slug": { + "type": "string", + "description": "The slug for an enterprise team." + } + }, + "required": [ + "slug" + ], + "additionalProperties": false + } + ], + "description": "The identifier for the resource." + } + }, + "required": [ + "type", + "identifier" + ] + }, + "memberships": { + "type": "array", + "items": { + "type": "object", + "properties": { + "cost_center": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the cost center." + }, + "name": { + "type": "string", + "description": "The name of the cost center." + } + }, + "required": [ + "id", + "name" + ] + } + } + }, + "description": "The list of cost center memberships for the resource." + } + }, + "required": [ + "resource", + "memberships" + ] + }, + "examples": { + "user_with_membership": { + "value": { + "resource": { + "type": "user", + "identifier": { + "login": "octocat" + } + }, + "memberships": [ + { + "cost_center": { + "id": "12345678-1234-1234-1234-123456789012", + "name": "Engineering Team" + } + } + ] + } + }, + "organization_with_membership": { + "value": { + "resource": { + "type": "organization", + "identifier": { + "name": "github" + } + }, + "memberships": [ + { + "cost_center": { + "id": "87654321-4321-4321-4321-210987654321", + "name": "Marketing Team" + } + } + ] + } + }, + "repository_with_membership": { + "value": { + "resource": { + "type": "repository", + "identifier": { + "owner": "github", + "name": "docs" + } + }, + "memberships": [ + { + "cost_center": { + "id": "11111111-2222-3333-4444-555555555555", + "name": "Documentation Team" + } + } + ] + } + }, + "user_without_membership": { + "value": { + "resource": { + "type": "user", + "identifier": { + "login": "octocat" + } + }, + "memberships": [] + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "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" + } + } + } + }, + "application/scim+json": { + "schema": { + "title": "Scim Error", + "description": "Scim Error", + "type": "object", + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "documentation_url": { + "type": [ + "string", + "null" + ] + }, + "detail": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "integer" + }, + "scimType": { + "type": [ + "string", + "null" + ] + }, + "schemas": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "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" + } + } + } + } + } + }, + "404": { + "description": "Resource not found", + "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" + } + } + } + } + } + }, + "500": { + "description": "Internal Error", + "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": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": true, + "enabledForGitHubApps": true, + "category": "billing", + "subcategory": "cost-centers" + } + } + }, "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": { "get": { "summary": "Get a cost center by ID", 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 559dac5395..eda25d3700 100644 --- a/descriptions-next/ghec/dereferenced/ghec.2022-11-28.deref.yaml +++ b/descriptions-next/ghec/dereferenced/ghec.2022-11-28.deref.yaml @@ -47336,6 +47336,169 @@ paths: enabledForGitHubApps: true category: billing subcategory: cost-centers + "/enterprises/{enterprise}/settings/billing/cost-centers/memberships": + get: + summary: Get cost center membership for a resource + description: |- + Gets the cost center membership information for a specified resource (user, organization, repository, or enterprise team). + Enterprise owners, billing managers, and organization owners in the enterprise can view membership information. A custom role holder with fine-grained read access to enterprise billing can also view membership information. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get cost center membership information for any resource in the enterprise. + Organization owners are limited to organizations they own, users who belong to those organizations, repositories they can see, and enterprise teams visible to them. + tags: + - billing + operationId: billing/get-cost-center-membership + externalDocs: + description: API method documentation + url: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-cost-center-membership-for-a-resource + parameters: + - *36 + - name: resource_type + in: query + required: true + description: 'The type of resource to lookup. Must be one of: user, repository, + organization, team.' + schema: + type: string + enum: + - user + - repository + - organization + - team + - name: name + in: query + required: true + description: The identifier for the resource. For users and organizations, + this is the login or organization name. For repositories, use the format + "owner/repo". For teams, use the enterprise team slug. + schema: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + resource: + type: object + properties: + type: + type: string + enum: + - user + - organization + - repository + - team + description: The type of resource. + identifier: + type: object + oneOf: + - properties: + login: + type: string + description: The login name for a user. + required: + - login + additionalProperties: false + - properties: + name: + type: string + description: The name for an organization. + required: + - name + additionalProperties: false + - properties: + owner: + type: string + description: The owner of the repository. + name: + type: string + description: The name of the repository. + required: + - owner + - name + additionalProperties: false + - properties: + slug: + type: string + description: The slug for an enterprise team. + required: + - slug + additionalProperties: false + description: The identifier for the resource. + required: + - type + - identifier + memberships: + type: array + items: + type: object + properties: + cost_center: + type: object + properties: + id: + type: string + description: The unique identifier of the cost center. + name: + type: string + description: The name of the cost center. + required: + - id + - name + description: The list of cost center memberships for the resource. + required: + - resource + - memberships + examples: + user_with_membership: + value: + resource: + type: user + identifier: + login: octocat + memberships: + - cost_center: + id: 12345678-1234-1234-1234-123456789012 + name: Engineering Team + organization_with_membership: + value: + resource: + type: organization + identifier: + name: github + memberships: + - cost_center: + id: 87654321-4321-4321-4321-210987654321 + name: Marketing Team + repository_with_membership: + value: + resource: + type: repository + identifier: + owner: github + name: docs + memberships: + - cost_center: + id: 11111111-2222-3333-4444-555555555555 + name: Documentation Team + user_without_membership: + value: + resource: + type: user + identifier: + login: octocat + memberships: [] + '400': *14 + '403': *27 + '404': *6 + '500': *35 + '503': *133 + x-github: + githubCloudOnly: true + enabledForGitHubApps: true + category: billing + subcategory: cost-centers "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": get: summary: Get a cost center by ID diff --git a/descriptions-next/ghec/dereferenced/ghec.2026-03-10.deref.json b/descriptions-next/ghec/dereferenced/ghec.2026-03-10.deref.json index ef040c6ab9..6284171abe 100644 --- a/descriptions-next/ghec/dereferenced/ghec.2026-03-10.deref.json +++ b/descriptions-next/ghec/dereferenced/ghec.2026-03-10.deref.json @@ -119477,6 +119477,418 @@ } } }, + "/enterprises/{enterprise}/settings/billing/cost-centers/memberships": { + "get": { + "summary": "Get cost center membership for a resource", + "description": "Gets the cost center membership information for a specified resource (user, organization, repository, or enterprise team).\nEnterprise owners, billing managers, and organization owners in the enterprise can view membership information. A custom role holder with fine-grained read access to enterprise billing can also view membership information. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get cost center membership information for any resource in the enterprise.\nOrganization owners are limited to organizations they own, users who belong to those organizations, repositories they can see, and enterprise teams visible to them.", + "tags": [ + "billing" + ], + "operationId": "billing/get-cost-center-membership", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-cost-center-membership-for-a-resource" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "resource_type", + "in": "query", + "required": true, + "description": "The type of resource to lookup. Must be one of: user, repository, organization, team.", + "schema": { + "type": "string", + "enum": [ + "user", + "repository", + "organization", + "team" + ] + } + }, + { + "name": "name", + "in": "query", + "required": true, + "description": "The identifier for the resource. For users and organizations, this is the login or organization name. For repositories, use the format \"owner/repo\". For teams, use the enterprise team slug.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "resource": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "user", + "organization", + "repository", + "team" + ], + "description": "The type of resource." + }, + "identifier": { + "type": "object", + "oneOf": [ + { + "properties": { + "login": { + "type": "string", + "description": "The login name for a user." + } + }, + "required": [ + "login" + ], + "additionalProperties": false + }, + { + "properties": { + "name": { + "type": "string", + "description": "The name for an organization." + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + { + "properties": { + "owner": { + "type": "string", + "description": "The owner of the repository." + }, + "name": { + "type": "string", + "description": "The name of the repository." + } + }, + "required": [ + "owner", + "name" + ], + "additionalProperties": false + }, + { + "properties": { + "slug": { + "type": "string", + "description": "The slug for an enterprise team." + } + }, + "required": [ + "slug" + ], + "additionalProperties": false + } + ], + "description": "The identifier for the resource." + } + }, + "required": [ + "type", + "identifier" + ] + }, + "memberships": { + "type": "array", + "items": { + "type": "object", + "properties": { + "cost_center": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the cost center." + }, + "name": { + "type": "string", + "description": "The name of the cost center." + } + }, + "required": [ + "id", + "name" + ] + } + } + }, + "description": "The list of cost center memberships for the resource." + } + }, + "required": [ + "resource", + "memberships" + ] + }, + "examples": { + "user_with_membership": { + "value": { + "resource": { + "type": "user", + "identifier": { + "login": "octocat" + } + }, + "memberships": [ + { + "cost_center": { + "id": "12345678-1234-1234-1234-123456789012", + "name": "Engineering Team" + } + } + ] + } + }, + "organization_with_membership": { + "value": { + "resource": { + "type": "organization", + "identifier": { + "name": "github" + } + }, + "memberships": [ + { + "cost_center": { + "id": "87654321-4321-4321-4321-210987654321", + "name": "Marketing Team" + } + } + ] + } + }, + "repository_with_membership": { + "value": { + "resource": { + "type": "repository", + "identifier": { + "owner": "github", + "name": "docs" + } + }, + "memberships": [ + { + "cost_center": { + "id": "11111111-2222-3333-4444-555555555555", + "name": "Documentation Team" + } + } + ] + } + }, + "user_without_membership": { + "value": { + "resource": { + "type": "user", + "identifier": { + "login": "octocat" + } + }, + "memberships": [] + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "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" + } + } + } + }, + "application/scim+json": { + "schema": { + "title": "Scim Error", + "description": "Scim Error", + "type": "object", + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "documentation_url": { + "type": [ + "string", + "null" + ] + }, + "detail": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "integer" + }, + "scimType": { + "type": [ + "string", + "null" + ] + }, + "schemas": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "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" + } + } + } + } + } + }, + "404": { + "description": "Resource not found", + "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" + } + } + } + } + } + }, + "500": { + "description": "Internal Error", + "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": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": true, + "enabledForGitHubApps": true, + "category": "billing", + "subcategory": "cost-centers" + } + } + }, "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": { "get": { "summary": "Get a cost center by ID", diff --git a/descriptions-next/ghec/dereferenced/ghec.2026-03-10.deref.yaml b/descriptions-next/ghec/dereferenced/ghec.2026-03-10.deref.yaml index a5672b5819..9d361eb7f9 100644 --- a/descriptions-next/ghec/dereferenced/ghec.2026-03-10.deref.yaml +++ b/descriptions-next/ghec/dereferenced/ghec.2026-03-10.deref.yaml @@ -47250,6 +47250,169 @@ paths: enabledForGitHubApps: true category: billing subcategory: cost-centers + "/enterprises/{enterprise}/settings/billing/cost-centers/memberships": + get: + summary: Get cost center membership for a resource + description: |- + Gets the cost center membership information for a specified resource (user, organization, repository, or enterprise team). + Enterprise owners, billing managers, and organization owners in the enterprise can view membership information. A custom role holder with fine-grained read access to enterprise billing can also view membership information. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get cost center membership information for any resource in the enterprise. + Organization owners are limited to organizations they own, users who belong to those organizations, repositories they can see, and enterprise teams visible to them. + tags: + - billing + operationId: billing/get-cost-center-membership + externalDocs: + description: API method documentation + url: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-cost-center-membership-for-a-resource + parameters: + - *36 + - name: resource_type + in: query + required: true + description: 'The type of resource to lookup. Must be one of: user, repository, + organization, team.' + schema: + type: string + enum: + - user + - repository + - organization + - team + - name: name + in: query + required: true + description: The identifier for the resource. For users and organizations, + this is the login or organization name. For repositories, use the format + "owner/repo". For teams, use the enterprise team slug. + schema: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + resource: + type: object + properties: + type: + type: string + enum: + - user + - organization + - repository + - team + description: The type of resource. + identifier: + type: object + oneOf: + - properties: + login: + type: string + description: The login name for a user. + required: + - login + additionalProperties: false + - properties: + name: + type: string + description: The name for an organization. + required: + - name + additionalProperties: false + - properties: + owner: + type: string + description: The owner of the repository. + name: + type: string + description: The name of the repository. + required: + - owner + - name + additionalProperties: false + - properties: + slug: + type: string + description: The slug for an enterprise team. + required: + - slug + additionalProperties: false + description: The identifier for the resource. + required: + - type + - identifier + memberships: + type: array + items: + type: object + properties: + cost_center: + type: object + properties: + id: + type: string + description: The unique identifier of the cost center. + name: + type: string + description: The name of the cost center. + required: + - id + - name + description: The list of cost center memberships for the resource. + required: + - resource + - memberships + examples: + user_with_membership: + value: + resource: + type: user + identifier: + login: octocat + memberships: + - cost_center: + id: 12345678-1234-1234-1234-123456789012 + name: Engineering Team + organization_with_membership: + value: + resource: + type: organization + identifier: + name: github + memberships: + - cost_center: + id: 87654321-4321-4321-4321-210987654321 + name: Marketing Team + repository_with_membership: + value: + resource: + type: repository + identifier: + owner: github + name: docs + memberships: + - cost_center: + id: 11111111-2222-3333-4444-555555555555 + name: Documentation Team + user_without_membership: + value: + resource: + type: user + identifier: + login: octocat + memberships: [] + '400': *14 + '403': *27 + '404': *6 + '500': *35 + '503': *133 + x-github: + githubCloudOnly: true + enabledForGitHubApps: true + category: billing + subcategory: cost-centers "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": get: summary: Get a cost center by ID diff --git a/descriptions-next/ghec/dereferenced/ghec.deref.json b/descriptions-next/ghec/dereferenced/ghec.deref.json index 6d4237830c..f18426a4ef 100644 --- a/descriptions-next/ghec/dereferenced/ghec.deref.json +++ b/descriptions-next/ghec/dereferenced/ghec.deref.json @@ -120788,6 +120788,418 @@ } } }, + "/enterprises/{enterprise}/settings/billing/cost-centers/memberships": { + "get": { + "summary": "Get cost center membership for a resource", + "description": "Gets the cost center membership information for a specified resource (user, organization, repository, or enterprise team).\nEnterprise owners, billing managers, and organization owners in the enterprise can view membership information. A custom role holder with fine-grained read access to enterprise billing can also view membership information. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get cost center membership information for any resource in the enterprise.\nOrganization owners are limited to organizations they own, users who belong to those organizations, repositories they can see, and enterprise teams visible to them.", + "tags": [ + "billing" + ], + "operationId": "billing/get-cost-center-membership", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-cost-center-membership-for-a-resource" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "resource_type", + "in": "query", + "required": true, + "description": "The type of resource to lookup. Must be one of: user, repository, organization, team.", + "schema": { + "type": "string", + "enum": [ + "user", + "repository", + "organization", + "team" + ] + } + }, + { + "name": "name", + "in": "query", + "required": true, + "description": "The identifier for the resource. For users and organizations, this is the login or organization name. For repositories, use the format \"owner/repo\". For teams, use the enterprise team slug.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "resource": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "user", + "organization", + "repository", + "team" + ], + "description": "The type of resource." + }, + "identifier": { + "type": "object", + "oneOf": [ + { + "properties": { + "login": { + "type": "string", + "description": "The login name for a user." + } + }, + "required": [ + "login" + ], + "additionalProperties": false + }, + { + "properties": { + "name": { + "type": "string", + "description": "The name for an organization." + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + { + "properties": { + "owner": { + "type": "string", + "description": "The owner of the repository." + }, + "name": { + "type": "string", + "description": "The name of the repository." + } + }, + "required": [ + "owner", + "name" + ], + "additionalProperties": false + }, + { + "properties": { + "slug": { + "type": "string", + "description": "The slug for an enterprise team." + } + }, + "required": [ + "slug" + ], + "additionalProperties": false + } + ], + "description": "The identifier for the resource." + } + }, + "required": [ + "type", + "identifier" + ] + }, + "memberships": { + "type": "array", + "items": { + "type": "object", + "properties": { + "cost_center": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the cost center." + }, + "name": { + "type": "string", + "description": "The name of the cost center." + } + }, + "required": [ + "id", + "name" + ] + } + } + }, + "description": "The list of cost center memberships for the resource." + } + }, + "required": [ + "resource", + "memberships" + ] + }, + "examples": { + "user_with_membership": { + "value": { + "resource": { + "type": "user", + "identifier": { + "login": "octocat" + } + }, + "memberships": [ + { + "cost_center": { + "id": "12345678-1234-1234-1234-123456789012", + "name": "Engineering Team" + } + } + ] + } + }, + "organization_with_membership": { + "value": { + "resource": { + "type": "organization", + "identifier": { + "name": "github" + } + }, + "memberships": [ + { + "cost_center": { + "id": "87654321-4321-4321-4321-210987654321", + "name": "Marketing Team" + } + } + ] + } + }, + "repository_with_membership": { + "value": { + "resource": { + "type": "repository", + "identifier": { + "owner": "github", + "name": "docs" + } + }, + "memberships": [ + { + "cost_center": { + "id": "11111111-2222-3333-4444-555555555555", + "name": "Documentation Team" + } + } + ] + } + }, + "user_without_membership": { + "value": { + "resource": { + "type": "user", + "identifier": { + "login": "octocat" + } + }, + "memberships": [] + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "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" + } + } + } + }, + "application/scim+json": { + "schema": { + "title": "Scim Error", + "description": "Scim Error", + "type": "object", + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "documentation_url": { + "type": [ + "string", + "null" + ] + }, + "detail": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "integer" + }, + "scimType": { + "type": [ + "string", + "null" + ] + }, + "schemas": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "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" + } + } + } + } + } + }, + "404": { + "description": "Resource not found", + "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" + } + } + } + } + } + }, + "500": { + "description": "Internal Error", + "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": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": true, + "enabledForGitHubApps": true, + "category": "billing", + "subcategory": "cost-centers" + } + } + }, "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": { "get": { "summary": "Get a cost center by ID", diff --git a/descriptions-next/ghec/dereferenced/ghec.deref.yaml b/descriptions-next/ghec/dereferenced/ghec.deref.yaml index beef182d4b..cfe9069c26 100644 --- a/descriptions-next/ghec/dereferenced/ghec.deref.yaml +++ b/descriptions-next/ghec/dereferenced/ghec.deref.yaml @@ -47538,6 +47538,169 @@ paths: enabledForGitHubApps: true category: billing subcategory: cost-centers + "/enterprises/{enterprise}/settings/billing/cost-centers/memberships": + get: + summary: Get cost center membership for a resource + description: |- + Gets the cost center membership information for a specified resource (user, organization, repository, or enterprise team). + Enterprise owners, billing managers, and organization owners in the enterprise can view membership information. A custom role holder with fine-grained read access to enterprise billing can also view membership information. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get cost center membership information for any resource in the enterprise. + Organization owners are limited to organizations they own, users who belong to those organizations, repositories they can see, and enterprise teams visible to them. + tags: + - billing + operationId: billing/get-cost-center-membership + externalDocs: + description: API method documentation + url: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-cost-center-membership-for-a-resource + parameters: + - *36 + - name: resource_type + in: query + required: true + description: 'The type of resource to lookup. Must be one of: user, repository, + organization, team.' + schema: + type: string + enum: + - user + - repository + - organization + - team + - name: name + in: query + required: true + description: The identifier for the resource. For users and organizations, + this is the login or organization name. For repositories, use the format + "owner/repo". For teams, use the enterprise team slug. + schema: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + properties: + resource: + type: object + properties: + type: + type: string + enum: + - user + - organization + - repository + - team + description: The type of resource. + identifier: + type: object + oneOf: + - properties: + login: + type: string + description: The login name for a user. + required: + - login + additionalProperties: false + - properties: + name: + type: string + description: The name for an organization. + required: + - name + additionalProperties: false + - properties: + owner: + type: string + description: The owner of the repository. + name: + type: string + description: The name of the repository. + required: + - owner + - name + additionalProperties: false + - properties: + slug: + type: string + description: The slug for an enterprise team. + required: + - slug + additionalProperties: false + description: The identifier for the resource. + required: + - type + - identifier + memberships: + type: array + items: + type: object + properties: + cost_center: + type: object + properties: + id: + type: string + description: The unique identifier of the cost center. + name: + type: string + description: The name of the cost center. + required: + - id + - name + description: The list of cost center memberships for the resource. + required: + - resource + - memberships + examples: + user_with_membership: + value: + resource: + type: user + identifier: + login: octocat + memberships: + - cost_center: + id: 12345678-1234-1234-1234-123456789012 + name: Engineering Team + organization_with_membership: + value: + resource: + type: organization + identifier: + name: github + memberships: + - cost_center: + id: 87654321-4321-4321-4321-210987654321 + name: Marketing Team + repository_with_membership: + value: + resource: + type: repository + identifier: + owner: github + name: docs + memberships: + - cost_center: + id: 11111111-2222-3333-4444-555555555555 + name: Documentation Team + user_without_membership: + value: + resource: + type: user + identifier: + login: octocat + memberships: [] + '400': *14 + '403': *27 + '404': *6 + '500': *35 + '503': *133 + x-github: + githubCloudOnly: true + enabledForGitHubApps: true + category: billing + subcategory: cost-centers "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": get: summary: Get a cost center by ID diff --git a/descriptions-next/ghec/ghec.2022-11-28.json b/descriptions-next/ghec/ghec.2022-11-28.json index 65a76c384e..e936e5690d 100644 --- a/descriptions-next/ghec/ghec.2022-11-28.json +++ b/descriptions-next/ghec/ghec.2022-11-28.json @@ -36219,6 +36219,75 @@ } } }, + "/enterprises/{enterprise}/settings/billing/cost-centers/memberships": { + "get": { + "summary": "Get cost center membership for a resource", + "description": "Gets the cost center membership information for a specified resource (user, organization, repository, or enterprise team).\nEnterprise owners, billing managers, and organization owners in the enterprise can view membership information. A custom role holder with fine-grained read access to enterprise billing can also view membership information. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get cost center membership information for any resource in the enterprise.\nOrganization owners are limited to organizations they own, users who belong to those organizations, repositories they can see, and enterprise teams visible to them.", + "tags": [ + "billing" + ], + "operationId": "billing/get-cost-center-membership", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-cost-center-membership-for-a-resource" + }, + "parameters": [ + { + "$ref": "#/components/parameters/enterprise" + }, + { + "name": "resource_type", + "in": "query", + "required": true, + "description": "The type of resource to lookup. Must be one of: user, repository, organization, team.", + "schema": { + "type": "string", + "enum": [ + "user", + "repository", + "organization", + "team" + ] + } + }, + { + "name": "name", + "in": "query", + "required": true, + "description": "The identifier for the resource. For users and organizations, this is the login or organization name. For repositories, use the format \"owner/repo\". For teams, use the enterprise team slug.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/billing-cost-center-membership" + }, + "400": { + "$ref": "#/components/responses/bad_request" + }, + "403": { + "$ref": "#/components/responses/forbidden" + }, + "404": { + "$ref": "#/components/responses/not_found" + }, + "500": { + "$ref": "#/components/responses/internal_error" + }, + "503": { + "$ref": "#/components/responses/service_unavailable" + } + }, + "x-github": { + "githubCloudOnly": true, + "enabledForGitHubApps": true, + "category": "billing", + "subcategory": "cost-centers" + } + } + }, "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": { "get": { "summary": "Get a cost center by ID", @@ -174819,6 +174888,119 @@ } } }, + "billing-cost-center-membership": { + "type": "object", + "properties": { + "resource": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "user", + "organization", + "repository", + "team" + ], + "description": "The type of resource." + }, + "identifier": { + "type": "object", + "oneOf": [ + { + "properties": { + "login": { + "type": "string", + "description": "The login name for a user." + } + }, + "required": [ + "login" + ], + "additionalProperties": false + }, + { + "properties": { + "name": { + "type": "string", + "description": "The name for an organization." + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + { + "properties": { + "owner": { + "type": "string", + "description": "The owner of the repository." + }, + "name": { + "type": "string", + "description": "The name of the repository." + } + }, + "required": [ + "owner", + "name" + ], + "additionalProperties": false + }, + { + "properties": { + "slug": { + "type": "string", + "description": "The slug for an enterprise team." + } + }, + "required": [ + "slug" + ], + "additionalProperties": false + } + ], + "description": "The identifier for the resource." + } + }, + "required": [ + "type", + "identifier" + ] + }, + "memberships": { + "type": "array", + "items": { + "type": "object", + "properties": { + "cost_center": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the cost center." + }, + "name": { + "type": "string", + "description": "The name of the cost center." + } + }, + "required": [ + "id", + "name" + ] + } + } + }, + "description": "The list of cost center memberships for the resource." + } + }, + "required": [ + "resource", + "memberships" + ] + }, "get-cost-center": { "type": "object", "properties": { @@ -373461,6 +373643,72 @@ ] } }, + "billing-cost-center-membership-user": { + "value": { + "resource": { + "type": "user", + "identifier": { + "login": "octocat" + } + }, + "memberships": [ + { + "cost_center": { + "id": "12345678-1234-1234-1234-123456789012", + "name": "Engineering Team" + } + } + ] + } + }, + "billing-cost-center-membership-org": { + "value": { + "resource": { + "type": "organization", + "identifier": { + "name": "github" + } + }, + "memberships": [ + { + "cost_center": { + "id": "87654321-4321-4321-4321-210987654321", + "name": "Marketing Team" + } + } + ] + } + }, + "billing-cost-center-membership-repo": { + "value": { + "resource": { + "type": "repository", + "identifier": { + "owner": "github", + "name": "docs" + } + }, + "memberships": [ + { + "cost_center": { + "id": "11111111-2222-3333-4444-555555555555", + "name": "Documentation Team" + } + } + ] + } + }, + "billing-cost-center-membership-none": { + "value": { + "resource": { + "type": "user", + "identifier": { + "login": "octocat" + } + }, + "memberships": [] + } + }, "get-cost-center": { "value": { "id": "2eeb8ffe-6903-11ee-8c99-0242ac120002", @@ -406670,6 +406918,30 @@ } } }, + "billing-cost-center-membership": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/billing-cost-center-membership" + }, + "examples": { + "user_with_membership": { + "$ref": "#/components/examples/billing-cost-center-membership-user" + }, + "organization_with_membership": { + "$ref": "#/components/examples/billing-cost-center-membership-org" + }, + "repository_with_membership": { + "$ref": "#/components/examples/billing-cost-center-membership-repo" + }, + "user_without_membership": { + "$ref": "#/components/examples/billing-cost-center-membership-none" + } + } + } + } + }, "get_cost_center": { "description": "Response when getting a cost center", "content": { diff --git a/descriptions-next/ghec/ghec.2022-11-28.yaml b/descriptions-next/ghec/ghec.2022-11-28.yaml index abad62cbb7..d5ea59d20e 100644 --- a/descriptions-next/ghec/ghec.2022-11-28.yaml +++ b/descriptions-next/ghec/ghec.2022-11-28.yaml @@ -30553,6 +30553,59 @@ paths: enabledForGitHubApps: true category: billing subcategory: cost-centers + "/enterprises/{enterprise}/settings/billing/cost-centers/memberships": + get: + summary: Get cost center membership for a resource + description: |- + Gets the cost center membership information for a specified resource (user, organization, repository, or enterprise team). + Enterprise owners, billing managers, and organization owners in the enterprise can view membership information. A custom role holder with fine-grained read access to enterprise billing can also view membership information. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get cost center membership information for any resource in the enterprise. + Organization owners are limited to organizations they own, users who belong to those organizations, repositories they can see, and enterprise teams visible to them. + tags: + - billing + operationId: billing/get-cost-center-membership + externalDocs: + description: API method documentation + url: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-cost-center-membership-for-a-resource + parameters: + - "$ref": "#/components/parameters/enterprise" + - name: resource_type + in: query + required: true + description: 'The type of resource to lookup. Must be one of: user, repository, + organization, team.' + schema: + type: string + enum: + - user + - repository + - organization + - team + - name: name + in: query + required: true + description: The identifier for the resource. For users and organizations, + this is the login or organization name. For repositories, use the format + "owner/repo". For teams, use the enterprise team slug. + schema: + type: string + responses: + '200': + "$ref": "#/components/responses/billing-cost-center-membership" + '400': + "$ref": "#/components/responses/bad_request" + '403': + "$ref": "#/components/responses/forbidden" + '404': + "$ref": "#/components/responses/not_found" + '500': + "$ref": "#/components/responses/internal_error" + '503': + "$ref": "#/components/responses/service_unavailable" + x-github: + githubCloudOnly: true + enabledForGitHubApps: true + category: billing + subcategory: cost-centers "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": get: summary: Get a cost center by ID @@ -131432,6 +131485,80 @@ components: - id - name - resources + billing-cost-center-membership: + type: object + properties: + resource: + type: object + properties: + type: + type: string + enum: + - user + - organization + - repository + - team + description: The type of resource. + identifier: + type: object + oneOf: + - properties: + login: + type: string + description: The login name for a user. + required: + - login + additionalProperties: false + - properties: + name: + type: string + description: The name for an organization. + required: + - name + additionalProperties: false + - properties: + owner: + type: string + description: The owner of the repository. + name: + type: string + description: The name of the repository. + required: + - owner + - name + additionalProperties: false + - properties: + slug: + type: string + description: The slug for an enterprise team. + required: + - slug + additionalProperties: false + description: The identifier for the resource. + required: + - type + - identifier + memberships: + type: array + items: + type: object + properties: + cost_center: + type: object + properties: + id: + type: string + description: The unique identifier of the cost center. + name: + type: string + description: The name of the cost center. + required: + - id + - name + description: The list of cost center memberships for the resource. + required: + - resource + - memberships get-cost-center: type: object properties: @@ -278987,6 +279114,44 @@ components: - type: Repo name: octocat/hello-world ai_credit_pool_enabled: false + billing-cost-center-membership-user: + value: + resource: + type: user + identifier: + login: octocat + memberships: + - cost_center: + id: 12345678-1234-1234-1234-123456789012 + name: Engineering Team + billing-cost-center-membership-org: + value: + resource: + type: organization + identifier: + name: github + memberships: + - cost_center: + id: 87654321-4321-4321-4321-210987654321 + name: Marketing Team + billing-cost-center-membership-repo: + value: + resource: + type: repository + identifier: + owner: github + name: docs + memberships: + - cost_center: + id: 11111111-2222-3333-4444-555555555555 + name: Documentation Team + billing-cost-center-membership-none: + value: + resource: + type: user + identifier: + login: octocat + memberships: [] get-cost-center: value: id: 2eeb8ffe-6903-11ee-8c99-0242ac120002 @@ -307451,6 +307616,21 @@ components: examples: default: "$ref": "#/components/examples/get-all-cost-centers" + billing-cost-center-membership: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/billing-cost-center-membership" + examples: + user_with_membership: + "$ref": "#/components/examples/billing-cost-center-membership-user" + organization_with_membership: + "$ref": "#/components/examples/billing-cost-center-membership-org" + repository_with_membership: + "$ref": "#/components/examples/billing-cost-center-membership-repo" + user_without_membership: + "$ref": "#/components/examples/billing-cost-center-membership-none" get_cost_center: description: Response when getting a cost center content: diff --git a/descriptions-next/ghec/ghec.2026-03-10.json b/descriptions-next/ghec/ghec.2026-03-10.json index a8c8bc6f73..1c2cfdbf83 100644 --- a/descriptions-next/ghec/ghec.2026-03-10.json +++ b/descriptions-next/ghec/ghec.2026-03-10.json @@ -36219,6 +36219,75 @@ } } }, + "/enterprises/{enterprise}/settings/billing/cost-centers/memberships": { + "get": { + "summary": "Get cost center membership for a resource", + "description": "Gets the cost center membership information for a specified resource (user, organization, repository, or enterprise team).\nEnterprise owners, billing managers, and organization owners in the enterprise can view membership information. A custom role holder with fine-grained read access to enterprise billing can also view membership information. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get cost center membership information for any resource in the enterprise.\nOrganization owners are limited to organizations they own, users who belong to those organizations, repositories they can see, and enterprise teams visible to them.", + "tags": [ + "billing" + ], + "operationId": "billing/get-cost-center-membership", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-cost-center-membership-for-a-resource" + }, + "parameters": [ + { + "$ref": "#/components/parameters/enterprise" + }, + { + "name": "resource_type", + "in": "query", + "required": true, + "description": "The type of resource to lookup. Must be one of: user, repository, organization, team.", + "schema": { + "type": "string", + "enum": [ + "user", + "repository", + "organization", + "team" + ] + } + }, + { + "name": "name", + "in": "query", + "required": true, + "description": "The identifier for the resource. For users and organizations, this is the login or organization name. For repositories, use the format \"owner/repo\". For teams, use the enterprise team slug.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/billing-cost-center-membership" + }, + "400": { + "$ref": "#/components/responses/bad_request" + }, + "403": { + "$ref": "#/components/responses/forbidden" + }, + "404": { + "$ref": "#/components/responses/not_found" + }, + "500": { + "$ref": "#/components/responses/internal_error" + }, + "503": { + "$ref": "#/components/responses/service_unavailable" + } + }, + "x-github": { + "githubCloudOnly": true, + "enabledForGitHubApps": true, + "category": "billing", + "subcategory": "cost-centers" + } + } + }, "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": { "get": { "summary": "Get a cost center by ID", @@ -174572,6 +174641,119 @@ } } }, + "billing-cost-center-membership": { + "type": "object", + "properties": { + "resource": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "user", + "organization", + "repository", + "team" + ], + "description": "The type of resource." + }, + "identifier": { + "type": "object", + "oneOf": [ + { + "properties": { + "login": { + "type": "string", + "description": "The login name for a user." + } + }, + "required": [ + "login" + ], + "additionalProperties": false + }, + { + "properties": { + "name": { + "type": "string", + "description": "The name for an organization." + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + { + "properties": { + "owner": { + "type": "string", + "description": "The owner of the repository." + }, + "name": { + "type": "string", + "description": "The name of the repository." + } + }, + "required": [ + "owner", + "name" + ], + "additionalProperties": false + }, + { + "properties": { + "slug": { + "type": "string", + "description": "The slug for an enterprise team." + } + }, + "required": [ + "slug" + ], + "additionalProperties": false + } + ], + "description": "The identifier for the resource." + } + }, + "required": [ + "type", + "identifier" + ] + }, + "memberships": { + "type": "array", + "items": { + "type": "object", + "properties": { + "cost_center": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the cost center." + }, + "name": { + "type": "string", + "description": "The name of the cost center." + } + }, + "required": [ + "id", + "name" + ] + } + } + }, + "description": "The list of cost center memberships for the resource." + } + }, + "required": [ + "resource", + "memberships" + ] + }, "get-cost-center": { "type": "object", "properties": { @@ -372585,6 +372767,72 @@ ] } }, + "billing-cost-center-membership-user": { + "value": { + "resource": { + "type": "user", + "identifier": { + "login": "octocat" + } + }, + "memberships": [ + { + "cost_center": { + "id": "12345678-1234-1234-1234-123456789012", + "name": "Engineering Team" + } + } + ] + } + }, + "billing-cost-center-membership-org": { + "value": { + "resource": { + "type": "organization", + "identifier": { + "name": "github" + } + }, + "memberships": [ + { + "cost_center": { + "id": "87654321-4321-4321-4321-210987654321", + "name": "Marketing Team" + } + } + ] + } + }, + "billing-cost-center-membership-repo": { + "value": { + "resource": { + "type": "repository", + "identifier": { + "owner": "github", + "name": "docs" + } + }, + "memberships": [ + { + "cost_center": { + "id": "11111111-2222-3333-4444-555555555555", + "name": "Documentation Team" + } + } + ] + } + }, + "billing-cost-center-membership-none": { + "value": { + "resource": { + "type": "user", + "identifier": { + "login": "octocat" + } + }, + "memberships": [] + } + }, "get-cost-center": { "value": { "id": "2eeb8ffe-6903-11ee-8c99-0242ac120002", @@ -405693,6 +405941,30 @@ } } }, + "billing-cost-center-membership": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/billing-cost-center-membership" + }, + "examples": { + "user_with_membership": { + "$ref": "#/components/examples/billing-cost-center-membership-user" + }, + "organization_with_membership": { + "$ref": "#/components/examples/billing-cost-center-membership-org" + }, + "repository_with_membership": { + "$ref": "#/components/examples/billing-cost-center-membership-repo" + }, + "user_without_membership": { + "$ref": "#/components/examples/billing-cost-center-membership-none" + } + } + } + } + }, "get_cost_center": { "description": "Response when getting a cost center", "content": { diff --git a/descriptions-next/ghec/ghec.2026-03-10.yaml b/descriptions-next/ghec/ghec.2026-03-10.yaml index 727ff8dbce..657fb7eec9 100644 --- a/descriptions-next/ghec/ghec.2026-03-10.yaml +++ b/descriptions-next/ghec/ghec.2026-03-10.yaml @@ -30553,6 +30553,59 @@ paths: enabledForGitHubApps: true category: billing subcategory: cost-centers + "/enterprises/{enterprise}/settings/billing/cost-centers/memberships": + get: + summary: Get cost center membership for a resource + description: |- + Gets the cost center membership information for a specified resource (user, organization, repository, or enterprise team). + Enterprise owners, billing managers, and organization owners in the enterprise can view membership information. A custom role holder with fine-grained read access to enterprise billing can also view membership information. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get cost center membership information for any resource in the enterprise. + Organization owners are limited to organizations they own, users who belong to those organizations, repositories they can see, and enterprise teams visible to them. + tags: + - billing + operationId: billing/get-cost-center-membership + externalDocs: + description: API method documentation + url: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-cost-center-membership-for-a-resource + parameters: + - "$ref": "#/components/parameters/enterprise" + - name: resource_type + in: query + required: true + description: 'The type of resource to lookup. Must be one of: user, repository, + organization, team.' + schema: + type: string + enum: + - user + - repository + - organization + - team + - name: name + in: query + required: true + description: The identifier for the resource. For users and organizations, + this is the login or organization name. For repositories, use the format + "owner/repo". For teams, use the enterprise team slug. + schema: + type: string + responses: + '200': + "$ref": "#/components/responses/billing-cost-center-membership" + '400': + "$ref": "#/components/responses/bad_request" + '403': + "$ref": "#/components/responses/forbidden" + '404': + "$ref": "#/components/responses/not_found" + '500': + "$ref": "#/components/responses/internal_error" + '503': + "$ref": "#/components/responses/service_unavailable" + x-github: + githubCloudOnly: true + enabledForGitHubApps: true + category: billing + subcategory: cost-centers "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": get: summary: Get a cost center by ID @@ -131237,6 +131290,80 @@ components: - id - name - resources + billing-cost-center-membership: + type: object + properties: + resource: + type: object + properties: + type: + type: string + enum: + - user + - organization + - repository + - team + description: The type of resource. + identifier: + type: object + oneOf: + - properties: + login: + type: string + description: The login name for a user. + required: + - login + additionalProperties: false + - properties: + name: + type: string + description: The name for an organization. + required: + - name + additionalProperties: false + - properties: + owner: + type: string + description: The owner of the repository. + name: + type: string + description: The name of the repository. + required: + - owner + - name + additionalProperties: false + - properties: + slug: + type: string + description: The slug for an enterprise team. + required: + - slug + additionalProperties: false + description: The identifier for the resource. + required: + - type + - identifier + memberships: + type: array + items: + type: object + properties: + cost_center: + type: object + properties: + id: + type: string + description: The unique identifier of the cost center. + name: + type: string + description: The name of the cost center. + required: + - id + - name + description: The list of cost center memberships for the resource. + required: + - resource + - memberships get-cost-center: type: object properties: @@ -278264,6 +278391,44 @@ components: - type: Repo name: octocat/hello-world ai_credit_pool_enabled: false + billing-cost-center-membership-user: + value: + resource: + type: user + identifier: + login: octocat + memberships: + - cost_center: + id: 12345678-1234-1234-1234-123456789012 + name: Engineering Team + billing-cost-center-membership-org: + value: + resource: + type: organization + identifier: + name: github + memberships: + - cost_center: + id: 87654321-4321-4321-4321-210987654321 + name: Marketing Team + billing-cost-center-membership-repo: + value: + resource: + type: repository + identifier: + owner: github + name: docs + memberships: + - cost_center: + id: 11111111-2222-3333-4444-555555555555 + name: Documentation Team + billing-cost-center-membership-none: + value: + resource: + type: user + identifier: + login: octocat + memberships: [] get-cost-center: value: id: 2eeb8ffe-6903-11ee-8c99-0242ac120002 @@ -306633,6 +306798,21 @@ components: examples: default: "$ref": "#/components/examples/get-all-cost-centers" + billing-cost-center-membership: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/billing-cost-center-membership" + examples: + user_with_membership: + "$ref": "#/components/examples/billing-cost-center-membership-user" + organization_with_membership: + "$ref": "#/components/examples/billing-cost-center-membership-org" + repository_with_membership: + "$ref": "#/components/examples/billing-cost-center-membership-repo" + user_without_membership: + "$ref": "#/components/examples/billing-cost-center-membership-none" get_cost_center: description: Response when getting a cost center content: diff --git a/descriptions-next/ghec/ghec.json b/descriptions-next/ghec/ghec.json index 97d4a8b25e..d045f5337f 100644 --- a/descriptions-next/ghec/ghec.json +++ b/descriptions-next/ghec/ghec.json @@ -36233,6 +36233,75 @@ } } }, + "/enterprises/{enterprise}/settings/billing/cost-centers/memberships": { + "get": { + "summary": "Get cost center membership for a resource", + "description": "Gets the cost center membership information for a specified resource (user, organization, repository, or enterprise team).\nEnterprise owners, billing managers, and organization owners in the enterprise can view membership information. A custom role holder with fine-grained read access to enterprise billing can also view membership information. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get cost center membership information for any resource in the enterprise.\nOrganization owners are limited to organizations they own, users who belong to those organizations, repositories they can see, and enterprise teams visible to them.", + "tags": [ + "billing" + ], + "operationId": "billing/get-cost-center-membership", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-cost-center-membership-for-a-resource" + }, + "parameters": [ + { + "$ref": "#/components/parameters/enterprise" + }, + { + "name": "resource_type", + "in": "query", + "required": true, + "description": "The type of resource to lookup. Must be one of: user, repository, organization, team.", + "schema": { + "type": "string", + "enum": [ + "user", + "repository", + "organization", + "team" + ] + } + }, + { + "name": "name", + "in": "query", + "required": true, + "description": "The identifier for the resource. For users and organizations, this is the login or organization name. For repositories, use the format \"owner/repo\". For teams, use the enterprise team slug.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/billing-cost-center-membership" + }, + "400": { + "$ref": "#/components/responses/bad_request" + }, + "403": { + "$ref": "#/components/responses/forbidden" + }, + "404": { + "$ref": "#/components/responses/not_found" + }, + "500": { + "$ref": "#/components/responses/internal_error" + }, + "503": { + "$ref": "#/components/responses/service_unavailable" + } + }, + "x-github": { + "githubCloudOnly": true, + "enabledForGitHubApps": true, + "category": "billing", + "subcategory": "cost-centers" + } + } + }, "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": { "get": { "summary": "Get a cost center by ID", @@ -175498,6 +175567,119 @@ } } }, + "billing-cost-center-membership": { + "type": "object", + "properties": { + "resource": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "user", + "organization", + "repository", + "team" + ], + "description": "The type of resource." + }, + "identifier": { + "type": "object", + "oneOf": [ + { + "properties": { + "login": { + "type": "string", + "description": "The login name for a user." + } + }, + "required": [ + "login" + ], + "additionalProperties": false + }, + { + "properties": { + "name": { + "type": "string", + "description": "The name for an organization." + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + { + "properties": { + "owner": { + "type": "string", + "description": "The owner of the repository." + }, + "name": { + "type": "string", + "description": "The name of the repository." + } + }, + "required": [ + "owner", + "name" + ], + "additionalProperties": false + }, + { + "properties": { + "slug": { + "type": "string", + "description": "The slug for an enterprise team." + } + }, + "required": [ + "slug" + ], + "additionalProperties": false + } + ], + "description": "The identifier for the resource." + } + }, + "required": [ + "type", + "identifier" + ] + }, + "memberships": { + "type": "array", + "items": { + "type": "object", + "properties": { + "cost_center": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the cost center." + }, + "name": { + "type": "string", + "description": "The name of the cost center." + } + }, + "required": [ + "id", + "name" + ] + } + } + }, + "description": "The list of cost center memberships for the resource." + } + }, + "required": [ + "resource", + "memberships" + ] + }, "get-cost-center": { "type": "object", "properties": { @@ -375430,6 +375612,72 @@ ] } }, + "billing-cost-center-membership-user": { + "value": { + "resource": { + "type": "user", + "identifier": { + "login": "octocat" + } + }, + "memberships": [ + { + "cost_center": { + "id": "12345678-1234-1234-1234-123456789012", + "name": "Engineering Team" + } + } + ] + } + }, + "billing-cost-center-membership-org": { + "value": { + "resource": { + "type": "organization", + "identifier": { + "name": "github" + } + }, + "memberships": [ + { + "cost_center": { + "id": "87654321-4321-4321-4321-210987654321", + "name": "Marketing Team" + } + } + ] + } + }, + "billing-cost-center-membership-repo": { + "value": { + "resource": { + "type": "repository", + "identifier": { + "owner": "github", + "name": "docs" + } + }, + "memberships": [ + { + "cost_center": { + "id": "11111111-2222-3333-4444-555555555555", + "name": "Documentation Team" + } + } + ] + } + }, + "billing-cost-center-membership-none": { + "value": { + "resource": { + "type": "user", + "identifier": { + "login": "octocat" + } + }, + "memberships": [] + } + }, "get-cost-center": { "value": { "id": "2eeb8ffe-6903-11ee-8c99-0242ac120002", @@ -408838,6 +409086,30 @@ } } }, + "billing-cost-center-membership": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/billing-cost-center-membership" + }, + "examples": { + "user_with_membership": { + "$ref": "#/components/examples/billing-cost-center-membership-user" + }, + "organization_with_membership": { + "$ref": "#/components/examples/billing-cost-center-membership-org" + }, + "repository_with_membership": { + "$ref": "#/components/examples/billing-cost-center-membership-repo" + }, + "user_without_membership": { + "$ref": "#/components/examples/billing-cost-center-membership-none" + } + } + } + } + }, "get_cost_center": { "description": "Response when getting a cost center", "content": { diff --git a/descriptions-next/ghec/ghec.yaml b/descriptions-next/ghec/ghec.yaml index d08e64fc0d..2944fade5a 100644 --- a/descriptions-next/ghec/ghec.yaml +++ b/descriptions-next/ghec/ghec.yaml @@ -30561,6 +30561,59 @@ paths: enabledForGitHubApps: true category: billing subcategory: cost-centers + "/enterprises/{enterprise}/settings/billing/cost-centers/memberships": + get: + summary: Get cost center membership for a resource + description: |- + Gets the cost center membership information for a specified resource (user, organization, repository, or enterprise team). + Enterprise owners, billing managers, and organization owners in the enterprise can view membership information. A custom role holder with fine-grained read access to enterprise billing can also view membership information. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get cost center membership information for any resource in the enterprise. + Organization owners are limited to organizations they own, users who belong to those organizations, repositories they can see, and enterprise teams visible to them. + tags: + - billing + operationId: billing/get-cost-center-membership + externalDocs: + description: API method documentation + url: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-cost-center-membership-for-a-resource + parameters: + - "$ref": "#/components/parameters/enterprise" + - name: resource_type + in: query + required: true + description: 'The type of resource to lookup. Must be one of: user, repository, + organization, team.' + schema: + type: string + enum: + - user + - repository + - organization + - team + - name: name + in: query + required: true + description: The identifier for the resource. For users and organizations, + this is the login or organization name. For repositories, use the format + "owner/repo". For teams, use the enterprise team slug. + schema: + type: string + responses: + '200': + "$ref": "#/components/responses/billing-cost-center-membership" + '400': + "$ref": "#/components/responses/bad_request" + '403': + "$ref": "#/components/responses/forbidden" + '404': + "$ref": "#/components/responses/not_found" + '500': + "$ref": "#/components/responses/internal_error" + '503': + "$ref": "#/components/responses/service_unavailable" + x-github: + githubCloudOnly: true + enabledForGitHubApps: true + category: billing + subcategory: cost-centers "/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}": get: summary: Get a cost center by ID @@ -131873,6 +131926,80 @@ components: - id - name - resources + billing-cost-center-membership: + type: object + properties: + resource: + type: object + properties: + type: + type: string + enum: + - user + - organization + - repository + - team + description: The type of resource. + identifier: + type: object + oneOf: + - properties: + login: + type: string + description: The login name for a user. + required: + - login + additionalProperties: false + - properties: + name: + type: string + description: The name for an organization. + required: + - name + additionalProperties: false + - properties: + owner: + type: string + description: The owner of the repository. + name: + type: string + description: The name of the repository. + required: + - owner + - name + additionalProperties: false + - properties: + slug: + type: string + description: The slug for an enterprise team. + required: + - slug + additionalProperties: false + description: The identifier for the resource. + required: + - type + - identifier + memberships: + type: array + items: + type: object + properties: + cost_center: + type: object + properties: + id: + type: string + description: The unique identifier of the cost center. + name: + type: string + description: The name of the cost center. + required: + - id + - name + description: The list of cost center memberships for the resource. + required: + - resource + - memberships get-cost-center: type: object properties: @@ -280254,6 +280381,44 @@ components: - type: Repo name: octocat/hello-world ai_credit_pool_enabled: false + billing-cost-center-membership-user: + value: + resource: + type: user + identifier: + login: octocat + memberships: + - cost_center: + id: 12345678-1234-1234-1234-123456789012 + name: Engineering Team + billing-cost-center-membership-org: + value: + resource: + type: organization + identifier: + name: github + memberships: + - cost_center: + id: 87654321-4321-4321-4321-210987654321 + name: Marketing Team + billing-cost-center-membership-repo: + value: + resource: + type: repository + identifier: + owner: github + name: docs + memberships: + - cost_center: + id: 11111111-2222-3333-4444-555555555555 + name: Documentation Team + billing-cost-center-membership-none: + value: + resource: + type: user + identifier: + login: octocat + memberships: [] get-cost-center: value: id: 2eeb8ffe-6903-11ee-8c99-0242ac120002 @@ -308818,6 +308983,21 @@ components: examples: default: "$ref": "#/components/examples/get-all-cost-centers" + billing-cost-center-membership: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/billing-cost-center-membership" + examples: + user_with_membership: + "$ref": "#/components/examples/billing-cost-center-membership-user" + organization_with_membership: + "$ref": "#/components/examples/billing-cost-center-membership-org" + repository_with_membership: + "$ref": "#/components/examples/billing-cost-center-membership-repo" + user_without_membership: + "$ref": "#/components/examples/billing-cost-center-membership-none" get_cost_center: description: Response when getting a cost center content: