resources
Creates, updates, deletes, gets or lists a resources resource.
Overview
| Name | resources |
| Type | Resource |
| Id | github.copilot_spaces.resources |
Fields
The following fields are returned by SELECT queries:
- get_resource_for_org
- get_resource_for_user
- list_resources_for_org
- list_resources_for_user
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The unique identifier of the resource. |
copilot_chat_attachment_id | integer | The ID of the associated chat attachment, if any. |
created_at | string (date-time) | The date and time the resource was created. |
metadata | object | Resource-specific metadata. The keys and values depend on the resource type. |
resource_type | string | The type of the resource. (repository, github_file, free_text, github_issue, github_pull_request, media_content, uploaded_text_file) |
updated_at | string (date-time) | The date and time the resource was last updated. |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The unique identifier of the resource. |
copilot_chat_attachment_id | integer | The ID of the associated chat attachment, if any. |
created_at | string (date-time) | The date and time the resource was created. |
metadata | object | Resource-specific metadata. The keys and values depend on the resource type. |
resource_type | string | The type of the resource. (repository, github_file, free_text, github_issue, github_pull_request, media_content, uploaded_text_file) |
updated_at | string (date-time) | The date and time the resource was last updated. |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The unique identifier of the resource. |
copilot_chat_attachment_id | integer | The ID of the associated chat attachment, if any. |
created_at | string (date-time) | The date and time the resource was created. |
metadata | object | Resource-specific metadata. The keys and values depend on the resource type. |
resource_type | string | The type of the resource. (repository, github_file, free_text, github_issue, github_pull_request, media_content, uploaded_text_file) |
updated_at | string (date-time) | The date and time the resource was last updated. |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The unique identifier of the resource. |
copilot_chat_attachment_id | integer | The ID of the associated chat attachment, if any. |
created_at | string (date-time) | The date and time the resource was created. |
metadata | object | Resource-specific metadata. The keys and values depend on the resource type. |
resource_type | string | The type of the resource. (repository, github_file, free_text, github_issue, github_pull_request, media_content, uploaded_text_file) |
updated_at | string (date-time) | The date and time the resource was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_resource_for_org | select | org, space_number, space_resource_id | Gets a specific resource attached to a Copilot Space owned by an organization. The authenticated user must have appropriate permissions to view the space. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space. | |
get_resource_for_user | select | username, space_number, space_resource_id | Gets a specific resource attached to a Copilot Space owned by a user. The authenticated user must have appropriate permissions to view the space. OAuth app tokens and personal access tokens (classic) need the read:user scope to use this endpoint. | |
list_resources_for_org | select | org, space_number | Lists all resources attached to a specific Copilot Space owned by an organization. The authenticated user must have appropriate permissions to view the space. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space. | |
list_resources_for_user | select | username, space_number | Lists all resources attached to a specific Copilot Space owned by a user. The authenticated user must have appropriate permissions to view the space. OAuth app tokens and personal access tokens (classic) need the read:user scope to use this endpoint. | |
create_resource_for_org | insert | org, space_number, resource_type, metadata | Creates a new resource in a specific Copilot Space owned by an organization. The authenticated user must have write permissions on the space. The following resource types are supported: repository, github_file, free_text, github_issue, github_pull_request.The uploaded_text_file and media_content types are not supported via this endpoint.For github_file resources, if a resource with the same repository, file path, and SHA already exists, the existing resource is returned with a 200 status.OAuth app tokens and personal access tokens (classic) need the write:org scope to use this endpoint.Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space, including the resource being created. | |
create_resource_for_user | insert | username, space_number, resource_type, metadata | Creates a new resource in a specific Copilot Space owned by a user. The authenticated user must have write permissions on the space. The following resource types are supported: repository, github_file, free_text, github_issue, github_pull_request.The uploaded_text_file and media_content types are not supported via this endpoint.For github_file resources, if a resource with the same repository, file path, and SHA already exists, the existing resource is returned with a 200 status.OAuth app tokens and personal access tokens (classic) need the write:user scope to use this endpoint. | |
update_resource_for_org | replace | org, space_number, space_resource_id | Updates the metadata of a resource in a specific Copilot Space owned by an organization. The authenticated user must have write permissions on the space. OAuth app tokens and personal access tokens (classic) need the write:org scope to use this endpoint.Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space, including the resource being updated. | |
update_resource_for_user | replace | username, space_number, space_resource_id | Updates the metadata of a resource in a specific Copilot Space owned by a user. The authenticated user must have write permissions on the space. OAuth app tokens and personal access tokens (classic) need the write:user scope to use this endpoint. | |
delete_resource_for_org | delete | org, space_number, space_resource_id | Deletes a resource from a specific Copilot Space owned by an organization. The authenticated user must have write permissions on the space. OAuth app tokens and personal access tokens (classic) need the write:org scope to use this endpoint.Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space. | |
delete_resource_for_user | delete | username, space_number, space_resource_id | Deletes a resource from a specific Copilot Space owned by a user. The authenticated user must have write permissions on the space. OAuth app tokens and personal access tokens (classic) need the write:user scope to use this endpoint. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
org | string | The organization name. The name is not case sensitive. |
space_number | integer | The unique identifier of the Copilot Space. |
space_resource_id | integer | The unique identifier of the resource. |
username | string | The handle for the GitHub user account. |
SELECT examples
- get_resource_for_org
- get_resource_for_user
- list_resources_for_org
- list_resources_for_user
Gets a specific resource attached to a Copilot Space owned by an organization.
The authenticated user must have appropriate permissions to view the space.
OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.
Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space.
SELECT
id,
copilot_chat_attachment_id,
created_at,
metadata,
resource_type,
updated_at
FROM github.copilot_spaces.resources
WHERE org = '{{ org }}' -- required
AND space_number = '{{ space_number }}' -- required
AND space_resource_id = '{{ space_resource_id }}' -- required
;
Gets a specific resource attached to a Copilot Space owned by a user.
The authenticated user must have appropriate permissions to view the space.
OAuth app tokens and personal access tokens (classic) need the read:user scope to use this endpoint.
SELECT
id,
copilot_chat_attachment_id,
created_at,
metadata,
resource_type,
updated_at
FROM github.copilot_spaces.resources
WHERE username = '{{ username }}' -- required
AND space_number = '{{ space_number }}' -- required
AND space_resource_id = '{{ space_resource_id }}' -- required
;
Lists all resources attached to a specific Copilot Space owned by an organization.
The authenticated user must have appropriate permissions to view the space.
OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.
Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space.
SELECT
id,
copilot_chat_attachment_id,
created_at,
metadata,
resource_type,
updated_at
FROM github.copilot_spaces.resources
WHERE org = '{{ org }}' -- required
AND space_number = '{{ space_number }}' -- required
;
Lists all resources attached to a specific Copilot Space owned by a user.
The authenticated user must have appropriate permissions to view the space.
OAuth app tokens and personal access tokens (classic) need the read:user scope to use this endpoint.
SELECT
id,
copilot_chat_attachment_id,
created_at,
metadata,
resource_type,
updated_at
FROM github.copilot_spaces.resources
WHERE username = '{{ username }}' -- required
AND space_number = '{{ space_number }}' -- required
;
INSERT examples
- create_resource_for_org
- create_resource_for_user
- Manifest
Creates a new resource in a specific Copilot Space owned by an organization.
The authenticated user must have write permissions on the space.
The following resource types are supported: repository, github_file, free_text, github_issue, github_pull_request.
The uploaded_text_file and media_content types are not supported via this endpoint.
For github_file resources, if a resource with the same repository, file path, and SHA already exists, the existing resource is returned with a 200 status.
OAuth app tokens and personal access tokens (classic) need the write:org scope to use this endpoint.
Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space, including the resource being created.
INSERT INTO github.copilot_spaces.resources (
resource_type,
metadata,
org,
space_number
)
SELECT
'{{ resource_type }}' /* required */,
'{{ metadata }}' /* required */,
'{{ org }}',
'{{ space_number }}'
RETURNING
id,
copilot_chat_attachment_id,
created_at,
metadata,
resource_type,
updated_at
;
Creates a new resource in a specific Copilot Space owned by a user.
The authenticated user must have write permissions on the space.
The following resource types are supported: repository, github_file, free_text, github_issue, github_pull_request.
The uploaded_text_file and media_content types are not supported via this endpoint.
For github_file resources, if a resource with the same repository, file path, and SHA already exists, the existing resource is returned with a 200 status.
OAuth app tokens and personal access tokens (classic) need the write:user scope to use this endpoint.
INSERT INTO github.copilot_spaces.resources (
resource_type,
metadata,
username,
space_number
)
SELECT
'{{ resource_type }}' /* required */,
'{{ metadata }}' /* required */,
'{{ username }}',
'{{ space_number }}'
RETURNING
id,
copilot_chat_attachment_id,
created_at,
metadata,
resource_type,
updated_at
;
# Description fields are for documentation purposes
- name: resources
props:
- name: org
value: "{{ org }}"
description: Required parameter for the resources resource.
- name: space_number
value: {{ space_number }}
description: Required parameter for the resources resource.
- name: username
value: "{{ username }}"
description: Required parameter for the resources resource.
- name: resource_type
value: "{{ resource_type }}"
description: |
The type of resource to create.
valid_values: ['repository', 'github_file', 'free_text', 'github_issue', 'github_pull_request']
- name: metadata
value: "{{ metadata }}"
description: |
Resource-specific metadata.
REPLACE examples
- update_resource_for_org
- update_resource_for_user
Updates the metadata of a resource in a specific Copilot Space owned by an organization.
The authenticated user must have write permissions on the space.
OAuth app tokens and personal access tokens (classic) need the write:org scope to use this endpoint.
Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space, including the resource being updated.
REPLACE github.copilot_spaces.resources
SET
metadata = '{{ metadata }}'
WHERE
org = '{{ org }}' --required
AND space_number = '{{ space_number }}' --required
AND space_resource_id = '{{ space_resource_id }}' --required
RETURNING
id,
copilot_chat_attachment_id,
created_at,
metadata,
resource_type,
updated_at;
Updates the metadata of a resource in a specific Copilot Space owned by a user.
The authenticated user must have write permissions on the space.
OAuth app tokens and personal access tokens (classic) need the write:user scope to use this endpoint.
REPLACE github.copilot_spaces.resources
SET
metadata = '{{ metadata }}'
WHERE
username = '{{ username }}' --required
AND space_number = '{{ space_number }}' --required
AND space_resource_id = '{{ space_resource_id }}' --required
RETURNING
id,
copilot_chat_attachment_id,
created_at,
metadata,
resource_type,
updated_at;
DELETE examples
- delete_resource_for_org
- delete_resource_for_user
Deletes a resource from a specific Copilot Space owned by an organization.
The authenticated user must have write permissions on the space.
OAuth app tokens and personal access tokens (classic) need the write:org scope to use this endpoint.
Fine-grained tokens and GitHub App user access tokens must have been granted access to the organization that owns the space. They must also have been granted access to every repository referenced by resources in the space.
DELETE FROM github.copilot_spaces.resources
WHERE org = '{{ org }}' --required
AND space_number = '{{ space_number }}' --required
AND space_resource_id = '{{ space_resource_id }}' --required
;
Deletes a resource from a specific Copilot Space owned by a user.
The authenticated user must have write permissions on the space.
OAuth app tokens and personal access tokens (classic) need the write:user scope to use this endpoint.
DELETE FROM github.copilot_spaces.resources
WHERE username = '{{ username }}' --required
AND space_number = '{{ space_number }}' --required
AND space_resource_id = '{{ space_resource_id }}' --required
;