diff --git a/descriptions/ghec/dereferenced/ghec.2022-11-28.deref.json b/descriptions/ghec/dereferenced/ghec.2022-11-28.deref.json index 9d0fc0a03a..dfb46f9837 100644 --- a/descriptions/ghec/dereferenced/ghec.2022-11-28.deref.json +++ b/descriptions/ghec/dereferenced/ghec.2022-11-28.deref.json @@ -112600,6 +112600,410 @@ } } }, + "/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", + "nullable": true + }, + "documentation_url": { + "type": "string", + "nullable": true + }, + "detail": { + "type": "string", + "nullable": true + }, + "status": { + "type": "integer" + }, + "scimType": { + "type": "string", + "nullable": true + }, + "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/ghec/dereferenced/ghec.2022-11-28.deref.yaml b/descriptions/ghec/dereferenced/ghec.2022-11-28.deref.yaml index 0cc4e4d46a..e12645bd41 100644 --- a/descriptions/ghec/dereferenced/ghec.2022-11-28.deref.yaml +++ b/descriptions/ghec/dereferenced/ghec.2022-11-28.deref.yaml @@ -46581,6 +46581,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: + - *38 + - 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': *29 + '404': *6 + '500': *37 + '503': *135 + 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/ghec/dereferenced/ghec.2026-03-10.deref.json b/descriptions/ghec/dereferenced/ghec.2026-03-10.deref.json index 9bd04b1c82..214ef09814 100644 --- a/descriptions/ghec/dereferenced/ghec.2026-03-10.deref.json +++ b/descriptions/ghec/dereferenced/ghec.2026-03-10.deref.json @@ -112057,6 +112057,410 @@ } } }, + "/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", + "nullable": true + }, + "documentation_url": { + "type": "string", + "nullable": true + }, + "detail": { + "type": "string", + "nullable": true + }, + "status": { + "type": "integer" + }, + "scimType": { + "type": "string", + "nullable": true + }, + "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/ghec/dereferenced/ghec.2026-03-10.deref.yaml b/descriptions/ghec/dereferenced/ghec.2026-03-10.deref.yaml index 258dfe0f3d..128272c440 100644 --- a/descriptions/ghec/dereferenced/ghec.2026-03-10.deref.yaml +++ b/descriptions/ghec/dereferenced/ghec.2026-03-10.deref.yaml @@ -46497,6 +46497,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: + - *38 + - 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': *29 + '404': *6 + '500': *37 + '503': *135 + 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/ghec/dereferenced/ghec.deref.json b/descriptions/ghec/dereferenced/ghec.deref.json index e7a57a23fe..7f352d04c1 100644 --- a/descriptions/ghec/dereferenced/ghec.deref.json +++ b/descriptions/ghec/dereferenced/ghec.deref.json @@ -113198,6 +113198,410 @@ } } }, + "/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", + "nullable": true + }, + "documentation_url": { + "type": "string", + "nullable": true + }, + "detail": { + "type": "string", + "nullable": true + }, + "status": { + "type": "integer" + }, + "scimType": { + "type": "string", + "nullable": true + }, + "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/ghec/dereferenced/ghec.deref.yaml b/descriptions/ghec/dereferenced/ghec.deref.yaml index 180fd0d5b8..0ce8fa896f 100644 --- a/descriptions/ghec/dereferenced/ghec.deref.yaml +++ b/descriptions/ghec/dereferenced/ghec.deref.yaml @@ -46783,6 +46783,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: + - *38 + - 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': *29 + '404': *6 + '500': *37 + '503': *135 + 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/ghec/ghec.2022-11-28.json b/descriptions/ghec/ghec.2022-11-28.json index 155391b2cb..d4139e0ad8 100644 --- a/descriptions/ghec/ghec.2022-11-28.json +++ b/descriptions/ghec/ghec.2022-11-28.json @@ -36077,6 +36077,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", @@ -173142,6 +173211,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": { @@ -362964,6 +363146,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", @@ -396153,6 +396401,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/ghec/ghec.2022-11-28.yaml b/descriptions/ghec/ghec.2022-11-28.yaml index a7449575a6..7505dccfdf 100644 --- a/descriptions/ghec/ghec.2022-11-28.yaml +++ b/descriptions/ghec/ghec.2022-11-28.yaml @@ -30482,6 +30482,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 @@ -130814,6 +130867,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: @@ -275197,6 +275324,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 @@ -303651,6 +303816,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/ghec/ghec.2026-03-10.json b/descriptions/ghec/ghec.2026-03-10.json index 2e9390a912..1c7e239f01 100644 --- a/descriptions/ghec/ghec.2026-03-10.json +++ b/descriptions/ghec/ghec.2026-03-10.json @@ -36077,6 +36077,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", @@ -172920,6 +172989,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": { @@ -362175,6 +362357,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", @@ -395263,6 +395511,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/ghec/ghec.2026-03-10.yaml b/descriptions/ghec/ghec.2026-03-10.yaml index 7142cf43cc..f83b9cc2c4 100644 --- a/descriptions/ghec/ghec.2026-03-10.yaml +++ b/descriptions/ghec/ghec.2026-03-10.yaml @@ -30482,6 +30482,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 @@ -130630,6 +130683,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: @@ -274489,6 +274616,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 @@ -302848,6 +303013,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/ghec/ghec.json b/descriptions/ghec/ghec.json index e532e34e92..dca811aa10 100644 --- a/descriptions/ghec/ghec.json +++ b/descriptions/ghec/ghec.json @@ -36091,6 +36091,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", @@ -173821,6 +173890,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": { @@ -365174,6 +365356,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", @@ -398562,6 +398810,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/ghec/ghec.yaml b/descriptions/ghec/ghec.yaml index de57a080c5..e53f80b22b 100644 --- a/descriptions/ghec/ghec.yaml +++ b/descriptions/ghec/ghec.yaml @@ -30490,6 +30490,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 @@ -131255,6 +131308,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: @@ -276645,6 +276772,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 @@ -305199,6 +305364,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: