From 4ab149ed1602e281ebda2fa5eaccca444bb5c7f7 Mon Sep 17 00:00:00 2001 From: docs-bot <77750099+docs-bot@users.noreply.github.com> Date: Fri, 9 Aug 2024 09:03:24 -0700 Subject: [PATCH 1/3] Update OpenAPI Description (#51975) --- .../fine-grained-pat-permissions.json | 27 ++ .../data/fpt-2022-11-28/fine-grained-pat.json | 6 + .../server-to-server-permissions.json | 33 ++ .../fpt-2022-11-28/server-to-server-rest.json | 6 + .../fpt-2022-11-28/user-to-server-rest.json | 6 + .../fine-grained-pat-permissions.json | 27 ++ .../ghec-2022-11-28/fine-grained-pat.json | 6 + .../server-to-server-permissions.json | 33 ++ .../server-to-server-rest.json | 6 + .../ghec-2022-11-28/user-to-server-rest.json | 6 + src/github-apps/lib/config.json | 2 +- src/rest/data/fpt-2022-11-28/schema.json | 331 +++++++++++++++++- src/rest/data/ghec-2022-11-28/schema.json | 331 +++++++++++++++++- .../data/ghes-3.14-2022-11-28/schema.json | 36 +- src/rest/lib/config.json | 2 +- src/webhooks/data/fpt/schema.json | 9 +- src/webhooks/data/ghec/schema.json | 9 +- src/webhooks/data/ghes-3.14/schema.json | 9 +- src/webhooks/lib/config.json | 2 +- 19 files changed, 839 insertions(+), 48 deletions(-) diff --git a/src/github-apps/data/fpt-2022-11-28/fine-grained-pat-permissions.json b/src/github-apps/data/fpt-2022-11-28/fine-grained-pat-permissions.json index 9f18b9a27a63..238f56057ab9 100644 --- a/src/github-apps/data/fpt-2022-11-28/fine-grained-pat-permissions.json +++ b/src/github-apps/data/fpt-2022-11-28/fine-grained-pat-permissions.json @@ -11,6 +11,15 @@ "requestPath": "/orgs/{org}/copilot/usage", "additional-permissions": true, "access": "read" + }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage", + "additional-permissions": true, + "access": "read" } ] }, @@ -477,6 +486,15 @@ "additional-permissions": false, "access": "read" }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage", + "additional-permissions": true, + "access": "read" + }, { "category": "orgs", "slug": "enable-or-disable-a-security-feature-for-an-organization", @@ -713,6 +731,15 @@ "requestPath": "/orgs/{org}/members/{username}/copilot", "additional-permissions": true, "access": "read" + }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage", + "additional-permissions": true, + "access": "read" } ] }, diff --git a/src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json b/src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json index 884a7537821c..812701655c6c 100644 --- a/src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json +++ b/src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json @@ -1957,6 +1957,12 @@ "subcategory": "copilot-user-management", "verb": "get", "requestPath": "/orgs/{org}/members/{username}/copilot" + }, + { + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage" } ], "dependabot": [ diff --git a/src/github-apps/data/fpt-2022-11-28/server-to-server-permissions.json b/src/github-apps/data/fpt-2022-11-28/server-to-server-permissions.json index 8de1226693b5..5b7ad92857c1 100644 --- a/src/github-apps/data/fpt-2022-11-28/server-to-server-permissions.json +++ b/src/github-apps/data/fpt-2022-11-28/server-to-server-permissions.json @@ -46,6 +46,17 @@ "user-to-server": true, "server-to-server": true, "additional-permissions": true + }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true } ] }, @@ -614,6 +625,17 @@ "server-to-server": true, "additional-permissions": false }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true + }, { "category": "orgs", "slug": "enable-or-disable-a-security-feature-for-an-organization", @@ -896,6 +918,17 @@ "user-to-server": true, "server-to-server": true, "additional-permissions": true + }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true } ] }, diff --git a/src/github-apps/data/fpt-2022-11-28/server-to-server-rest.json b/src/github-apps/data/fpt-2022-11-28/server-to-server-rest.json index d68183946326..4cd3be8dea32 100644 --- a/src/github-apps/data/fpt-2022-11-28/server-to-server-rest.json +++ b/src/github-apps/data/fpt-2022-11-28/server-to-server-rest.json @@ -1685,6 +1685,12 @@ "subcategory": "copilot-user-management", "verb": "get", "requestPath": "/orgs/{org}/members/{username}/copilot" + }, + { + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage" } ], "dependabot": [ diff --git a/src/github-apps/data/fpt-2022-11-28/user-to-server-rest.json b/src/github-apps/data/fpt-2022-11-28/user-to-server-rest.json index 884a7537821c..812701655c6c 100644 --- a/src/github-apps/data/fpt-2022-11-28/user-to-server-rest.json +++ b/src/github-apps/data/fpt-2022-11-28/user-to-server-rest.json @@ -1957,6 +1957,12 @@ "subcategory": "copilot-user-management", "verb": "get", "requestPath": "/orgs/{org}/members/{username}/copilot" + }, + { + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage" } ], "dependabot": [ diff --git a/src/github-apps/data/ghec-2022-11-28/fine-grained-pat-permissions.json b/src/github-apps/data/ghec-2022-11-28/fine-grained-pat-permissions.json index 53064ee85db2..8ef511b222c1 100644 --- a/src/github-apps/data/ghec-2022-11-28/fine-grained-pat-permissions.json +++ b/src/github-apps/data/ghec-2022-11-28/fine-grained-pat-permissions.json @@ -102,6 +102,15 @@ "additional-permissions": true, "access": "read" }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage", + "additional-permissions": true, + "access": "read" + }, { "category": "enterprise-admin", "slug": "list-provisioned-scim-groups-for-an-enterprise", @@ -765,6 +774,15 @@ "additional-permissions": false, "access": "read" }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage", + "additional-permissions": true, + "access": "read" + }, { "category": "orgs", "slug": "enable-or-disable-a-security-feature-for-an-organization", @@ -1151,6 +1169,15 @@ "requestPath": "/orgs/{org}/members/{username}/copilot", "additional-permissions": true, "access": "read" + }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage", + "additional-permissions": true, + "access": "read" } ] }, diff --git a/src/github-apps/data/ghec-2022-11-28/fine-grained-pat.json b/src/github-apps/data/ghec-2022-11-28/fine-grained-pat.json index 4ce1444eaf9c..062b33014fc7 100644 --- a/src/github-apps/data/ghec-2022-11-28/fine-grained-pat.json +++ b/src/github-apps/data/ghec-2022-11-28/fine-grained-pat.json @@ -2073,6 +2073,12 @@ "subcategory": "copilot-user-management", "verb": "get", "requestPath": "/orgs/{org}/members/{username}/copilot" + }, + { + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage" } ], "dependabot": [ diff --git a/src/github-apps/data/ghec-2022-11-28/server-to-server-permissions.json b/src/github-apps/data/ghec-2022-11-28/server-to-server-permissions.json index cc39fba6bc47..9c4df2d0ca4c 100644 --- a/src/github-apps/data/ghec-2022-11-28/server-to-server-permissions.json +++ b/src/github-apps/data/ghec-2022-11-28/server-to-server-permissions.json @@ -201,6 +201,17 @@ "server-to-server": true, "additional-permissions": true }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true + }, { "category": "enterprise-admin", "slug": "list-provisioned-scim-groups-for-an-enterprise", @@ -1010,6 +1021,17 @@ "server-to-server": true, "additional-permissions": false }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true + }, { "category": "orgs", "slug": "enable-or-disable-a-security-feature-for-an-organization", @@ -1474,6 +1496,17 @@ "user-to-server": true, "server-to-server": true, "additional-permissions": true + }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true } ] }, diff --git a/src/github-apps/data/ghec-2022-11-28/server-to-server-rest.json b/src/github-apps/data/ghec-2022-11-28/server-to-server-rest.json index 5a94a4488a77..fae92d52dd0d 100644 --- a/src/github-apps/data/ghec-2022-11-28/server-to-server-rest.json +++ b/src/github-apps/data/ghec-2022-11-28/server-to-server-rest.json @@ -1801,6 +1801,12 @@ "subcategory": "copilot-user-management", "verb": "get", "requestPath": "/orgs/{org}/members/{username}/copilot" + }, + { + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage" } ], "dependabot": [ diff --git a/src/github-apps/data/ghec-2022-11-28/user-to-server-rest.json b/src/github-apps/data/ghec-2022-11-28/user-to-server-rest.json index 4ce1444eaf9c..062b33014fc7 100644 --- a/src/github-apps/data/ghec-2022-11-28/user-to-server-rest.json +++ b/src/github-apps/data/ghec-2022-11-28/user-to-server-rest.json @@ -2073,6 +2073,12 @@ "subcategory": "copilot-user-management", "verb": "get", "requestPath": "/orgs/{org}/members/{username}/copilot" + }, + { + "slug": "get-a-summary-of-copilot-usage-for-a-team", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage" } ], "dependabot": [ diff --git a/src/github-apps/lib/config.json b/src/github-apps/lib/config.json index 5803b41153eb..ceab012a4280 100644 --- a/src/github-apps/lib/config.json +++ b/src/github-apps/lib/config.json @@ -60,5 +60,5 @@ "2022-11-28" ] }, - "sha": "0bb1cf439a7445ce2ad2375b82c47e7ac84dbfc3" + "sha": "29713de5ceec306c9e21e2ce7c5fe5b49d07f487" } \ No newline at end of file diff --git a/src/rest/data/fpt-2022-11-28/schema.json b/src/rest/data/fpt-2022-11-28/schema.json index 1f5729421278..438d11a28f76 100644 --- a/src/rest/data/fpt-2022-11-28/schema.json +++ b/src/rest/data/fpt-2022-11-28/schema.json @@ -217225,6 +217225,301 @@ "description": "
Internal Error
" } ] + }, + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage", + "title": "Get a summary of Copilot usage for a team", + "category": "copilot", + "subcategory": "copilot-usage", + "parameters": [ + { + "name": "org", + "description": "The organization name. The name is not case sensitive.
", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "team_slug", + "description": "The slug of the team name.
", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "since", + "description": "Show usage metrics since this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Maximum value is 28 days ago.
Show usage metrics until this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ) and should not preceed the since date if it is passed.
The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"
", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "per_page", + "description": "The number of days of metrics to display per page (max 28). For more information, see \"Using pagination in the REST API.\"
", + "in": "query", + "schema": { + "type": "integer", + "default": 28 + } + } + ], + "bodyParameters": [], + "progAccess": { + "userToServerRest": true, + "serverToServer": true, + "fineGrainedPat": true, + "permissions": [ + { + "\"GitHub Copilot Business\" organization permissions": "read", + "\"Administration\" organization permissions": "read", + "\"Enterprise administration\" business permissions": "read" + } + ] + }, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "org": "ORG", + "team_slug": "TEAM_SLUG" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "Response
", + "example": [ + { + "day": "2023-10-15", + "total_suggestions_count": 1000, + "total_acceptances_count": 800, + "total_lines_suggested": 1800, + "total_lines_accepted": 1200, + "total_active_users": 10, + "total_chat_acceptances": 32, + "total_chat_turns": 200, + "total_active_chat_users": 4, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 300, + "acceptances_count": 250, + "lines_suggested": 900, + "lines_accepted": 700, + "active_users": 5 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 300, + "acceptances_count": 200, + "lines_suggested": 400, + "lines_accepted": 300, + "active_users": 2 + }, + { + "language": "ruby", + "editor": "vscode", + "suggestions_count": 400, + "acceptances_count": 350, + "lines_suggested": 500, + "lines_accepted": 200, + "active_users": 3 + } + ] + }, + { + "day": "2023-10-16", + "total_suggestions_count": 800, + "total_acceptances_count": 600, + "total_lines_suggested": 1100, + "total_lines_accepted": 700, + "total_active_users": 12, + "total_chat_acceptances": 57, + "total_chat_turns": 426, + "total_active_chat_users": 8, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 300, + "acceptances_count": 200, + "lines_suggested": 600, + "lines_accepted": 300, + "active_users": 2 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 300, + "acceptances_count": 150, + "lines_suggested": 300, + "lines_accepted": 250, + "active_users": 6 + }, + { + "language": "ruby", + "editor": "vscode", + "suggestions_count": 200, + "acceptances_count": 150, + "lines_suggested": 200, + "lines_accepted": 150, + "active_users": 3 + } + ] + } + ], + "schema": { + "type": "array", + "items": { + "title": "Copilot Usage Metrics", + "description": "Summary of Copilot usage.", + "type": "object", + "properties": { + "day": { + "type": "string", + "format": "date", + "description": "The date for which the usage metrics are reported, in `YYYY-MM-DD` format." + }, + "total_suggestions_count": { + "type": "integer", + "description": "The total number of Copilot code completion suggestions shown to users." + }, + "total_acceptances_count": { + "type": "integer", + "description": "The total number of Copilot code completion suggestions accepted by users." + }, + "total_lines_suggested": { + "type": "integer", + "description": "The total number of lines of code completions suggested by Copilot." + }, + "total_lines_accepted": { + "type": "integer", + "description": "The total number of lines of code completions accepted by users." + }, + "total_active_users": { + "type": "integer", + "description": "The total number of users who were shown Copilot code completion suggestions during the day specified." + }, + "total_chat_acceptances": { + "type": "integer", + "description": "The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline)." + }, + "total_chat_turns": { + "type": "integer", + "description": "The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE." + }, + "total_active_chat_users": { + "type": "integer", + "description": "The total number of users who interacted with Copilot Chat in the IDE during the day specified." + }, + "breakdown": { + "type": [ + "array", + "null" + ], + "description": "Breakdown of Copilot code completions usage by language and editor", + "items": { + "type": "object", + "description": "Breakdown of Copilot usage by editor for this language", + "additionalProperties": true, + "properties": { + "language": { + "type": "string", + "description": "The language in which Copilot suggestions were shown to users in the specified editor." + }, + "editor": { + "type": "string", + "description": "The editor in which Copilot suggestions were shown to users for the specified language." + }, + "suggestions_count": { + "type": "integer", + "description": "The number of Copilot suggestions shown to users in the editor specified during the day specified." + }, + "acceptances_count": { + "type": "integer", + "description": "The number of Copilot suggestions accepted by users in the editor specified during the day specified." + }, + "lines_suggested": { + "type": "integer", + "description": "The number of lines of code suggested by Copilot in the editor specified during the day specified." + }, + "lines_accepted": { + "type": "integer", + "description": "The number of lines of code accepted by users in the editor specified during the day specified." + }, + "active_users": { + "type": "integer", + "description": "The number of users who were shown Copilot completion suggestions in the editor specified during the day specified." + } + } + } + } + }, + "required": [ + "day", + "breakdown" + ], + "additionalProperties": false + } + } + } + } + ], + "previews": [], + "descriptionHTML": "Note
\n\nThis endpoint is in beta and is subject to change.
\nYou can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE\nfor users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.\nSee the response schema tab for detailed metrics definitions.
\nThe response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day,\nand the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,\nthey must have telemetry enabled in their IDE.
\nNote
\n\nThis endpoint will only return results for a given day if the team had five or more members with active Copilot licenses, as evaluated at the end of that day.
\nOrganization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage metrics for a team.
\nOAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot, read:org, or read:enterprise scopes to use this endpoint.
OK
" + }, + { + "httpStatusCode": "401", + "description": "Requires authentication
" + }, + { + "httpStatusCode": "403", + "description": "Forbidden
" + }, + { + "httpStatusCode": "404", + "description": "Resource not found
" + }, + { + "httpStatusCode": "500", + "description": "Internal Error
" + } + ] } ], "copilot-user-management": [ @@ -361134,7 +361429,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -362375,7 +362671,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -363660,7 +363957,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -365014,7 +365312,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -366261,7 +366560,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -367547,7 +367847,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -489505,7 +489806,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -490755,7 +491057,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -491856,7 +492159,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -493221,7 +493525,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -494477,7 +494782,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -495579,7 +495885,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, diff --git a/src/rest/data/ghec-2022-11-28/schema.json b/src/rest/data/ghec-2022-11-28/schema.json index 39b6a2d8bf6f..4ed29c6c298c 100644 --- a/src/rest/data/ghec-2022-11-28/schema.json +++ b/src/rest/data/ghec-2022-11-28/schema.json @@ -228803,6 +228803,301 @@ "description": "Internal Error
" } ] + }, + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/usage", + "title": "Get a summary of Copilot usage for a team", + "category": "copilot", + "subcategory": "copilot-usage", + "parameters": [ + { + "name": "org", + "description": "The organization name. The name is not case sensitive.
", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "team_slug", + "description": "The slug of the team name.
", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "since", + "description": "Show usage metrics since this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Maximum value is 28 days ago.
Show usage metrics until this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ) and should not preceed the since date if it is passed.
The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"
", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "per_page", + "description": "The number of days of metrics to display per page (max 28). For more information, see \"Using pagination in the REST API.\"
", + "in": "query", + "schema": { + "type": "integer", + "default": 28 + } + } + ], + "bodyParameters": [], + "progAccess": { + "userToServerRest": true, + "serverToServer": true, + "fineGrainedPat": true, + "permissions": [ + { + "\"GitHub Copilot Business\" organization permissions": "read", + "\"Administration\" organization permissions": "read", + "\"Enterprise administration\" business permissions": "read" + } + ] + }, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "org": "ORG", + "team_slug": "TEAM_SLUG" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "Response
", + "example": [ + { + "day": "2023-10-15", + "total_suggestions_count": 1000, + "total_acceptances_count": 800, + "total_lines_suggested": 1800, + "total_lines_accepted": 1200, + "total_active_users": 10, + "total_chat_acceptances": 32, + "total_chat_turns": 200, + "total_active_chat_users": 4, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 300, + "acceptances_count": 250, + "lines_suggested": 900, + "lines_accepted": 700, + "active_users": 5 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 300, + "acceptances_count": 200, + "lines_suggested": 400, + "lines_accepted": 300, + "active_users": 2 + }, + { + "language": "ruby", + "editor": "vscode", + "suggestions_count": 400, + "acceptances_count": 350, + "lines_suggested": 500, + "lines_accepted": 200, + "active_users": 3 + } + ] + }, + { + "day": "2023-10-16", + "total_suggestions_count": 800, + "total_acceptances_count": 600, + "total_lines_suggested": 1100, + "total_lines_accepted": 700, + "total_active_users": 12, + "total_chat_acceptances": 57, + "total_chat_turns": 426, + "total_active_chat_users": 8, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 300, + "acceptances_count": 200, + "lines_suggested": 600, + "lines_accepted": 300, + "active_users": 2 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 300, + "acceptances_count": 150, + "lines_suggested": 300, + "lines_accepted": 250, + "active_users": 6 + }, + { + "language": "ruby", + "editor": "vscode", + "suggestions_count": 200, + "acceptances_count": 150, + "lines_suggested": 200, + "lines_accepted": 150, + "active_users": 3 + } + ] + } + ], + "schema": { + "type": "array", + "items": { + "title": "Copilot Usage Metrics", + "description": "Summary of Copilot usage.", + "type": "object", + "properties": { + "day": { + "type": "string", + "format": "date", + "description": "The date for which the usage metrics are reported, in `YYYY-MM-DD` format." + }, + "total_suggestions_count": { + "type": "integer", + "description": "The total number of Copilot code completion suggestions shown to users." + }, + "total_acceptances_count": { + "type": "integer", + "description": "The total number of Copilot code completion suggestions accepted by users." + }, + "total_lines_suggested": { + "type": "integer", + "description": "The total number of lines of code completions suggested by Copilot." + }, + "total_lines_accepted": { + "type": "integer", + "description": "The total number of lines of code completions accepted by users." + }, + "total_active_users": { + "type": "integer", + "description": "The total number of users who were shown Copilot code completion suggestions during the day specified." + }, + "total_chat_acceptances": { + "type": "integer", + "description": "The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline)." + }, + "total_chat_turns": { + "type": "integer", + "description": "The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE." + }, + "total_active_chat_users": { + "type": "integer", + "description": "The total number of users who interacted with Copilot Chat in the IDE during the day specified." + }, + "breakdown": { + "type": [ + "array", + "null" + ], + "description": "Breakdown of Copilot code completions usage by language and editor", + "items": { + "type": "object", + "description": "Breakdown of Copilot usage by editor for this language", + "additionalProperties": true, + "properties": { + "language": { + "type": "string", + "description": "The language in which Copilot suggestions were shown to users in the specified editor." + }, + "editor": { + "type": "string", + "description": "The editor in which Copilot suggestions were shown to users for the specified language." + }, + "suggestions_count": { + "type": "integer", + "description": "The number of Copilot suggestions shown to users in the editor specified during the day specified." + }, + "acceptances_count": { + "type": "integer", + "description": "The number of Copilot suggestions accepted by users in the editor specified during the day specified." + }, + "lines_suggested": { + "type": "integer", + "description": "The number of lines of code suggested by Copilot in the editor specified during the day specified." + }, + "lines_accepted": { + "type": "integer", + "description": "The number of lines of code accepted by users in the editor specified during the day specified." + }, + "active_users": { + "type": "integer", + "description": "The number of users who were shown Copilot completion suggestions in the editor specified during the day specified." + } + } + } + } + }, + "required": [ + "day", + "breakdown" + ], + "additionalProperties": false + } + } + } + } + ], + "previews": [], + "descriptionHTML": "Note
\n\nThis endpoint is in beta and is subject to change.
\nYou can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE\nfor users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.\nSee the response schema tab for detailed metrics definitions.
\nThe response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day,\nand the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,\nthey must have telemetry enabled in their IDE.
\nNote
\n\nThis endpoint will only return results for a given day if the team had five or more members with active Copilot licenses, as evaluated at the end of that day.
\nOrganization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage metrics for a team.
\nOAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot, read:org, or read:enterprise scopes to use this endpoint.
OK
" + }, + { + "httpStatusCode": "401", + "description": "Requires authentication
" + }, + { + "httpStatusCode": "403", + "description": "Forbidden
" + }, + { + "httpStatusCode": "404", + "description": "Resource not found
" + }, + { + "httpStatusCode": "500", + "description": "Internal Error
" + } + ] } ], "copilot-user-management": [ @@ -385317,7 +385612,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -386558,7 +386854,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -387843,7 +388140,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -389197,7 +389495,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -390444,7 +390743,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -391730,7 +392030,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -514083,7 +514384,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -515333,7 +515635,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -516434,7 +516737,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -517799,7 +518103,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -519055,7 +519360,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -520157,7 +520463,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, diff --git a/src/rest/data/ghes-3.14-2022-11-28/schema.json b/src/rest/data/ghes-3.14-2022-11-28/schema.json index 501045676ddc..285ff5e5ad32 100644 --- a/src/rest/data/ghes-3.14-2022-11-28/schema.json +++ b/src/rest/data/ghes-3.14-2022-11-28/schema.json @@ -335816,7 +335816,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -336980,7 +336981,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -338188,7 +338190,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -339465,7 +339468,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -340635,7 +340639,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -341844,7 +341849,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -462362,7 +462368,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -463535,7 +463542,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -464559,7 +464567,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -465847,7 +465856,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, @@ -467026,7 +467036,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -468051,7 +468062,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ], "description": "The type of actor that can bypass a ruleset.\n" }, diff --git a/src/rest/lib/config.json b/src/rest/lib/config.json index f7406255d90d..3f7f3874da9b 100644 --- a/src/rest/lib/config.json +++ b/src/rest/lib/config.json @@ -47,5 +47,5 @@ ] } }, - "sha": "0bb1cf439a7445ce2ad2375b82c47e7ac84dbfc3" + "sha": "29713de5ceec306c9e21e2ce7c5fe5b49d07f487" } \ No newline at end of file diff --git a/src/webhooks/data/fpt/schema.json b/src/webhooks/data/fpt/schema.json index 4eeb2f886b25..3e4e7a45ad24 100644 --- a/src/webhooks/data/fpt/schema.json +++ b/src/webhooks/data/fpt/schema.json @@ -203324,7 +203324,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -204417,7 +204418,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -205510,7 +205512,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { diff --git a/src/webhooks/data/ghec/schema.json b/src/webhooks/data/ghec/schema.json index 8082517dfdbe..bf37f43b2278 100644 --- a/src/webhooks/data/ghec/schema.json +++ b/src/webhooks/data/ghec/schema.json @@ -205658,7 +205658,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -206751,7 +206752,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -207844,7 +207846,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { diff --git a/src/webhooks/data/ghes-3.14/schema.json b/src/webhooks/data/ghes-3.14/schema.json index 301ba3b65c19..ed6de3fedea8 100644 --- a/src/webhooks/data/ghes-3.14/schema.json +++ b/src/webhooks/data/ghes-3.14/schema.json @@ -191418,7 +191418,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -192434,7 +192435,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { @@ -193450,7 +193452,8 @@ "OrganizationAdmin", "RepositoryRole", "Team", - "DeployKey" + "DeployKey", + "EnterpriseTeam" ] }, { diff --git a/src/webhooks/lib/config.json b/src/webhooks/lib/config.json index 3af8c1e479d6..4fd25cf1c39b 100644 --- a/src/webhooks/lib/config.json +++ b/src/webhooks/lib/config.json @@ -1,3 +1,3 @@ { - "sha": "0bb1cf439a7445ce2ad2375b82c47e7ac84dbfc3" + "sha": "29713de5ceec306c9e21e2ce7c5fe5b49d07f487" } \ No newline at end of file From 8c6e9740b707c7f55dfe086ee75e7b275db33bec Mon Sep 17 00:00:00 2001 From: Ru Levin