diff --git a/lib/redirects/static/client-side-rest-api-redirects.json b/lib/redirects/static/client-side-rest-api-redirects.json index fc4b5f8ff2..6de397ceaa 100644 --- a/lib/redirects/static/client-side-rest-api-redirects.json +++ b/lib/redirects/static/client-side-rest-api-redirects.json @@ -331,6 +331,7 @@ "/rest/orgs#unblock-a-user-from-an-organization": "/rest/orgs/blocking#unblock-a-user-from-an-organization", "/rest/codespaces#list-in-organization": "/rest/codespaces/organizations#list-in-organization", "/rest/codespaces#organizations": "/rest/codespaces/organizations", + "/rest/codespaces#set-codespaces-billing": "/rest/codespaces/organizations#set-codespaces-billing", "/rest/orgs#create-a-custom-role": "/rest/orgs/custom-roles#create-a-custom-role", "/rest/orgs#update-a-custom-role": "/rest/orgs/custom-roles#update-a-custom-role", "/rest/orgs#delete-a-custom-role": "/rest/orgs/custom-roles#delete-a-custom-role", diff --git a/lib/rest/static/decorated/api.github.com.json b/lib/rest/static/decorated/api.github.com.json index 9a198785f7..ee6497db18 100644 --- a/lib/rest/static/decorated/api.github.com.json +++ b/lib/rest/static/decorated/api.github.com.json @@ -231725,6 +231725,99 @@ } ] }, + { + "serverUrl": "https://api.github.com", + "verb": "put", + "requestPath": "/orgs/{org}/codespaces/billing", + "title": "Set the visibility of organization codespaces", + "category": "codespaces", + "subcategory": "organizations", + "parameters": [ + { + "name": "org", + "description": "

The organization name. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "bodyParameters": [ + { + "type": "string", + "name": "visibility", + "in": "body", + "description": "

Which users can access codespaces in the organization. disabled means that no users can access codespaces in the organization.

", + "isRequired": true, + "enum": [ + "disabled", + "selected_members", + "all_members", + "all_members_and_outside_collaborators" + ] + }, + { + "type": "array of strings", + "name": "selected_usernames", + "in": "body", + "description": "

The usernames of the organization members who should be granted access to codespaces in the organization. Required when visibility is selected_members.

" + } + ], + "enabledForGitHubApps": false, + "codeExamples": [ + { + "key": "204", + "request": { + "contentType": "application/json", + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "bodyParameters": { + "visibility": "selected_members", + "selected_usernames": [ + "johnDoe", + "atomIO" + ] + }, + "parameters": { + "org": "ORG" + } + }, + "response": { + "statusCode": "204", + "description": "

Response when successfully modifying permissions.

" + } + } + ], + "previews": [], + "descriptionHTML": "

Sets which users can access codespaces in an organization. This is synonymous with granting or revoking codespaces billing permissions for users according to the visibility.\nYou must authenticate using an access token with the admin:org scope to use this endpoint.

", + "statusCodes": [ + { + "httpStatusCode": "204", + "description": "

Response when successfully modifying permissions.

" + }, + { + "httpStatusCode": "304", + "description": "

Not modified

" + }, + { + "httpStatusCode": "400", + "description": "

Users are neither members nor collaborators of this organization.

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "description": "

Validation failed, or the endpoint has been spammed.

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + }, { "serverUrl": "https://api.github.com", "verb": "delete", diff --git a/lib/rest/static/decorated/ghec.json b/lib/rest/static/decorated/ghec.json index 52fb3674a3..866d358a40 100644 --- a/lib/rest/static/decorated/ghec.json +++ b/lib/rest/static/decorated/ghec.json @@ -232152,6 +232152,99 @@ } ] }, + { + "serverUrl": "https://api.github.com", + "verb": "put", + "requestPath": "/orgs/{org}/codespaces/billing", + "title": "Set the visibility of organization codespaces", + "category": "codespaces", + "subcategory": "organizations", + "parameters": [ + { + "name": "org", + "description": "

The organization name. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "bodyParameters": [ + { + "type": "string", + "name": "visibility", + "in": "body", + "description": "

Which users can access codespaces in the organization. disabled means that no users can access codespaces in the organization.

", + "isRequired": true, + "enum": [ + "disabled", + "selected_members", + "all_members", + "all_members_and_outside_collaborators" + ] + }, + { + "type": "array of strings", + "name": "selected_usernames", + "in": "body", + "description": "

The usernames of the organization members who should be granted access to codespaces in the organization. Required when visibility is selected_members.

" + } + ], + "enabledForGitHubApps": false, + "codeExamples": [ + { + "key": "204", + "request": { + "contentType": "application/json", + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "bodyParameters": { + "visibility": "selected_members", + "selected_usernames": [ + "johnDoe", + "atomIO" + ] + }, + "parameters": { + "org": "ORG" + } + }, + "response": { + "statusCode": "204", + "description": "

Response when successfully modifying permissions.

" + } + } + ], + "previews": [], + "descriptionHTML": "

Sets which users can access codespaces in an organization. This is synonymous with granting or revoking codespaces billing permissions for users according to the visibility.\nYou must authenticate using an access token with the admin:org scope to use this endpoint.

", + "statusCodes": [ + { + "httpStatusCode": "204", + "description": "

Response when successfully modifying permissions.

" + }, + { + "httpStatusCode": "304", + "description": "

Not modified

" + }, + { + "httpStatusCode": "400", + "description": "

Users are neither members nor collaborators of this organization.

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "description": "

Validation failed, or the endpoint has been spammed.

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + }, { "serverUrl": "https://api.github.com", "verb": "delete", diff --git a/lib/rest/static/dereferenced/api.github.com.deref.json b/lib/rest/static/dereferenced/api.github.com.deref.json index b4f8d78954..a0f14c6bb1 100644 --- a/lib/rest/static/dereferenced/api.github.com.deref.json +++ b/lib/rest/static/dereferenced/api.github.com.deref.json @@ -83433,6 +83433,218 @@ } } }, + "/orgs/{org}/codespaces/billing": { + "put": { + "summary": "Set the visibility of organization codespaces", + "description": "Sets which users can access codespaces in an organization. This is synonymous with granting or revoking codespaces billing permissions for users according to the visibility.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", + "tags": [ + "codespaces" + ], + "operationId": "codespaces/set-codespaces-billing", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/rest/reference/codespaces#set-codespaces-billing" + }, + "parameters": [ + { + "name": "org", + "description": "The organization name. The name is not case sensitive.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "visibility": { + "type": "string", + "description": "Which users can access codespaces in the organization. `disabled` means that no users can access codespaces in the organization.", + "enum": [ + "disabled", + "selected_members", + "all_members", + "all_members_and_outside_collaborators" + ] + }, + "selected_usernames": { + "type": "array", + "description": "The usernames of the organization members who should be granted access to codespaces in the organization. Required when `visibility` is `selected_members`.", + "items": { + "type": "string" + } + } + }, + "required": [ + "visibility" + ] + }, + "examples": { + "default": { + "value": { + "visibility": "selected_members", + "selected_usernames": [ + "johnDoe", + "atomIO" + ] + } + } + } + } + } + }, + "responses": { + "204": { + "description": "Response when successfully modifying permissions." + }, + "304": { + "description": "Not modified" + }, + "400": { + "description": "Users are neither members nor collaborators of this organization." + }, + "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" + } + } + } + } + } + }, + "422": { + "description": "Validation failed, or the endpoint has been spammed.", + "content": { + "application/json": { + "schema": { + "title": "Validation Error", + "description": "Validation Error", + "type": "object", + "required": [ + "message", + "documentation_url" + ], + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "resource": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + }, + "code": { + "type": "string" + }, + "index": { + "type": "integer" + }, + "value": { + "oneOf": [ + { + "type": [ + "string", + "null" + ] + }, + { + "type": [ + "integer", + "null" + ] + }, + { + "type": [ + "array", + "null" + ], + "items": { + "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" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": false, + "category": "codespaces", + "subcategory": "organizations" + } + } + }, "/orgs/{org}/custom_roles": { "post": { "summary": "Create a custom role", diff --git a/lib/rest/static/dereferenced/ghec.deref.json b/lib/rest/static/dereferenced/ghec.deref.json index 326ed41f22..e1ccb20585 100644 --- a/lib/rest/static/dereferenced/ghec.deref.json +++ b/lib/rest/static/dereferenced/ghec.deref.json @@ -84997,6 +84997,218 @@ } } }, + "/orgs/{org}/codespaces/billing": { + "put": { + "summary": "Set the visibility of organization codespaces", + "description": "Sets which users can access codespaces in an organization. This is synonymous with granting or revoking codespaces billing permissions for users according to the visibility.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", + "tags": [ + "codespaces" + ], + "operationId": "codespaces/set-codespaces-billing", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest//rest/reference/codespaces#set-codespaces-billing" + }, + "parameters": [ + { + "name": "org", + "description": "The organization name. The name is not case sensitive.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "visibility": { + "type": "string", + "description": "Which users can access codespaces in the organization. `disabled` means that no users can access codespaces in the organization.", + "enum": [ + "disabled", + "selected_members", + "all_members", + "all_members_and_outside_collaborators" + ] + }, + "selected_usernames": { + "type": "array", + "description": "The usernames of the organization members who should be granted access to codespaces in the organization. Required when `visibility` is `selected_members`.", + "items": { + "type": "string" + } + } + }, + "required": [ + "visibility" + ] + }, + "examples": { + "default": { + "value": { + "visibility": "selected_members", + "selected_usernames": [ + "johnDoe", + "atomIO" + ] + } + } + } + } + } + }, + "responses": { + "204": { + "description": "Response when successfully modifying permissions." + }, + "304": { + "description": "Not modified" + }, + "400": { + "description": "Users are neither members nor collaborators of this organization." + }, + "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" + } + } + } + } + } + }, + "422": { + "description": "Validation failed, or the endpoint has been spammed.", + "content": { + "application/json": { + "schema": { + "title": "Validation Error", + "description": "Validation Error", + "type": "object", + "required": [ + "message", + "documentation_url" + ], + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "resource": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + }, + "code": { + "type": "string" + }, + "index": { + "type": "integer" + }, + "value": { + "oneOf": [ + { + "type": [ + "string", + "null" + ] + }, + { + "type": [ + "integer", + "null" + ] + }, + { + "type": [ + "array", + "null" + ], + "items": { + "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" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": false, + "category": "codespaces", + "subcategory": "organizations" + } + } + }, "/orgs/{org}/credential-authorizations": { "get": { "summary": "List SAML SSO authorizations for an organization",