diff --git a/lib/redirects/static/client-side-rest-api-redirects.json b/lib/redirects/static/client-side-rest-api-redirects.json index 0c4b142766..49fa8be4f8 100644 --- a/lib/redirects/static/client-side-rest-api-redirects.json +++ b/lib/redirects/static/client-side-rest-api-redirects.json @@ -556,6 +556,7 @@ "/rest/codespaces#list-devcontainers-in-a-repository-for-the-authenticated-user": "/rest/codespaces/codespaces#list-devcontainers-in-a-repository-for-the-authenticated-user", "/rest/codespaces#list-available-machine-types-for-a-repository": "/rest/codespaces/machines#list-available-machine-types-for-a-repository", "/rest/codespaces#machines": "/rest/codespaces/machines", + "/rest/codespaces#preview-attributes-for-a-new-codespace": "/rest/codespaces/codespaces#preview-attributes-for-a-new-codespace", "/rest/codespaces#list-repository-secrets": "/rest/codespaces/repository-secrets#list-repository-secrets", "/rest/codespaces#repository-secrets": "/rest/codespaces/repository-secrets", "/rest/codespaces#get-a-repository-public-key": "/rest/codespaces/repository-secrets#get-a-repository-public-key", diff --git a/lib/rest/static/apps/enabled-for-apps.json b/lib/rest/static/apps/enabled-for-apps.json index 8dd11aeb69..89d7676079 100644 --- a/lib/rest/static/apps/enabled-for-apps.json +++ b/lib/rest/static/apps/enabled-for-apps.json @@ -1211,6 +1211,12 @@ "verb": "get", "requestPath": "/repos/{owner}/{repo}/codespaces/machines" }, + { + "slug": "get-default-attributes-for-a-codespace", + "subcategory": "codespaces", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/codespaces/new" + }, { "slug": "list-repository-secrets", "subcategory": "repository-secrets", diff --git a/lib/rest/static/decorated/api.github.com.json b/lib/rest/static/decorated/api.github.com.json index 3318d406a8..f103ae192d 100644 --- a/lib/rest/static/decorated/api.github.com.json +++ b/lib/rest/static/decorated/api.github.com.json @@ -189390,6 +189390,296 @@ ], "subcategory": "codespaces" }, + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/repos/{owner}/{repo}/codespaces/new", + "title": "Get default attributes for a codespace", + "category": "codespaces", + "parameters": [ + { + "name": "owner", + "description": "

The account owner of the repository. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "description": "

The name of the repository. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "ref", + "description": "

The branch or commit to check for a default devcontainer path. If not specified, the default branch will be checked.

", + "in": "query", + "schema": { + "type": "string", + "examples": [ + "main" + ] + } + }, + { + "name": "client_ip", + "description": "

An alternative IP for default location auto-detection, such as when proxying a request.

", + "in": "query", + "schema": { + "type": "string", + "examples": [ + "1.2.3.4" + ] + } + } + ], + "bodyParameters": [], + "enabledForGitHubApps": true, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "owner": "OWNER", + "repo": "REPO" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response when a user is able to create codespaces from the repository.

", + "example": { + "devcontainers": [ + { + "path": ".devcontainer/foobar/devcontainer.json", + "name": "foobar" + }, + { + "path": ".devcontainer/devcontainer.json", + "name": "kitchensink" + }, + { + "path": ".devcontainer.json" + } + ], + "total_count": 3 + }, + "schema": { + "type": "object", + "properties": { + "billable_owner": { + "title": "Simple User", + "description": "Simple User", + "type": "object", + "properties": { + "name": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "login": { + "type": "string", + "examples": [ + "octocat" + ] + }, + "id": { + "type": "integer", + "examples": [ + 1 + ] + }, + "node_id": { + "type": "string", + "examples": [ + "MDQ6VXNlcjE=" + ] + }, + "avatar_url": { + "type": "string", + "format": "uri", + "examples": [ + "https://github.com/images/error/octocat_happy.gif" + ] + }, + "gravatar_id": { + "type": [ + "string", + "null" + ], + "examples": [ + "41d064eb2195891e12d0413f63227ea7" + ] + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://api.github.com/users/octocat" + ] + }, + "html_url": { + "type": "string", + "format": "uri", + "examples": [ + "https://github.com/octocat" + ] + }, + "followers_url": { + "type": "string", + "format": "uri", + "examples": [ + "https://api.github.com/users/octocat/followers" + ] + }, + "following_url": { + "type": "string", + "examples": [ + "https://api.github.com/users/octocat/following{/other_user}" + ] + }, + "gists_url": { + "type": "string", + "examples": [ + "https://api.github.com/users/octocat/gists{/gist_id}" + ] + }, + "starred_url": { + "type": "string", + "examples": [ + "https://api.github.com/users/octocat/starred{/owner}{/repo}" + ] + }, + "subscriptions_url": { + "type": "string", + "format": "uri", + "examples": [ + "https://api.github.com/users/octocat/subscriptions" + ] + }, + "organizations_url": { + "type": "string", + "format": "uri", + "examples": [ + "https://api.github.com/users/octocat/orgs" + ] + }, + "repos_url": { + "type": "string", + "format": "uri", + "examples": [ + "https://api.github.com/users/octocat/repos" + ] + }, + "events_url": { + "type": "string", + "examples": [ + "https://api.github.com/users/octocat/events{/privacy}" + ] + }, + "received_events_url": { + "type": "string", + "format": "uri", + "examples": [ + "https://api.github.com/users/octocat/received_events" + ] + }, + "type": { + "type": "string", + "examples": [ + "User" + ] + }, + "site_admin": { + "type": "boolean" + }, + "starred_at": { + "type": "string", + "examples": [ + "\"2020-07-09T00:17:55Z\"" + ] + } + }, + "required": [ + "avatar_url", + "events_url", + "followers_url", + "following_url", + "gists_url", + "gravatar_id", + "html_url", + "id", + "node_id", + "login", + "organizations_url", + "received_events_url", + "repos_url", + "site_admin", + "starred_url", + "subscriptions_url", + "type", + "url" + ] + }, + "defaults": { + "type": "object", + "required": [ + "location", + "devcontainer_path" + ], + "properties": { + "location": { + "type": "string" + }, + "devcontainer_path": { + "type": [ + "string", + "null" + ] + } + } + } + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Gets the default attributes for codespaces created by the user with the repository.

\n

You must authenticate using an access token with the codespace scope to use this endpoint.

\n

GitHub Apps must have write access to the codespaces repository permission to use this endpoint.

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

Response when a user is able to create codespaces from the repository.

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

Requires authentication

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

Forbidden

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

Resource not found

" + } + ], + "subcategory": "codespaces" + }, { "serverUrl": "https://api.github.com", "verb": "post", @@ -258413,7 +258703,7 @@ "enabledForGitHubApps": true, "codeExamples": [ { - "key": "201", + "key": "default", "request": { "contentType": "application/json", "description": "Example 1: Status Code 201", @@ -258430,7 +258720,16 @@ }, "response": { "statusCode": "201", - "description": "

Response when creating a secret

" + "contentType": "application/json", + "description": "

Response when creating a secret

", + "example": null, + "schema": { + "title": "Empty Object", + "description": "An object without any properties.", + "type": "object", + "properties": {}, + "additionalProperties": false + } } }, { @@ -483822,7 +484121,9 @@ }, "use_squash_pr_title_as_default": { "type": "boolean", - "default": false + "examples": [ + false + ] }, "allow_forking": { "type": "boolean", @@ -490181,7 +490482,9 @@ }, "use_squash_pr_title_as_default": { "type": "boolean", - "default": false + "examples": [ + false + ] }, "allow_forking": { "type": "boolean", @@ -515957,7 +516260,9 @@ }, "use_squash_pr_title_as_default": { "type": "boolean", - "default": false + "examples": [ + false + ] }, "allow_forking": { "type": "boolean", diff --git a/lib/rest/static/decorated/ghes-3.4.json b/lib/rest/static/decorated/ghes-3.4.json index c7412daf16..808f613f4a 100644 --- a/lib/rest/static/decorated/ghes-3.4.json +++ b/lib/rest/static/decorated/ghes-3.4.json @@ -195286,7 +195286,7 @@ "enabledForGitHubApps": true, "codeExamples": [ { - "key": "201", + "key": "default", "request": { "contentType": "application/json", "description": "Example 1: Status Code 201", @@ -195303,7 +195303,16 @@ }, "response": { "statusCode": "201", - "description": "

Response when creating a secret

" + "contentType": "application/json", + "description": "

Response when creating a secret

", + "example": null, + "schema": { + "title": "Empty Object", + "description": "An object without any properties.", + "type": "object", + "properties": {}, + "additionalProperties": false + } } }, { diff --git a/lib/rest/static/decorated/ghes-3.5.json b/lib/rest/static/decorated/ghes-3.5.json index c2565bbd67..3092754d83 100644 --- a/lib/rest/static/decorated/ghes-3.5.json +++ b/lib/rest/static/decorated/ghes-3.5.json @@ -205277,7 +205277,7 @@ "enabledForGitHubApps": true, "codeExamples": [ { - "key": "201", + "key": "default", "request": { "contentType": "application/json", "description": "Example 1: Status Code 201", @@ -205294,7 +205294,16 @@ }, "response": { "statusCode": "201", - "description": "

Response when creating a secret

" + "contentType": "application/json", + "description": "

Response when creating a secret

", + "example": null, + "schema": { + "title": "Empty Object", + "description": "An object without any properties.", + "type": "object", + "properties": {}, + "additionalProperties": false + } } }, { diff --git a/lib/rest/static/decorated/github.ae.json b/lib/rest/static/decorated/github.ae.json index b8d850ead5..d1a89aec89 100644 --- a/lib/rest/static/decorated/github.ae.json +++ b/lib/rest/static/decorated/github.ae.json @@ -353046,7 +353046,9 @@ }, "use_squash_pr_title_as_default": { "type": "boolean", - "default": false + "examples": [ + false + ] }, "allow_forking": { "type": "boolean", @@ -359381,7 +359383,9 @@ }, "use_squash_pr_title_as_default": { "type": "boolean", - "default": false + "examples": [ + false + ] }, "allow_forking": { "type": "boolean", @@ -382531,7 +382535,9 @@ }, "use_squash_pr_title_as_default": { "type": "boolean", - "default": false + "examples": [ + false + ] }, "allow_forking": { "type": "boolean",