diff --git a/lib/rest/static/decorated/api.github.com.json b/lib/rest/static/decorated/api.github.com.json index 900e2bc08f..446644941c 100644 --- a/lib/rest/static/decorated/api.github.com.json +++ b/lib/rest/static/decorated/api.github.com.json @@ -50198,6 +50198,185 @@ } ] }, + { + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", + "serverUrl": "https://api.github.com", + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

The id of the content_reference event.

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n https://api.github.com/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", + "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  https://api.github.com/repos/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", + "html": "
await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" + } + ], + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/rest/reference/apps#create-a-content-attachment" + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + "body": { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", + "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" + } + ], + "category": "apps", + "subcategory": "installations" + }, + "slug": "create-a-content-attachment", + "category": "apps", + "categoryLabel": "Apps", + "subcategory": "installations", + "subcategoryLabel": "Installations", + "notes": [], + "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", + "bodyParameters": [ + { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + ], + "responses": [ + { + "httpStatusCode": "200", + "httpStatusMessage": "OK", + "description": "Response", + "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" + }, + { + "httpStatusCode": "304", + "httpStatusMessage": "Not Modified", + "description": "Not modified" + }, + { + "httpStatusCode": "403", + "httpStatusMessage": "Forbidden", + "description": "Forbidden" + }, + { + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "Resource not found" + }, + { + "httpStatusCode": "410", + "httpStatusMessage": "Gone", + "description": "Gone" + }, + { + "httpStatusCode": "415", + "httpStatusMessage": "Unsupported Media Type", + "description": "Preview header missing" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "Validation failed" + } + ] + }, { "verb": "get", "requestPath": "/repos/{owner}/{repo}/contents/{path}", @@ -94693,184 +94872,5 @@ ], "bodyParameters": [], "descriptionHTML": "

Get a random sentence from the Zen of GitHub

" - }, - { - "verb": "post", - "requestPath": "/{owner}/{repo}/content_references/{content_reference_id}/attachments", - "serverUrl": "https://api.github.com", - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - }, - "descriptionHTML": "

The id of the content_reference event.

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n https://api.github.com/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", - "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  https://api.github.com/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", - "html": "
await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" - } - ], - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/rest/reference/apps#create-a-content-attachment" - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - "body": { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", - "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" - } - ], - "category": "apps", - "subcategory": "installations" - }, - "slug": "create-a-content-attachment", - "category": "apps", - "categoryLabel": "Apps", - "subcategory": "installations", - "subcategoryLabel": "Installations", - "notes": [], - "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", - "bodyParameters": [ - { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - ], - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "Response", - "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" - }, - { - "httpStatusCode": "304", - "httpStatusMessage": "Not Modified", - "description": "Not modified" - }, - { - "httpStatusCode": "403", - "httpStatusMessage": "Forbidden", - "description": "Forbidden" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "Resource not found" - }, - { - "httpStatusCode": "410", - "httpStatusMessage": "Gone", - "description": "Gone" - }, - { - "httpStatusCode": "415", - "httpStatusMessage": "Unsupported Media Type", - "description": "Preview header missing" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "Validation failed" - } - ] } ] \ No newline at end of file diff --git a/lib/rest/static/decorated/ghes-2.18.json b/lib/rest/static/decorated/ghes-2.18.json index fbd01943d0..891ad862e6 100644 --- a/lib/rest/static/decorated/ghes-2.18.json +++ b/lib/rest/static/decorated/ghes-2.18.json @@ -31642,6 +31642,185 @@ } ] }, + { + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", + "serverUrl": "http(s)://{hostname}/api/v3", + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

The id of the content_reference event.

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", + "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", + "html": "
await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" + } + ], + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.18/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.18/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.18/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@2.18/rest/reference/apps#create-a-content-attachment" + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + "body": { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.18/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", + "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" + } + ], + "category": "apps", + "subcategory": "installations" + }, + "slug": "create-a-content-attachment", + "category": "apps", + "categoryLabel": "Apps", + "subcategory": "installations", + "subcategoryLabel": "Installations", + "notes": [], + "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", + "bodyParameters": [ + { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + ], + "responses": [ + { + "httpStatusCode": "200", + "httpStatusMessage": "OK", + "description": "Response", + "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" + }, + { + "httpStatusCode": "304", + "httpStatusMessage": "Not Modified", + "description": "Not modified" + }, + { + "httpStatusCode": "403", + "httpStatusMessage": "Forbidden", + "description": "Forbidden" + }, + { + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "Resource not found" + }, + { + "httpStatusCode": "410", + "httpStatusMessage": "Gone", + "description": "Gone" + }, + { + "httpStatusCode": "415", + "httpStatusMessage": "Unsupported Media Type", + "description": "Preview header missing" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "Validation failed" + } + ] + }, { "verb": "get", "requestPath": "/repos/{owner}/{repo}/contents/{path}", @@ -65625,184 +65804,5 @@ ], "bodyParameters": [], "descriptionHTML": "

Get a random sentence from the Zen of GitHub

" - }, - { - "verb": "post", - "requestPath": "/{owner}/{repo}/content_references/{content_reference_id}/attachments", - "serverUrl": "http(s)://{hostname}/api/v3", - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - }, - "descriptionHTML": "

The id of the content_reference event.

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", - "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", - "html": "
await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" - } - ], - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.18/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.18/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.18/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/enterprise-server@2.18/rest/reference/apps#create-a-content-attachment" - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - "body": { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.18/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", - "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" - } - ], - "category": "apps", - "subcategory": "installations" - }, - "slug": "create-a-content-attachment", - "category": "apps", - "categoryLabel": "Apps", - "subcategory": "installations", - "subcategoryLabel": "Installations", - "notes": [], - "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", - "bodyParameters": [ - { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - ], - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "Response", - "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" - }, - { - "httpStatusCode": "304", - "httpStatusMessage": "Not Modified", - "description": "Not modified" - }, - { - "httpStatusCode": "403", - "httpStatusMessage": "Forbidden", - "description": "Forbidden" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "Resource not found" - }, - { - "httpStatusCode": "410", - "httpStatusMessage": "Gone", - "description": "Gone" - }, - { - "httpStatusCode": "415", - "httpStatusMessage": "Unsupported Media Type", - "description": "Preview header missing" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "Validation failed" - } - ] } ] \ No newline at end of file diff --git a/lib/rest/static/decorated/ghes-2.19.json b/lib/rest/static/decorated/ghes-2.19.json index a0cfea7cc5..a796837325 100644 --- a/lib/rest/static/decorated/ghes-2.19.json +++ b/lib/rest/static/decorated/ghes-2.19.json @@ -32239,6 +32239,185 @@ } ] }, + { + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", + "serverUrl": "http(s)://{hostname}/api/v3", + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

The id of the content_reference event.

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", + "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", + "html": "
await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" + } + ], + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.19/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.19/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.19/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@2.19/rest/reference/apps#create-a-content-attachment" + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + "body": { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.19/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", + "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" + } + ], + "category": "apps", + "subcategory": "installations" + }, + "slug": "create-a-content-attachment", + "category": "apps", + "categoryLabel": "Apps", + "subcategory": "installations", + "subcategoryLabel": "Installations", + "notes": [], + "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", + "bodyParameters": [ + { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + ], + "responses": [ + { + "httpStatusCode": "200", + "httpStatusMessage": "OK", + "description": "Response", + "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" + }, + { + "httpStatusCode": "304", + "httpStatusMessage": "Not Modified", + "description": "Not modified" + }, + { + "httpStatusCode": "403", + "httpStatusMessage": "Forbidden", + "description": "Forbidden" + }, + { + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "Resource not found" + }, + { + "httpStatusCode": "410", + "httpStatusMessage": "Gone", + "description": "Gone" + }, + { + "httpStatusCode": "415", + "httpStatusMessage": "Unsupported Media Type", + "description": "Preview header missing" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "Validation failed" + } + ] + }, { "verb": "get", "requestPath": "/repos/{owner}/{repo}/contents/{path}", @@ -66245,184 +66424,5 @@ ], "bodyParameters": [], "descriptionHTML": "

Get a random sentence from the Zen of GitHub

" - }, - { - "verb": "post", - "requestPath": "/{owner}/{repo}/content_references/{content_reference_id}/attachments", - "serverUrl": "http(s)://{hostname}/api/v3", - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - }, - "descriptionHTML": "

The id of the content_reference event.

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", - "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", - "html": "
await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" - } - ], - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.19/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.19/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.19/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/enterprise-server@2.19/rest/reference/apps#create-a-content-attachment" - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - "body": { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.19/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", - "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" - } - ], - "category": "apps", - "subcategory": "installations" - }, - "slug": "create-a-content-attachment", - "category": "apps", - "categoryLabel": "Apps", - "subcategory": "installations", - "subcategoryLabel": "Installations", - "notes": [], - "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", - "bodyParameters": [ - { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - ], - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "Response", - "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" - }, - { - "httpStatusCode": "304", - "httpStatusMessage": "Not Modified", - "description": "Not modified" - }, - { - "httpStatusCode": "403", - "httpStatusMessage": "Forbidden", - "description": "Forbidden" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "Resource not found" - }, - { - "httpStatusCode": "410", - "httpStatusMessage": "Gone", - "description": "Gone" - }, - { - "httpStatusCode": "415", - "httpStatusMessage": "Unsupported Media Type", - "description": "Preview header missing" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "Validation failed" - } - ] } ] \ No newline at end of file diff --git a/lib/rest/static/decorated/ghes-2.20.json b/lib/rest/static/decorated/ghes-2.20.json index a66c832c50..3006535474 100644 --- a/lib/rest/static/decorated/ghes-2.20.json +++ b/lib/rest/static/decorated/ghes-2.20.json @@ -32713,6 +32713,185 @@ } ] }, + { + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", + "serverUrl": "http(s)://{hostname}/api/v3", + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

The id of the content_reference event.

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", + "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", + "html": "
await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" + } + ], + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.20/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.20/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.20/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@2.20/rest/reference/apps#create-a-content-attachment" + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + "body": { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.20/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", + "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" + } + ], + "category": "apps", + "subcategory": "installations" + }, + "slug": "create-a-content-attachment", + "category": "apps", + "categoryLabel": "Apps", + "subcategory": "installations", + "subcategoryLabel": "Installations", + "notes": [], + "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", + "bodyParameters": [ + { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + ], + "responses": [ + { + "httpStatusCode": "200", + "httpStatusMessage": "OK", + "description": "Response", + "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" + }, + { + "httpStatusCode": "304", + "httpStatusMessage": "Not Modified", + "description": "Not modified" + }, + { + "httpStatusCode": "403", + "httpStatusMessage": "Forbidden", + "description": "Forbidden" + }, + { + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "Resource not found" + }, + { + "httpStatusCode": "410", + "httpStatusMessage": "Gone", + "description": "Gone" + }, + { + "httpStatusCode": "415", + "httpStatusMessage": "Unsupported Media Type", + "description": "Preview header missing" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "Validation failed" + } + ] + }, { "verb": "get", "requestPath": "/repos/{owner}/{repo}/contents/{path}", @@ -66807,184 +66986,5 @@ ], "bodyParameters": [], "descriptionHTML": "

Get a random sentence from the Zen of GitHub

" - }, - { - "verb": "post", - "requestPath": "/{owner}/{repo}/content_references/{content_reference_id}/attachments", - "serverUrl": "http(s)://{hostname}/api/v3", - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - }, - "descriptionHTML": "

The id of the content_reference event.

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", - "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", - "html": "
await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" - } - ], - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.20/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.20/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.20/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/enterprise-server@2.20/rest/reference/apps#create-a-content-attachment" - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - "body": { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.20/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", - "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" - } - ], - "category": "apps", - "subcategory": "installations" - }, - "slug": "create-a-content-attachment", - "category": "apps", - "categoryLabel": "Apps", - "subcategory": "installations", - "subcategoryLabel": "Installations", - "notes": [], - "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", - "bodyParameters": [ - { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - ], - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "Response", - "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" - }, - { - "httpStatusCode": "304", - "httpStatusMessage": "Not Modified", - "description": "Not modified" - }, - { - "httpStatusCode": "403", - "httpStatusMessage": "Forbidden", - "description": "Forbidden" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "Resource not found" - }, - { - "httpStatusCode": "410", - "httpStatusMessage": "Gone", - "description": "Gone" - }, - { - "httpStatusCode": "415", - "httpStatusMessage": "Unsupported Media Type", - "description": "Preview header missing" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "Validation failed" - } - ] } ] \ No newline at end of file diff --git a/lib/rest/static/decorated/ghes-2.21.json b/lib/rest/static/decorated/ghes-2.21.json index 3563b97abf..ac8fb1d627 100644 --- a/lib/rest/static/decorated/ghes-2.21.json +++ b/lib/rest/static/decorated/ghes-2.21.json @@ -36277,6 +36277,185 @@ } ] }, + { + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", + "serverUrl": "http(s)://{hostname}/api/v3", + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

The id of the content_reference event.

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", + "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", + "html": "
await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" + } + ], + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.21/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.21/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.21/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@2.21/rest/reference/apps#create-a-content-attachment" + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + "body": { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.21/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", + "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" + } + ], + "category": "apps", + "subcategory": "installations" + }, + "slug": "create-a-content-attachment", + "category": "apps", + "categoryLabel": "Apps", + "subcategory": "installations", + "subcategoryLabel": "Installations", + "notes": [], + "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", + "bodyParameters": [ + { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + ], + "responses": [ + { + "httpStatusCode": "200", + "httpStatusMessage": "OK", + "description": "Response", + "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" + }, + { + "httpStatusCode": "304", + "httpStatusMessage": "Not Modified", + "description": "Not modified" + }, + { + "httpStatusCode": "403", + "httpStatusMessage": "Forbidden", + "description": "Forbidden" + }, + { + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "Resource not found" + }, + { + "httpStatusCode": "410", + "httpStatusMessage": "Gone", + "description": "Gone" + }, + { + "httpStatusCode": "415", + "httpStatusMessage": "Unsupported Media Type", + "description": "Preview header missing" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "Validation failed" + } + ] + }, { "verb": "get", "requestPath": "/repos/{owner}/{repo}/contents/{path}", @@ -71042,184 +71221,5 @@ ], "bodyParameters": [], "descriptionHTML": "

Get a random sentence from the Zen of GitHub

" - }, - { - "verb": "post", - "requestPath": "/{owner}/{repo}/content_references/{content_reference_id}/attachments", - "serverUrl": "http(s)://{hostname}/api/v3", - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - }, - "descriptionHTML": "

The id of the content_reference event.

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", - "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", - "html": "
await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" - } - ], - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.21/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.21/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.21/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/enterprise-server@2.21/rest/reference/apps#create-a-content-attachment" - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - "body": { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.21/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", - "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" - } - ], - "category": "apps", - "subcategory": "installations" - }, - "slug": "create-a-content-attachment", - "category": "apps", - "categoryLabel": "Apps", - "subcategory": "installations", - "subcategoryLabel": "Installations", - "notes": [], - "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", - "bodyParameters": [ - { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - ], - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "Response", - "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" - }, - { - "httpStatusCode": "304", - "httpStatusMessage": "Not Modified", - "description": "Not modified" - }, - { - "httpStatusCode": "403", - "httpStatusMessage": "Forbidden", - "description": "Forbidden" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "Resource not found" - }, - { - "httpStatusCode": "410", - "httpStatusMessage": "Gone", - "description": "Gone" - }, - { - "httpStatusCode": "415", - "httpStatusMessage": "Unsupported Media Type", - "description": "Preview header missing" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "Validation failed" - } - ] } ] \ No newline at end of file diff --git a/lib/rest/static/decorated/ghes-2.22.json b/lib/rest/static/decorated/ghes-2.22.json index 0ec65296dd..6df593b651 100644 --- a/lib/rest/static/decorated/ghes-2.22.json +++ b/lib/rest/static/decorated/ghes-2.22.json @@ -44064,6 +44064,185 @@ } ] }, + { + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", + "serverUrl": "http(s)://{hostname}/api/v3", + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

The id of the content_reference event.

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", + "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", + "html": "
await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" + } + ], + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.22/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.22/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.22/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@2.22/rest/reference/apps#create-a-content-attachment" + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + "body": { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.22/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", + "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" + } + ], + "category": "apps", + "subcategory": "installations" + }, + "slug": "create-a-content-attachment", + "category": "apps", + "categoryLabel": "Apps", + "subcategory": "installations", + "subcategoryLabel": "Installations", + "notes": [], + "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", + "bodyParameters": [ + { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + ], + "responses": [ + { + "httpStatusCode": "200", + "httpStatusMessage": "OK", + "description": "Response", + "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" + }, + { + "httpStatusCode": "304", + "httpStatusMessage": "Not Modified", + "description": "Not modified" + }, + { + "httpStatusCode": "403", + "httpStatusMessage": "Forbidden", + "description": "Forbidden" + }, + { + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "Resource not found" + }, + { + "httpStatusCode": "410", + "httpStatusMessage": "Gone", + "description": "Gone" + }, + { + "httpStatusCode": "415", + "httpStatusMessage": "Unsupported Media Type", + "description": "Preview header missing" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "Validation failed" + } + ] + }, { "verb": "get", "requestPath": "/repos/{owner}/{repo}/contents/{path}", @@ -78682,184 +78861,5 @@ ], "bodyParameters": [], "descriptionHTML": "

Get a random sentence from the Zen of GitHub

" - }, - { - "verb": "post", - "requestPath": "/{owner}/{repo}/content_references/{content_reference_id}/attachments", - "serverUrl": "http(s)://{hostname}/api/v3", - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - }, - "descriptionHTML": "

The id of the content_reference event.

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", - "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", - "html": "
await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" - } - ], - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.22/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.22/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.22/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/enterprise-server@2.22/rest/reference/apps#create-a-content-attachment" - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - "body": { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.22/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", - "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" - } - ], - "category": "apps", - "subcategory": "installations" - }, - "slug": "create-a-content-attachment", - "category": "apps", - "categoryLabel": "Apps", - "subcategory": "installations", - "subcategoryLabel": "Installations", - "notes": [], - "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", - "bodyParameters": [ - { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - ], - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "Response", - "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" - }, - { - "httpStatusCode": "304", - "httpStatusMessage": "Not Modified", - "description": "Not modified" - }, - { - "httpStatusCode": "403", - "httpStatusMessage": "Forbidden", - "description": "Forbidden" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "Resource not found" - }, - { - "httpStatusCode": "410", - "httpStatusMessage": "Gone", - "description": "Gone" - }, - { - "httpStatusCode": "415", - "httpStatusMessage": "Unsupported Media Type", - "description": "Preview header missing" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "Validation failed" - } - ] } ] \ No newline at end of file diff --git a/lib/rest/static/decorated/ghes-3.0.json b/lib/rest/static/decorated/ghes-3.0.json index 861902e0c5..c2cabe1af9 100644 --- a/lib/rest/static/decorated/ghes-3.0.json +++ b/lib/rest/static/decorated/ghes-3.0.json @@ -48521,6 +48521,185 @@ } ] }, + { + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", + "serverUrl": "http(s)://{hostname}/api/v3", + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

The id of the content_reference event.

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", + "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://{hostname}/api/v3/repos/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", + "html": "
await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" + } + ], + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@3.0/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@3.0/rest/reference/apps#create-a-content-attachment" + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + "body": { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", + "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" + } + ], + "category": "apps", + "subcategory": "installations" + }, + "slug": "create-a-content-attachment", + "category": "apps", + "categoryLabel": "Apps", + "subcategory": "installations", + "subcategoryLabel": "Installations", + "notes": [], + "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", + "bodyParameters": [ + { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + ], + "responses": [ + { + "httpStatusCode": "200", + "httpStatusMessage": "OK", + "description": "Response", + "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" + }, + { + "httpStatusCode": "304", + "httpStatusMessage": "Not Modified", + "description": "Not modified" + }, + { + "httpStatusCode": "403", + "httpStatusMessage": "Forbidden", + "description": "Forbidden" + }, + { + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "Resource not found" + }, + { + "httpStatusCode": "410", + "httpStatusMessage": "Gone", + "description": "Gone" + }, + { + "httpStatusCode": "415", + "httpStatusMessage": "Unsupported Media Type", + "description": "Preview header missing" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "Validation failed" + } + ] + }, { "verb": "get", "requestPath": "/repos/{owner}/{repo}/contents/{path}", @@ -83412,184 +83591,5 @@ ], "bodyParameters": [], "descriptionHTML": "

Get a random sentence from the Zen of GitHub

" - }, - { - "verb": "post", - "requestPath": "/{owner}/{repo}/content_references/{content_reference_id}/attachments", - "serverUrl": "http(s)://{hostname}/api/v3", - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - }, - "descriptionHTML": "

The id of the content_reference event.

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", - "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://{hostname}/api/v3/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", - "html": "
await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" - } - ], - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@3.0/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/enterprise-server@3.0/rest/reference/apps#create-a-content-attachment" - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - "body": { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", - "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" - } - ], - "category": "apps", - "subcategory": "installations" - }, - "slug": "create-a-content-attachment", - "category": "apps", - "categoryLabel": "Apps", - "subcategory": "installations", - "subcategoryLabel": "Installations", - "notes": [], - "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", - "bodyParameters": [ - { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - ], - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "Response", - "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" - }, - { - "httpStatusCode": "304", - "httpStatusMessage": "Not Modified", - "description": "Not modified" - }, - { - "httpStatusCode": "403", - "httpStatusMessage": "Forbidden", - "description": "Forbidden" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "Resource not found" - }, - { - "httpStatusCode": "410", - "httpStatusMessage": "Gone", - "description": "Gone" - }, - { - "httpStatusCode": "415", - "httpStatusMessage": "Unsupported Media Type", - "description": "Preview header missing" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "Validation failed" - } - ] } ] \ No newline at end of file diff --git a/lib/rest/static/decorated/ghes-3.1.json b/lib/rest/static/decorated/ghes-3.1.json index 5d0b6ef924..e2514f8310 100644 --- a/lib/rest/static/decorated/ghes-3.1.json +++ b/lib/rest/static/decorated/ghes-3.1.json @@ -49210,6 +49210,185 @@ } ] }, + { + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", + "serverUrl": "http(s)://{hostname}", + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

The id of the content_reference event.

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", + "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://{hostname}/repos/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", + "html": "
await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" + } + ], + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@3.1/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@3.1/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#create-a-content-attachment" + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + "body": { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", + "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" + } + ], + "category": "apps", + "subcategory": "installations" + }, + "slug": "create-a-content-attachment", + "category": "apps", + "categoryLabel": "Apps", + "subcategory": "installations", + "subcategoryLabel": "Installations", + "notes": [], + "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", + "bodyParameters": [ + { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + ], + "responses": [ + { + "httpStatusCode": "200", + "httpStatusMessage": "OK", + "description": "Response", + "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" + }, + { + "httpStatusCode": "304", + "httpStatusMessage": "Not Modified", + "description": "Not modified" + }, + { + "httpStatusCode": "403", + "httpStatusMessage": "Forbidden", + "description": "Forbidden" + }, + { + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "Resource not found" + }, + { + "httpStatusCode": "410", + "httpStatusMessage": "Gone", + "description": "Gone" + }, + { + "httpStatusCode": "415", + "httpStatusMessage": "Unsupported Media Type", + "description": "Preview header missing" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "Validation failed" + } + ] + }, { "verb": "get", "requestPath": "/repos/{owner}/{repo}/contents/{path}", @@ -84304,184 +84483,5 @@ ], "bodyParameters": [], "descriptionHTML": "

Get a random sentence from the Zen of GitHub

" - }, - { - "verb": "post", - "requestPath": "/{owner}/{repo}/content_references/{content_reference_id}/attachments", - "serverUrl": "http(s)://{hostname}", - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - }, - "descriptionHTML": "

The id of the content_reference event.

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://{hostname}/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", - "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://{hostname}/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", - "html": "
await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" - } - ], - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@3.1/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@3.1/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#create-a-content-attachment" - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - "body": { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", - "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" - } - ], - "category": "apps", - "subcategory": "installations" - }, - "slug": "create-a-content-attachment", - "category": "apps", - "categoryLabel": "Apps", - "subcategory": "installations", - "subcategoryLabel": "Installations", - "notes": [], - "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", - "bodyParameters": [ - { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - ], - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "Response", - "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" - }, - { - "httpStatusCode": "304", - "httpStatusMessage": "Not Modified", - "description": "Not modified" - }, - { - "httpStatusCode": "403", - "httpStatusMessage": "Forbidden", - "description": "Forbidden" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "Resource not found" - }, - { - "httpStatusCode": "410", - "httpStatusMessage": "Gone", - "description": "Gone" - }, - { - "httpStatusCode": "415", - "httpStatusMessage": "Unsupported Media Type", - "description": "Preview header missing" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "Validation failed" - } - ] } ] \ No newline at end of file diff --git a/lib/rest/static/decorated/github.ae.json b/lib/rest/static/decorated/github.ae.json index 5d09a18675..64e2d491de 100644 --- a/lib/rest/static/decorated/github.ae.json +++ b/lib/rest/static/decorated/github.ae.json @@ -41707,6 +41707,185 @@ } ] }, + { + "verb": "post", + "requestPath": "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", + "serverUrl": "http(s)://api.{hostname}", + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + }, + "descriptionHTML": "

The id of the content_reference event.

" + } + ], + "x-codeSamples": [ + { + "lang": "Shell", + "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://api.{hostname}/repos/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", + "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://api.{hostname}/repos/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" + }, + { + "lang": "JavaScript", + "source": "await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", + "html": "
await octokit.request('POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" + } + ], + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/github-ae@latest/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/github-ae@latest/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/github-ae@latest/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/github-ae@latest/rest/reference/apps#create-a-content-attachment" + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + "body": { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/github-ae@latest/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", + "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" + } + ], + "category": "apps", + "subcategory": "installations" + }, + "slug": "create-a-content-attachment", + "category": "apps", + "categoryLabel": "Apps", + "subcategory": "installations", + "subcategoryLabel": "Installations", + "notes": [], + "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", + "bodyParameters": [ + { + "description": "

Required. The title of the attachment

", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024, + "name": "title", + "in": "body", + "rawType": "string", + "rawDescription": "The title of the attachment", + "childParamsGroups": [] + }, + { + "description": "

Required. The body of the attachment

", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144, + "name": "body", + "in": "body", + "rawType": "string", + "rawDescription": "The body of the attachment", + "childParamsGroups": [] + } + ], + "responses": [ + { + "httpStatusCode": "200", + "httpStatusMessage": "OK", + "description": "Response", + "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" + }, + { + "httpStatusCode": "304", + "httpStatusMessage": "Not Modified", + "description": "Not modified" + }, + { + "httpStatusCode": "403", + "httpStatusMessage": "Forbidden", + "description": "Forbidden" + }, + { + "httpStatusCode": "404", + "httpStatusMessage": "Not Found", + "description": "Resource not found" + }, + { + "httpStatusCode": "410", + "httpStatusMessage": "Gone", + "description": "Gone" + }, + { + "httpStatusCode": "415", + "httpStatusMessage": "Unsupported Media Type", + "description": "Preview header missing" + }, + { + "httpStatusCode": "422", + "httpStatusMessage": "Unprocessable Entity", + "description": "Validation failed" + } + ] + }, { "verb": "get", "requestPath": "/repos/{owner}/{repo}/contents/{path}", @@ -75534,184 +75713,5 @@ ], "bodyParameters": [], "descriptionHTML": "

Get a random sentence from the Zen of GitHub

" - }, - { - "verb": "post", - "requestPath": "/{owner}/{repo}/content_references/{content_reference_id}/attachments", - "serverUrl": "http(s)://api.{hostname}", - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The owner of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "descriptionHTML": "

The name of the repository. Determined from the repository full_name of the content_reference event.

" - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - }, - "descriptionHTML": "

The id of the content_reference event.

" - } - ], - "x-codeSamples": [ - { - "lang": "Shell", - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n http(s)://api.{hostname}/octocat/hello-world/content_references/42/attachments \\\n -d '{\"title\":\"title\",\"body\":\"body\"}'", - "html": "
curl \\\n  -X POST \\\n  -H \"Accept: application/vnd.github.corsair-preview+json\" \\\n  http(s)://api.{hostname}/octocat/hello-world/content_references/42/attachments \\\n  -d '{\"title\":\"title\",\"body\":\"body\"}'
" - }, - { - "lang": "JavaScript", - "source": "await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n owner: 'octocat',\n repo: 'hello-world',\n content_reference_id: 42,\n title: 'title',\n body: 'body',\n mediaType: {\n previews: [\n 'corsair'\n ]\n }\n})", - "html": "
await octokit.request('POST /{owner}/{repo}/content_references/{content_reference_id}/attachments', {\n  owner: 'octocat',\n  repo: 'hello-world',\n  content_reference_id: 42,\n  title: 'title',\n  body: 'body',\n  mediaType: {\n    previews: [\n      'corsair'\n    ]\n  }\n})\n
" - } - ], - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/github-ae@latest/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/github-ae@latest/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/github-ae@latest/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/github-ae@latest/rest/reference/apps#create-a-content-attachment" - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - "body": { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/github-ae@latest/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```", - "html": "

To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:

\n
application/vnd.github.corsair-preview+json
" - } - ], - "category": "apps", - "subcategory": "installations" - }, - "slug": "create-a-content-attachment", - "category": "apps", - "categoryLabel": "Apps", - "subcategory": "installations", - "subcategoryLabel": "Installations", - "notes": [], - "descriptionHTML": "

Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id and repository full_name of the content reference from the content_reference event to create an attachment.

\n

The app must create a content attachment within six hours of the content reference URL being posted. See \"Using content attachments\" for details about content attachments.

\n

You must use an installation access token to access this endpoint.

", - "bodyParameters": [ - { - "description": "

Required. The title of the attachment

", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024, - "name": "title", - "in": "body", - "rawType": "string", - "rawDescription": "The title of the attachment", - "childParamsGroups": [] - }, - { - "description": "

Required. The body of the attachment

", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144, - "name": "body", - "in": "body", - "rawType": "string", - "rawDescription": "The body of the attachment", - "childParamsGroups": [] - } - ], - "responses": [ - { - "httpStatusCode": "200", - "httpStatusMessage": "OK", - "description": "Response", - "payload": "
{\n  \"id\": 101,\n  \"title\": \"[A-1234] Error found in core/models.py file'\",\n  \"body\": \"You have used an email that already exists for the user_email_uniq field.\\n ## DETAILS:\\n\\nThe (email)=(Octocat@github.com) already exists.\\n\\n The error was found in core/models.py in get_or_create_user at line 62.\\n\\n self.save()\"\n}\n
" - }, - { - "httpStatusCode": "304", - "httpStatusMessage": "Not Modified", - "description": "Not modified" - }, - { - "httpStatusCode": "403", - "httpStatusMessage": "Forbidden", - "description": "Forbidden" - }, - { - "httpStatusCode": "404", - "httpStatusMessage": "Not Found", - "description": "Resource not found" - }, - { - "httpStatusCode": "410", - "httpStatusMessage": "Gone", - "description": "Gone" - }, - { - "httpStatusCode": "415", - "httpStatusMessage": "Unsupported Media Type", - "description": "Preview header missing" - }, - { - "httpStatusCode": "422", - "httpStatusMessage": "Unprocessable Entity", - "description": "Validation failed" - } - ] } ] \ No newline at end of file diff --git a/lib/rest/static/dereferenced/api.github.com.deref.json b/lib/rest/static/dereferenced/api.github.com.deref.json index a1b897f243..053a4b7493 100644 --- a/lib/rest/static/dereferenced/api.github.com.deref.json +++ b/lib/rest/static/dereferenced/api.github.com.deref.json @@ -185332,6 +185332,313 @@ } } }, + "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments": { + "post": { + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/rest/reference/apps#create-a-content-attachment" + }, + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "ContentReferenceAttachment", + "description": "Content Reference attachments allow you to provide context around URLs posted in comments", + "type": "object", + "properties": { + "id": { + "description": "The ID of the attachment", + "example": 21, + "type": "integer" + }, + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + }, + "node_id": { + "description": "The node_id of the content attachment", + "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", + "type": "string" + } + }, + "required": [ + "id", + "title", + "body" + ] + }, + "examples": { + "default": { + "value": { + "id": 101, + "title": "[A-1234] Error found in core/models.py file'", + "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" + } + } + } + } + } + }, + "422": { + "description": "Validation failed", + "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", + "nullable": true + }, + { + "type": "integer", + "nullable": true + }, + { + "type": "array", + "nullable": true, + "items": { + "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" + } + } + } + } + } + }, + "410": { + "description": "Gone", + "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" + } + } + } + } + } + }, + "415": { + "description": "Preview header missing", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "message", + "documentation_url" + ], + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + }, + "304": { + "description": "Not modified" + }, + "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" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" + } + ], + "category": "apps", + "subcategory": "installations" + } + } + }, "/repos/{owner}/{repo}/contents/{path}": { "get": { "summary": "Get repository content", @@ -392433,313 +392740,6 @@ "category": "meta" } } - }, - "/{owner}/{repo}/content_references/{content_reference_id}/attachments": { - "post": { - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/rest/reference/apps#create-a-content-attachment" - }, - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Response", - "content": { - "application/json": { - "schema": { - "title": "ContentReferenceAttachment", - "description": "Content Reference attachments allow you to provide context around URLs posted in comments", - "type": "object", - "properties": { - "id": { - "description": "The ID of the attachment", - "example": 21, - "type": "integer" - }, - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - }, - "node_id": { - "description": "The node_id of the content attachment", - "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", - "type": "string" - } - }, - "required": [ - "id", - "title", - "body" - ] - }, - "examples": { - "default": { - "value": { - "id": 101, - "title": "[A-1234] Error found in core/models.py file'", - "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" - } - } - } - } - } - }, - "422": { - "description": "Validation failed", - "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", - "nullable": true - }, - { - "type": "integer", - "nullable": true - }, - { - "type": "array", - "nullable": true, - "items": { - "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" - } - } - } - } - } - }, - "410": { - "description": "Gone", - "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" - } - } - } - } - } - }, - "415": { - "description": "Preview header missing", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message", - "documentation_url" - ], - "properties": { - "message": { - "type": "string" - }, - "documentation_url": { - "type": "string" - } - } - } - } - } - }, - "304": { - "description": "Not modified" - }, - "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" - } - } - } - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" - } - ], - "category": "apps", - "subcategory": "installations" - } - } } } } \ No newline at end of file diff --git a/lib/rest/static/dereferenced/ghes-2.18.deref.json b/lib/rest/static/dereferenced/ghes-2.18.deref.json index 619469fe3d..8296bfb812 100644 --- a/lib/rest/static/dereferenced/ghes-2.18.deref.json +++ b/lib/rest/static/dereferenced/ghes-2.18.deref.json @@ -117293,6 +117293,313 @@ } } }, + "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments": { + "post": { + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.18/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.18/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.18/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@2.18/rest/reference/apps#create-a-content-attachment" + }, + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "ContentReferenceAttachment", + "description": "Content Reference attachments allow you to provide context around URLs posted in comments", + "type": "object", + "properties": { + "id": { + "description": "The ID of the attachment", + "example": 21, + "type": "integer" + }, + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + }, + "node_id": { + "description": "The node_id of the content attachment", + "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", + "type": "string" + } + }, + "required": [ + "id", + "title", + "body" + ] + }, + "examples": { + "default": { + "value": { + "id": 101, + "title": "[A-1234] Error found in core/models.py file'", + "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" + } + } + } + } + } + }, + "422": { + "description": "Validation failed", + "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", + "nullable": true + }, + { + "type": "integer", + "nullable": true + }, + { + "type": "array", + "nullable": true, + "items": { + "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" + } + } + } + } + } + }, + "410": { + "description": "Gone", + "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" + } + } + } + } + } + }, + "415": { + "description": "Preview header missing", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "message", + "documentation_url" + ], + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + }, + "304": { + "description": "Not modified" + }, + "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" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.18/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" + } + ], + "category": "apps", + "subcategory": "installations" + } + } + }, "/repos/{owner}/{repo}/contents/{path}": { "get": { "summary": "Get repository content", @@ -296922,313 +297229,6 @@ "category": "meta" } } - }, - "/{owner}/{repo}/content_references/{content_reference_id}/attachments": { - "post": { - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.18/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.18/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.18/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/enterprise-server@2.18/rest/reference/apps#create-a-content-attachment" - }, - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Response", - "content": { - "application/json": { - "schema": { - "title": "ContentReferenceAttachment", - "description": "Content Reference attachments allow you to provide context around URLs posted in comments", - "type": "object", - "properties": { - "id": { - "description": "The ID of the attachment", - "example": 21, - "type": "integer" - }, - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - }, - "node_id": { - "description": "The node_id of the content attachment", - "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", - "type": "string" - } - }, - "required": [ - "id", - "title", - "body" - ] - }, - "examples": { - "default": { - "value": { - "id": 101, - "title": "[A-1234] Error found in core/models.py file'", - "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" - } - } - } - } - } - }, - "422": { - "description": "Validation failed", - "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", - "nullable": true - }, - { - "type": "integer", - "nullable": true - }, - { - "type": "array", - "nullable": true, - "items": { - "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" - } - } - } - } - } - }, - "410": { - "description": "Gone", - "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" - } - } - } - } - } - }, - "415": { - "description": "Preview header missing", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message", - "documentation_url" - ], - "properties": { - "message": { - "type": "string" - }, - "documentation_url": { - "type": "string" - } - } - } - } - } - }, - "304": { - "description": "Not modified" - }, - "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" - } - } - } - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.18/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" - } - ], - "category": "apps", - "subcategory": "installations" - } - } } } } \ No newline at end of file diff --git a/lib/rest/static/dereferenced/ghes-2.19.deref.json b/lib/rest/static/dereferenced/ghes-2.19.deref.json index 3810620046..3ccc1e8aad 100644 --- a/lib/rest/static/dereferenced/ghes-2.19.deref.json +++ b/lib/rest/static/dereferenced/ghes-2.19.deref.json @@ -120335,6 +120335,313 @@ } } }, + "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments": { + "post": { + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.19/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.19/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.19/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@2.19/rest/reference/apps#create-a-content-attachment" + }, + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "ContentReferenceAttachment", + "description": "Content Reference attachments allow you to provide context around URLs posted in comments", + "type": "object", + "properties": { + "id": { + "description": "The ID of the attachment", + "example": 21, + "type": "integer" + }, + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + }, + "node_id": { + "description": "The node_id of the content attachment", + "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", + "type": "string" + } + }, + "required": [ + "id", + "title", + "body" + ] + }, + "examples": { + "default": { + "value": { + "id": 101, + "title": "[A-1234] Error found in core/models.py file'", + "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" + } + } + } + } + } + }, + "422": { + "description": "Validation failed", + "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", + "nullable": true + }, + { + "type": "integer", + "nullable": true + }, + { + "type": "array", + "nullable": true, + "items": { + "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" + } + } + } + } + } + }, + "410": { + "description": "Gone", + "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" + } + } + } + } + } + }, + "415": { + "description": "Preview header missing", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "message", + "documentation_url" + ], + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + }, + "304": { + "description": "Not modified" + }, + "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" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.19/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" + } + ], + "category": "apps", + "subcategory": "installations" + } + } + }, "/repos/{owner}/{repo}/contents/{path}": { "get": { "summary": "Get repository content", @@ -300288,313 +300595,6 @@ "category": "meta" } } - }, - "/{owner}/{repo}/content_references/{content_reference_id}/attachments": { - "post": { - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.19/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.19/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.19/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/enterprise-server@2.19/rest/reference/apps#create-a-content-attachment" - }, - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Response", - "content": { - "application/json": { - "schema": { - "title": "ContentReferenceAttachment", - "description": "Content Reference attachments allow you to provide context around URLs posted in comments", - "type": "object", - "properties": { - "id": { - "description": "The ID of the attachment", - "example": 21, - "type": "integer" - }, - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - }, - "node_id": { - "description": "The node_id of the content attachment", - "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", - "type": "string" - } - }, - "required": [ - "id", - "title", - "body" - ] - }, - "examples": { - "default": { - "value": { - "id": 101, - "title": "[A-1234] Error found in core/models.py file'", - "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" - } - } - } - } - } - }, - "422": { - "description": "Validation failed", - "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", - "nullable": true - }, - { - "type": "integer", - "nullable": true - }, - { - "type": "array", - "nullable": true, - "items": { - "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" - } - } - } - } - } - }, - "410": { - "description": "Gone", - "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" - } - } - } - } - } - }, - "415": { - "description": "Preview header missing", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message", - "documentation_url" - ], - "properties": { - "message": { - "type": "string" - }, - "documentation_url": { - "type": "string" - } - } - } - } - } - }, - "304": { - "description": "Not modified" - }, - "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" - } - } - } - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.19/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" - } - ], - "category": "apps", - "subcategory": "installations" - } - } } } } \ No newline at end of file diff --git a/lib/rest/static/dereferenced/ghes-2.20.deref.json b/lib/rest/static/dereferenced/ghes-2.20.deref.json index 770b9f402c..8cd03d7601 100644 --- a/lib/rest/static/dereferenced/ghes-2.20.deref.json +++ b/lib/rest/static/dereferenced/ghes-2.20.deref.json @@ -122556,6 +122556,313 @@ } } }, + "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments": { + "post": { + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.20/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.20/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.20/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@2.20/rest/reference/apps#create-a-content-attachment" + }, + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "ContentReferenceAttachment", + "description": "Content Reference attachments allow you to provide context around URLs posted in comments", + "type": "object", + "properties": { + "id": { + "description": "The ID of the attachment", + "example": 21, + "type": "integer" + }, + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + }, + "node_id": { + "description": "The node_id of the content attachment", + "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", + "type": "string" + } + }, + "required": [ + "id", + "title", + "body" + ] + }, + "examples": { + "default": { + "value": { + "id": 101, + "title": "[A-1234] Error found in core/models.py file'", + "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" + } + } + } + } + } + }, + "422": { + "description": "Validation failed", + "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", + "nullable": true + }, + { + "type": "integer", + "nullable": true + }, + { + "type": "array", + "nullable": true, + "items": { + "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" + } + } + } + } + } + }, + "410": { + "description": "Gone", + "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" + } + } + } + } + } + }, + "415": { + "description": "Preview header missing", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "message", + "documentation_url" + ], + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + }, + "304": { + "description": "Not modified" + }, + "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" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.20/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" + } + ], + "category": "apps", + "subcategory": "installations" + } + } + }, "/repos/{owner}/{repo}/contents/{path}": { "get": { "summary": "Get repository content", @@ -303594,313 +303901,6 @@ "category": "meta" } } - }, - "/{owner}/{repo}/content_references/{content_reference_id}/attachments": { - "post": { - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.20/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.20/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.20/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/enterprise-server@2.20/rest/reference/apps#create-a-content-attachment" - }, - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Response", - "content": { - "application/json": { - "schema": { - "title": "ContentReferenceAttachment", - "description": "Content Reference attachments allow you to provide context around URLs posted in comments", - "type": "object", - "properties": { - "id": { - "description": "The ID of the attachment", - "example": 21, - "type": "integer" - }, - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - }, - "node_id": { - "description": "The node_id of the content attachment", - "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", - "type": "string" - } - }, - "required": [ - "id", - "title", - "body" - ] - }, - "examples": { - "default": { - "value": { - "id": 101, - "title": "[A-1234] Error found in core/models.py file'", - "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" - } - } - } - } - } - }, - "422": { - "description": "Validation failed", - "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", - "nullable": true - }, - { - "type": "integer", - "nullable": true - }, - { - "type": "array", - "nullable": true, - "items": { - "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" - } - } - } - } - } - }, - "410": { - "description": "Gone", - "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" - } - } - } - } - } - }, - "415": { - "description": "Preview header missing", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message", - "documentation_url" - ], - "properties": { - "message": { - "type": "string" - }, - "documentation_url": { - "type": "string" - } - } - } - } - } - }, - "304": { - "description": "Not modified" - }, - "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" - } - } - } - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.20/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" - } - ], - "category": "apps", - "subcategory": "installations" - } - } } } } \ No newline at end of file diff --git a/lib/rest/static/dereferenced/ghes-2.21.deref.json b/lib/rest/static/dereferenced/ghes-2.21.deref.json index 84527ae4e6..025848fbc9 100644 --- a/lib/rest/static/dereferenced/ghes-2.21.deref.json +++ b/lib/rest/static/dereferenced/ghes-2.21.deref.json @@ -134168,6 +134168,313 @@ } } }, + "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments": { + "post": { + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.21/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.21/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.21/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@2.21/rest/reference/apps#create-a-content-attachment" + }, + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "ContentReferenceAttachment", + "description": "Content Reference attachments allow you to provide context around URLs posted in comments", + "type": "object", + "properties": { + "id": { + "description": "The ID of the attachment", + "example": 21, + "type": "integer" + }, + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + }, + "node_id": { + "description": "The node_id of the content attachment", + "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", + "type": "string" + } + }, + "required": [ + "id", + "title", + "body" + ] + }, + "examples": { + "default": { + "value": { + "id": 101, + "title": "[A-1234] Error found in core/models.py file'", + "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" + } + } + } + } + } + }, + "422": { + "description": "Validation failed", + "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", + "nullable": true + }, + { + "type": "integer", + "nullable": true + }, + { + "type": "array", + "nullable": true, + "items": { + "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" + } + } + } + } + } + }, + "410": { + "description": "Gone", + "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" + } + } + } + } + } + }, + "415": { + "description": "Preview header missing", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "message", + "documentation_url" + ], + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + }, + "304": { + "description": "Not modified" + }, + "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" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.21/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" + } + ], + "category": "apps", + "subcategory": "installations" + } + } + }, "/repos/{owner}/{repo}/contents/{path}": { "get": { "summary": "Get repository content", @@ -313642,313 +313949,6 @@ "category": "meta" } } - }, - "/{owner}/{repo}/content_references/{content_reference_id}/attachments": { - "post": { - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.21/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.21/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.21/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/enterprise-server@2.21/rest/reference/apps#create-a-content-attachment" - }, - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Response", - "content": { - "application/json": { - "schema": { - "title": "ContentReferenceAttachment", - "description": "Content Reference attachments allow you to provide context around URLs posted in comments", - "type": "object", - "properties": { - "id": { - "description": "The ID of the attachment", - "example": 21, - "type": "integer" - }, - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - }, - "node_id": { - "description": "The node_id of the content attachment", - "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", - "type": "string" - } - }, - "required": [ - "id", - "title", - "body" - ] - }, - "examples": { - "default": { - "value": { - "id": 101, - "title": "[A-1234] Error found in core/models.py file'", - "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" - } - } - } - } - } - }, - "422": { - "description": "Validation failed", - "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", - "nullable": true - }, - { - "type": "integer", - "nullable": true - }, - { - "type": "array", - "nullable": true, - "items": { - "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" - } - } - } - } - } - }, - "410": { - "description": "Gone", - "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" - } - } - } - } - } - }, - "415": { - "description": "Preview header missing", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message", - "documentation_url" - ], - "properties": { - "message": { - "type": "string" - }, - "documentation_url": { - "type": "string" - } - } - } - } - } - }, - "304": { - "description": "Not modified" - }, - "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" - } - } - } - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.21/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" - } - ], - "category": "apps", - "subcategory": "installations" - } - } } } } \ No newline at end of file diff --git a/lib/rest/static/dereferenced/ghes-2.22.deref.json b/lib/rest/static/dereferenced/ghes-2.22.deref.json index cec548f694..aa6b8e7c8f 100644 --- a/lib/rest/static/dereferenced/ghes-2.22.deref.json +++ b/lib/rest/static/dereferenced/ghes-2.22.deref.json @@ -165071,6 +165071,313 @@ } } }, + "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments": { + "post": { + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.22/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.22/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.22/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@2.22/rest/reference/apps#create-a-content-attachment" + }, + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "ContentReferenceAttachment", + "description": "Content Reference attachments allow you to provide context around URLs posted in comments", + "type": "object", + "properties": { + "id": { + "description": "The ID of the attachment", + "example": 21, + "type": "integer" + }, + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + }, + "node_id": { + "description": "The node_id of the content attachment", + "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", + "type": "string" + } + }, + "required": [ + "id", + "title", + "body" + ] + }, + "examples": { + "default": { + "value": { + "id": 101, + "title": "[A-1234] Error found in core/models.py file'", + "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" + } + } + } + } + } + }, + "422": { + "description": "Validation failed", + "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", + "nullable": true + }, + { + "type": "integer", + "nullable": true + }, + { + "type": "array", + "nullable": true, + "items": { + "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" + } + } + } + } + } + }, + "410": { + "description": "Gone", + "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" + } + } + } + } + } + }, + "415": { + "description": "Preview header missing", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "message", + "documentation_url" + ], + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + }, + "304": { + "description": "Not modified" + }, + "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" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.22/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" + } + ], + "category": "apps", + "subcategory": "installations" + } + } + }, "/repos/{owner}/{repo}/contents/{path}": { "get": { "summary": "Get repository content", @@ -345131,313 +345438,6 @@ "category": "meta" } } - }, - "/{owner}/{repo}/content_references/{content_reference_id}/attachments": { - "post": { - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@2.22/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@2.22/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@2.22/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/enterprise-server@2.22/rest/reference/apps#create-a-content-attachment" - }, - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Response", - "content": { - "application/json": { - "schema": { - "title": "ContentReferenceAttachment", - "description": "Content Reference attachments allow you to provide context around URLs posted in comments", - "type": "object", - "properties": { - "id": { - "description": "The ID of the attachment", - "example": 21, - "type": "integer" - }, - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - }, - "node_id": { - "description": "The node_id of the content attachment", - "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", - "type": "string" - } - }, - "required": [ - "id", - "title", - "body" - ] - }, - "examples": { - "default": { - "value": { - "id": 101, - "title": "[A-1234] Error found in core/models.py file'", - "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" - } - } - } - } - } - }, - "422": { - "description": "Validation failed", - "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", - "nullable": true - }, - { - "type": "integer", - "nullable": true - }, - { - "type": "array", - "nullable": true, - "items": { - "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" - } - } - } - } - } - }, - "410": { - "description": "Gone", - "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" - } - } - } - } - } - }, - "415": { - "description": "Preview header missing", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message", - "documentation_url" - ], - "properties": { - "message": { - "type": "string" - }, - "documentation_url": { - "type": "string" - } - } - } - } - } - }, - "304": { - "description": "Not modified" - }, - "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" - } - } - } - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@2.22/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" - } - ], - "category": "apps", - "subcategory": "installations" - } - } } } } \ No newline at end of file diff --git a/lib/rest/static/dereferenced/ghes-3.0.deref.json b/lib/rest/static/dereferenced/ghes-3.0.deref.json index 214b73f6ce..e9706e24f4 100644 --- a/lib/rest/static/dereferenced/ghes-3.0.deref.json +++ b/lib/rest/static/dereferenced/ghes-3.0.deref.json @@ -170466,6 +170466,313 @@ } } }, + "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments": { + "post": { + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@3.0/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@3.0/rest/reference/apps#create-a-content-attachment" + }, + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "ContentReferenceAttachment", + "description": "Content Reference attachments allow you to provide context around URLs posted in comments", + "type": "object", + "properties": { + "id": { + "description": "The ID of the attachment", + "example": 21, + "type": "integer" + }, + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + }, + "node_id": { + "description": "The node_id of the content attachment", + "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", + "type": "string" + } + }, + "required": [ + "id", + "title", + "body" + ] + }, + "examples": { + "default": { + "value": { + "id": 101, + "title": "[A-1234] Error found in core/models.py file'", + "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" + } + } + } + } + } + }, + "422": { + "description": "Validation failed", + "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", + "nullable": true + }, + { + "type": "integer", + "nullable": true + }, + { + "type": "array", + "nullable": true, + "items": { + "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" + } + } + } + } + } + }, + "410": { + "description": "Gone", + "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" + } + } + } + } + } + }, + "415": { + "description": "Preview header missing", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "message", + "documentation_url" + ], + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + }, + "304": { + "description": "Not modified" + }, + "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" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" + } + ], + "category": "apps", + "subcategory": "installations" + } + } + }, "/repos/{owner}/{repo}/contents/{path}": { "get": { "summary": "Get repository content", @@ -350852,313 +351159,6 @@ "category": "meta" } } - }, - "/{owner}/{repo}/content_references/{content_reference_id}/attachments": { - "post": { - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@3.0/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@3.0/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@3.0/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/enterprise-server@3.0/rest/reference/apps#create-a-content-attachment" - }, - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Response", - "content": { - "application/json": { - "schema": { - "title": "ContentReferenceAttachment", - "description": "Content Reference attachments allow you to provide context around URLs posted in comments", - "type": "object", - "properties": { - "id": { - "description": "The ID of the attachment", - "example": 21, - "type": "integer" - }, - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - }, - "node_id": { - "description": "The node_id of the content attachment", - "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", - "type": "string" - } - }, - "required": [ - "id", - "title", - "body" - ] - }, - "examples": { - "default": { - "value": { - "id": 101, - "title": "[A-1234] Error found in core/models.py file'", - "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" - } - } - } - } - } - }, - "422": { - "description": "Validation failed", - "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", - "nullable": true - }, - { - "type": "integer", - "nullable": true - }, - { - "type": "array", - "nullable": true, - "items": { - "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" - } - } - } - } - } - }, - "410": { - "description": "Gone", - "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" - } - } - } - } - } - }, - "415": { - "description": "Preview header missing", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message", - "documentation_url" - ], - "properties": { - "message": { - "type": "string" - }, - "documentation_url": { - "type": "string" - } - } - } - } - } - }, - "304": { - "description": "Not modified" - }, - "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" - } - } - } - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" - } - ], - "category": "apps", - "subcategory": "installations" - } - } } } } \ No newline at end of file diff --git a/lib/rest/static/dereferenced/ghes-3.1.deref.json b/lib/rest/static/dereferenced/ghes-3.1.deref.json index 1a98e1cf46..5ac9f83b12 100644 --- a/lib/rest/static/dereferenced/ghes-3.1.deref.json +++ b/lib/rest/static/dereferenced/ghes-3.1.deref.json @@ -173350,6 +173350,313 @@ } } }, + "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments": { + "post": { + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@3.1/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@3.1/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#create-a-content-attachment" + }, + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "ContentReferenceAttachment", + "description": "Content Reference attachments allow you to provide context around URLs posted in comments", + "type": "object", + "properties": { + "id": { + "description": "The ID of the attachment", + "example": 21, + "type": "integer" + }, + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + }, + "node_id": { + "description": "The node_id of the content attachment", + "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", + "type": "string" + } + }, + "required": [ + "id", + "title", + "body" + ] + }, + "examples": { + "default": { + "value": { + "id": 101, + "title": "[A-1234] Error found in core/models.py file'", + "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" + } + } + } + } + } + }, + "422": { + "description": "Validation failed", + "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", + "nullable": true + }, + { + "type": "integer", + "nullable": true + }, + { + "type": "array", + "nullable": true, + "items": { + "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" + } + } + } + } + } + }, + "410": { + "description": "Gone", + "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" + } + } + } + } + } + }, + "415": { + "description": "Preview header missing", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "message", + "documentation_url" + ], + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + }, + "304": { + "description": "Not modified" + }, + "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" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" + } + ], + "category": "apps", + "subcategory": "installations" + } + } + }, "/repos/{owner}/{repo}/contents/{path}": { "get": { "summary": "Get repository content", @@ -355243,313 +355550,6 @@ "category": "meta" } } - }, - "/{owner}/{repo}/content_references/{content_reference_id}/attachments": { - "post": { - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@3.1/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@3.1/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#create-a-content-attachment" - }, - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Response", - "content": { - "application/json": { - "schema": { - "title": "ContentReferenceAttachment", - "description": "Content Reference attachments allow you to provide context around URLs posted in comments", - "type": "object", - "properties": { - "id": { - "description": "The ID of the attachment", - "example": 21, - "type": "integer" - }, - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - }, - "node_id": { - "description": "The node_id of the content attachment", - "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", - "type": "string" - } - }, - "required": [ - "id", - "title", - "body" - ] - }, - "examples": { - "default": { - "value": { - "id": 101, - "title": "[A-1234] Error found in core/models.py file'", - "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" - } - } - } - } - } - }, - "422": { - "description": "Validation failed", - "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", - "nullable": true - }, - { - "type": "integer", - "nullable": true - }, - { - "type": "array", - "nullable": true, - "items": { - "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" - } - } - } - } - } - }, - "410": { - "description": "Gone", - "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" - } - } - } - } - } - }, - "415": { - "description": "Preview header missing", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message", - "documentation_url" - ], - "properties": { - "message": { - "type": "string" - }, - "documentation_url": { - "type": "string" - } - } - } - } - } - }, - "304": { - "description": "Not modified" - }, - "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" - } - } - } - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" - } - ], - "category": "apps", - "subcategory": "installations" - } - } } } } \ No newline at end of file diff --git a/lib/rest/static/dereferenced/github.ae.deref.json b/lib/rest/static/dereferenced/github.ae.deref.json index 648467a8bf..3d6bdd4ae4 100644 --- a/lib/rest/static/dereferenced/github.ae.deref.json +++ b/lib/rest/static/dereferenced/github.ae.deref.json @@ -141894,6 +141894,313 @@ } } }, + "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments": { + "post": { + "summary": "Create a content attachment", + "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/github-ae@latest/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/github-ae@latest/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/github-ae@latest/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", + "tags": [ + "apps" + ], + "operationId": "apps/create-content-attachment", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/github-ae@latest/rest/reference/apps#create-a-content-attachment" + }, + "parameters": [ + { + "name": "owner", + "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo", + "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "content_reference_id", + "description": "The `id` of the `content_reference` event.", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + } + }, + "required": [ + "title", + "body" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "ContentReferenceAttachment", + "description": "Content Reference attachments allow you to provide context around URLs posted in comments", + "type": "object", + "properties": { + "id": { + "description": "The ID of the attachment", + "example": 21, + "type": "integer" + }, + "title": { + "description": "The title of the attachment", + "example": "Title of the attachment", + "type": "string", + "maxLength": 1024 + }, + "body": { + "description": "The body of the attachment", + "example": "Body of the attachment", + "type": "string", + "maxLength": 262144 + }, + "node_id": { + "description": "The node_id of the content attachment", + "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", + "type": "string" + } + }, + "required": [ + "id", + "title", + "body" + ] + }, + "examples": { + "default": { + "value": { + "id": 101, + "title": "[A-1234] Error found in core/models.py file'", + "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" + } + } + } + } + } + }, + "422": { + "description": "Validation failed", + "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", + "nullable": true + }, + { + "type": "integer", + "nullable": true + }, + { + "type": "array", + "nullable": true, + "items": { + "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" + } + } + } + } + } + }, + "410": { + "description": "Gone", + "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" + } + } + } + } + } + }, + "415": { + "description": "Preview header missing", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "message", + "documentation_url" + ], + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + }, + "304": { + "description": "Not modified" + }, + "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" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": true, + "previews": [ + { + "required": true, + "name": "corsair", + "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/github-ae@latest/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" + } + ], + "category": "apps", + "subcategory": "installations" + } + } + }, "/repos/{owner}/{repo}/contents/{path}": { "get": { "summary": "Get repository content", @@ -311664,313 +311971,6 @@ "category": "meta" } } - }, - "/{owner}/{repo}/content_references/{content_reference_id}/attachments": { - "post": { - "summary": "Create a content attachment", - "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/github-ae@latest/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/github-ae@latest/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/github-ae@latest/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", - "tags": [ - "apps" - ], - "operationId": "apps/create-content-attachment", - "externalDocs": { - "description": "API method documentation", - "url": "https://docs.github.com/github-ae@latest/rest/reference/apps#create-a-content-attachment" - }, - "parameters": [ - { - "name": "owner", - "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "repo", - "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "content_reference_id", - "description": "The `id` of the `content_reference` event.", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - } - }, - "required": [ - "title", - "body" - ], - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Response", - "content": { - "application/json": { - "schema": { - "title": "ContentReferenceAttachment", - "description": "Content Reference attachments allow you to provide context around URLs posted in comments", - "type": "object", - "properties": { - "id": { - "description": "The ID of the attachment", - "example": 21, - "type": "integer" - }, - "title": { - "description": "The title of the attachment", - "example": "Title of the attachment", - "type": "string", - "maxLength": 1024 - }, - "body": { - "description": "The body of the attachment", - "example": "Body of the attachment", - "type": "string", - "maxLength": 262144 - }, - "node_id": { - "description": "The node_id of the content attachment", - "example": "MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=", - "type": "string" - } - }, - "required": [ - "id", - "title", - "body" - ] - }, - "examples": { - "default": { - "value": { - "id": 101, - "title": "[A-1234] Error found in core/models.py file'", - "body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()" - } - } - } - } - } - }, - "422": { - "description": "Validation failed", - "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", - "nullable": true - }, - { - "type": "integer", - "nullable": true - }, - { - "type": "array", - "nullable": true, - "items": { - "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" - } - } - } - } - } - }, - "410": { - "description": "Gone", - "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" - } - } - } - } - } - }, - "415": { - "description": "Preview header missing", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message", - "documentation_url" - ], - "properties": { - "message": { - "type": "string" - }, - "documentation_url": { - "type": "string" - } - } - } - } - } - }, - "304": { - "description": "Not modified" - }, - "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" - } - } - } - } - } - } - }, - "x-github": { - "githubCloudOnly": false, - "enabledForGitHubApps": true, - "previews": [ - { - "required": true, - "name": "corsair", - "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/github-ae@latest/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" - } - ], - "category": "apps", - "subcategory": "installations" - } - } } } } \ No newline at end of file