From 19c5b7169cba13ba950dc6104571df460ed76fcf Mon Sep 17 00:00:00 2001 From: docs-bot <77750099+docs-bot@users.noreply.github.com> Date: Tue, 23 Apr 2024 09:01:31 -0700 Subject: [PATCH] Update OpenAPI Description (#50272) Co-authored-by: Tali Herzka --- content/rest/copilot/copilot-usage.md | 14 + content/rest/copilot/index.md | 2 + .../fine-grained-pat-permissions.json | 36 + .../data/fpt-2022-11-28/fine-grained-pat.json | 12 + .../server-to-server-permissions.json | 61 ++ .../fpt-2022-11-28/server-to-server-rest.json | 12 + .../fpt-2022-11-28/user-to-server-rest.json | 12 + .../fine-grained-pat-permissions.json | 36 + .../ghec-2022-11-28/fine-grained-pat.json | 12 + .../server-to-server-permissions.json | 55 ++ .../server-to-server-rest.json | 12 + .../ghec-2022-11-28/user-to-server-rest.json | 12 + src/github-apps/lib/config.json | 2 +- src/rest/data/fpt-2022-11-28/schema.json | 870 ++++++++++++++++++ src/rest/data/ghec-2022-11-28/schema.json | 870 ++++++++++++++++++ src/rest/lib/config.json | 2 +- src/webhooks/lib/config.json | 2 +- 17 files changed, 2019 insertions(+), 3 deletions(-) create mode 100644 content/rest/copilot/copilot-usage.md diff --git a/content/rest/copilot/copilot-usage.md b/content/rest/copilot/copilot-usage.md new file mode 100644 index 0000000000..6e80ecf0b6 --- /dev/null +++ b/content/rest/copilot/copilot-usage.md @@ -0,0 +1,14 @@ +--- +title: REST API endpoints for GitHub Copilot usage metrics +shortTitle: Copilot usage +intro: 'Use the REST API to access {% data variables.product.prodname_copilot_short %} usage metrics for an enterprise, an organization, or a team.' +versions: # DO NOT MANUALLY EDIT. CHANGES WILL BE OVERWRITTEN BY A 🤖 + fpt: '*' + ghec: '*' +topics: + - API +autogenerated: rest +allowTitleToDifferFromFilename: true +--- + + diff --git a/content/rest/copilot/index.md b/content/rest/copilot/index.md index 0daa0030d7..2a9a9f6836 100644 --- a/content/rest/copilot/index.md +++ b/content/rest/copilot/index.md @@ -10,8 +10,10 @@ topics: autogenerated: rest allowTitleToDifferFromFilename: true children: + - /copilot-usage - /copilot-user-management versions: fpt: '*' ghec: '*' --- + 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 e0e32e2291..9608e6a1c6 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 @@ -147,6 +147,15 @@ "additional-permissions": false, "access": "write" }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-organization-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage", + "additional-permissions": true, + "access": "read" + }, { "category": "orgs", "slug": "list-app-installations-for-an-organization", @@ -300,6 +309,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", @@ -555,6 +573,15 @@ "additional-permissions": false, "access": "write" }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-organization-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage", + "additional-permissions": true, + "access": "write" + }, { "category": "copilot", "slug": "get-copilot-seat-assignment-details-for-a-user", @@ -563,6 +590,15 @@ "requestPath": "/orgs/{org}/members/{username}/copilot", "additional-permissions": false, "access": "write" + }, + { + "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": "write" } ] }, 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 4eb32642d0..f167391ba0 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 @@ -1866,11 +1866,23 @@ "verb": "delete", "requestPath": "/orgs/{org}/copilot/billing/selected_users" }, + { + "slug": "get-a-summary-of-copilot-usage-for-organization-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage" + }, { "slug": "get-copilot-seat-assignment-details-for-a-user", "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 3423404de7..ad379e7bc4 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 @@ -1,4 +1,21 @@ { + "enterprise_administration": { + "title": "Enterprise administration", + "displayTitle": "Business permissions for \"Enterprise administration\"", + "permissions": [ + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-enterprise-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/enterprises/{enterprise}/copilot/usage", + "access": "read", + "user-to-server": false, + "server-to-server": false, + "additional-permissions": false + } + ] + }, "organization_administration": { "title": "Administration", "displayTitle": "Organization permissions for \"Administration\"", @@ -179,6 +196,17 @@ "server-to-server": true, "additional-permissions": false }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-organization-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true + }, { "category": "orgs", "slug": "list-app-installations-for-an-organization", @@ -366,6 +394,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", @@ -671,6 +710,17 @@ "server-to-server": true, "additional-permissions": false }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-organization-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage", + "access": "write", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true + }, { "category": "copilot", "slug": "get-copilot-seat-assignment-details-for-a-user", @@ -681,6 +731,17 @@ "user-to-server": true, "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": "write", + "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 ef8fad168c..f52cd76e2e 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 @@ -1594,11 +1594,23 @@ "verb": "delete", "requestPath": "/orgs/{org}/copilot/billing/selected_users" }, + { + "slug": "get-a-summary-of-copilot-usage-for-organization-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage" + }, { "slug": "get-copilot-seat-assignment-details-for-a-user", "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 4eb32642d0..f167391ba0 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 @@ -1866,11 +1866,23 @@ "verb": "delete", "requestPath": "/orgs/{org}/copilot/billing/selected_users" }, + { + "slug": "get-a-summary-of-copilot-usage-for-organization-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage" + }, { "slug": "get-copilot-seat-assignment-details-for-a-user", "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 0c8006a754..3724d7244c 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 @@ -369,6 +369,15 @@ "additional-permissions": false, "access": "read" }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-organization-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage", + "additional-permissions": true, + "access": "read" + }, { "category": "orgs", "slug": "list-saml-sso-authorizations-for-an-organization", @@ -594,6 +603,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", @@ -963,6 +981,15 @@ "additional-permissions": false, "access": "write" }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-organization-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage", + "additional-permissions": true, + "access": "write" + }, { "category": "copilot", "slug": "get-copilot-seat-assignment-details-for-a-user", @@ -971,6 +998,15 @@ "requestPath": "/orgs/{org}/members/{username}/copilot", "additional-permissions": false, "access": "write" + }, + { + "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": "write" } ] }, 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 4d6c4aa0fa..a5c21f6e11 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 @@ -1982,11 +1982,23 @@ "verb": "delete", "requestPath": "/orgs/{org}/copilot/billing/selected_users" }, + { + "slug": "get-a-summary-of-copilot-usage-for-organization-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage" + }, { "slug": "get-copilot-seat-assignment-details-for-a-user", "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 ef07e41f7c..b99389b36e 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 @@ -58,6 +58,17 @@ "server-to-server": true, "additional-permissions": false }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-enterprise-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/enterprises/{enterprise}/copilot/usage", + "access": "read", + "user-to-server": false, + "server-to-server": false, + "additional-permissions": false + }, { "category": "enterprise-admin", "slug": "get-a-license-sync-status", @@ -449,6 +460,17 @@ "server-to-server": true, "additional-permissions": false }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-organization-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true + }, { "category": "orgs", "slug": "list-saml-sso-authorizations-for-an-organization", @@ -724,6 +746,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", @@ -1167,6 +1200,17 @@ "server-to-server": true, "additional-permissions": false }, + { + "category": "copilot", + "slug": "get-a-summary-of-copilot-usage-for-organization-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage", + "access": "write", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true + }, { "category": "copilot", "slug": "get-copilot-seat-assignment-details-for-a-user", @@ -1177,6 +1221,17 @@ "user-to-server": true, "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": "write", + "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 da52e8d9a6..5f082591d9 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 @@ -1710,11 +1710,23 @@ "verb": "delete", "requestPath": "/orgs/{org}/copilot/billing/selected_users" }, + { + "slug": "get-a-summary-of-copilot-usage-for-organization-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage" + }, { "slug": "get-copilot-seat-assignment-details-for-a-user", "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 4d6c4aa0fa..a5c21f6e11 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 @@ -1982,11 +1982,23 @@ "verb": "delete", "requestPath": "/orgs/{org}/copilot/billing/selected_users" }, + { + "slug": "get-a-summary-of-copilot-usage-for-organization-members", + "subcategory": "copilot-usage", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage" + }, { "slug": "get-copilot-seat-assignment-details-for-a-user", "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 2e17de5464..c6f40a8a58 100644 --- a/src/github-apps/lib/config.json +++ b/src/github-apps/lib/config.json @@ -60,5 +60,5 @@ "2022-11-28" ] }, - "sha": "766b9223ff249ba0b09a4ebd16c9cabb44cc63a6" + "sha": "c820ff3f990e9f1ae900163bc27591d01e3ef933" } \ 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 98369be6db..4160667bc9 100644 --- a/src/rest/data/fpt-2022-11-28/schema.json +++ b/src/rest/data/fpt-2022-11-28/schema.json @@ -206389,6 +206389,876 @@ ] }, "copilot": { + "copilot-usage": [ + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/enterprises/{enterprise}/copilot/usage", + "title": "Get a summary of Copilot usage for enterprise members", + "category": "copilot", + "subcategory": "copilot-usage", + "parameters": [ + { + "name": "enterprise", + "description": "

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

", + "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.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "until", + "description": "

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.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "page", + "description": "

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": [], + "enabledForGitHubApps": true, + "progAccess": { + "userToServerRest": false, + "serverToServer": false, + "fineGrainedPat": false, + "permissions": [ + { + "enterprise_administration": "read" + } + ] + }, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "enterprise": "ENTERPRISE" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": [ + { + "day": "2023-10-15", + "total_suggestions_count": 5000, + "total_acceptances_count": 3000, + "total_lines_suggested": 7000, + "total_lines_accepted": 3500, + "total_active_users": 15, + "total_chat_acceptances": 45, + "total_chat_turns": 350, + "total_active_chat_users": 8, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 3000, + "acceptances_count": 2000, + "lines_suggested": 3000, + "lines_accepted": 1500, + "active_users": 5 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 1000, + "acceptances_count": 500, + "lines_suggested": 2000, + "lines_accepted": 1000, + "active_users": 5 + }, + { + "language": "javascript", + "editor": "vscode", + "suggestions_count": 1000, + "acceptances_count": 500, + "lines_suggested": 2000, + "lines_accepted": 1000, + "active_users": 5 + } + ] + }, + { + "day": "2023-10-16", + "total_suggestions_count": 5200, + "total_acceptances_count": 5100, + "total_lines_suggested": 5300, + "total_lines_accepted": 5000, + "total_active_users": 15, + "total_chat_acceptances": 57, + "total_chat_turns": 455, + "total_active_chat_users": 12, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 3100, + "acceptances_count": 3000, + "lines_suggested": 3200, + "lines_accepted": 3100, + "active_users": 5 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 1100, + "acceptances_count": 1000, + "lines_suggested": 1200, + "lines_accepted": 1100, + "active_users": 5 + }, + { + "language": "javascript", + "editor": "vscode", + "suggestions_count": 1000, + "acceptances_count": 900, + "lines_suggested": 1100, + "lines_accepted": 1000, + "active_users": 5 + } + ] + } + ], + "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: This endpoint is in beta and is subject to change.

\n

You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE\nfor all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances,\nand number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.

\n

The response contains metrics for the prior 28 days. 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.

\n

Only the owners and billing managers of enterprises with a Copilot Business or Enterprise subscription can view Copilot usage\nmetrics for the enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the copilot, manage_billing:copilot, admin:enterprise, or manage_billing:enterprise scope to use this endpoint.

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

OK

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

Requires authentication

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

Forbidden

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

Resource not found

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

Internal Error

" + } + ] + }, + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage", + "title": "Get a summary of Copilot usage for organization members", + "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": "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.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "until", + "description": "

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.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "page", + "description": "

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": [], + "enabledForGitHubApps": true, + "progAccess": { + "userToServerRest": true, + "serverToServer": true, + "fineGrainedPat": true, + "permissions": [ + { + "organization_copilot_seat_management": "write" + }, + { + "organization_administration": "read" + } + ] + }, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "org": "ORG" + } + }, + "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: This endpoint is in beta and is subject to change.

\n

You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE\nacross an organization, 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.

\n

The response contains metrics for the prior 28 days. 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.

\n

Copilot Business or Copilot Enterprise organization owners, and owners and billing managers of their parent enterprises, can view\nCopilot usage metrics.

\n

OAuth app tokens and personal access tokens (classic) need the copilot, manage_billing:copilot, admin:org, admin:enterprise, or manage_billing:enterprise scope to use this endpoint.

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

OK

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

Requires authentication

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

Forbidden

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

Resource not found

" + }, + { + "httpStatusCode": "500", + "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.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "until", + "description": "

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.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "page", + "description": "

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": [], + "enabledForGitHubApps": true, + "progAccess": { + "userToServerRest": true, + "serverToServer": true, + "fineGrainedPat": true, + "permissions": [ + { + "organization_copilot_seat_management": "write" + }, + { + "organization_administration": "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: This endpoint is in beta and is subject to change.

\n

You 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.

\n

The response contains metrics for the prior 28 days. 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.

\n

Note: This endpoint will only return results for a given day if the team had five or more members on that day.

\n

Copilot Business or Copilot Enterprise organization owners for the organization that contains this team,\nand owners and billing managers of their parent enterprises, can view Copilot usage metrics for a team.

\n

OAuth app tokens and personal access tokens (classic) need the copilot, manage_billing:copilot, admin:org, admin:enterprise, or manage_billing:enterprise scope to use this endpoint.

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

OK

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

Requires authentication

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

Forbidden

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

Resource not found

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

Internal Error

" + } + ] + } + ], "copilot-user-management": [ { "serverUrl": "https://api.github.com", diff --git a/src/rest/data/ghec-2022-11-28/schema.json b/src/rest/data/ghec-2022-11-28/schema.json index ac257fe865..1a053b735e 100644 --- a/src/rest/data/ghec-2022-11-28/schema.json +++ b/src/rest/data/ghec-2022-11-28/schema.json @@ -217980,6 +217980,876 @@ ] }, "copilot": { + "copilot-usage": [ + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/enterprises/{enterprise}/copilot/usage", + "title": "Get a summary of Copilot usage for enterprise members", + "category": "copilot", + "subcategory": "copilot-usage", + "parameters": [ + { + "name": "enterprise", + "description": "

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

", + "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.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "until", + "description": "

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.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "page", + "description": "

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": [], + "enabledForGitHubApps": true, + "progAccess": { + "userToServerRest": false, + "serverToServer": false, + "fineGrainedPat": false, + "permissions": [ + { + "enterprise_administration": "read" + } + ] + }, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "enterprise": "ENTERPRISE" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": [ + { + "day": "2023-10-15", + "total_suggestions_count": 5000, + "total_acceptances_count": 3000, + "total_lines_suggested": 7000, + "total_lines_accepted": 3500, + "total_active_users": 15, + "total_chat_acceptances": 45, + "total_chat_turns": 350, + "total_active_chat_users": 8, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 3000, + "acceptances_count": 2000, + "lines_suggested": 3000, + "lines_accepted": 1500, + "active_users": 5 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 1000, + "acceptances_count": 500, + "lines_suggested": 2000, + "lines_accepted": 1000, + "active_users": 5 + }, + { + "language": "javascript", + "editor": "vscode", + "suggestions_count": 1000, + "acceptances_count": 500, + "lines_suggested": 2000, + "lines_accepted": 1000, + "active_users": 5 + } + ] + }, + { + "day": "2023-10-16", + "total_suggestions_count": 5200, + "total_acceptances_count": 5100, + "total_lines_suggested": 5300, + "total_lines_accepted": 5000, + "total_active_users": 15, + "total_chat_acceptances": 57, + "total_chat_turns": 455, + "total_active_chat_users": 12, + "breakdown": [ + { + "language": "python", + "editor": "vscode", + "suggestions_count": 3100, + "acceptances_count": 3000, + "lines_suggested": 3200, + "lines_accepted": 3100, + "active_users": 5 + }, + { + "language": "python", + "editor": "jetbrains", + "suggestions_count": 1100, + "acceptances_count": 1000, + "lines_suggested": 1200, + "lines_accepted": 1100, + "active_users": 5 + }, + { + "language": "javascript", + "editor": "vscode", + "suggestions_count": 1000, + "acceptances_count": 900, + "lines_suggested": 1100, + "lines_accepted": 1000, + "active_users": 5 + } + ] + } + ], + "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: This endpoint is in beta and is subject to change.

\n

You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE\nfor all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances,\nand number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.

\n

The response contains metrics for the prior 28 days. 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.

\n

Only the owners and billing managers of enterprises with a Copilot Business or Enterprise subscription can view Copilot usage\nmetrics for the enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the copilot, manage_billing:copilot, admin:enterprise, or manage_billing:enterprise scope to use this endpoint.

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

OK

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

Requires authentication

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

Forbidden

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

Resource not found

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

Internal Error

" + } + ] + }, + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/usage", + "title": "Get a summary of Copilot usage for organization members", + "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": "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.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "until", + "description": "

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.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "page", + "description": "

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": [], + "enabledForGitHubApps": true, + "progAccess": { + "userToServerRest": true, + "serverToServer": true, + "fineGrainedPat": true, + "permissions": [ + { + "organization_copilot_seat_management": "write" + }, + { + "organization_administration": "read" + } + ] + }, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "org": "ORG" + } + }, + "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: This endpoint is in beta and is subject to change.

\n

You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE\nacross an organization, 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.

\n

The response contains metrics for the prior 28 days. 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.

\n

Copilot Business or Copilot Enterprise organization owners, and owners and billing managers of their parent enterprises, can view\nCopilot usage metrics.

\n

OAuth app tokens and personal access tokens (classic) need the copilot, manage_billing:copilot, admin:org, admin:enterprise, or manage_billing:enterprise scope to use this endpoint.

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

OK

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

Requires authentication

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

Forbidden

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

Resource not found

" + }, + { + "httpStatusCode": "500", + "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.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "until", + "description": "

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.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "page", + "description": "

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": [], + "enabledForGitHubApps": true, + "progAccess": { + "userToServerRest": true, + "serverToServer": true, + "fineGrainedPat": true, + "permissions": [ + { + "organization_copilot_seat_management": "write" + }, + { + "organization_administration": "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: This endpoint is in beta and is subject to change.

\n

You 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.

\n

The response contains metrics for the prior 28 days. 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.

\n

Note: This endpoint will only return results for a given day if the team had five or more members on that day.

\n

Copilot Business or Copilot Enterprise organization owners for the organization that contains this team,\nand owners and billing managers of their parent enterprises, can view Copilot usage metrics for a team.

\n

OAuth app tokens and personal access tokens (classic) need the copilot, manage_billing:copilot, admin:org, admin:enterprise, or manage_billing:enterprise scope to use this endpoint.

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

OK

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

Requires authentication

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

Forbidden

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

Resource not found

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

Internal Error

" + } + ] + } + ], "copilot-user-management": [ { "serverUrl": "https://api.github.com", diff --git a/src/rest/lib/config.json b/src/rest/lib/config.json index 23cd4f0e28..ea24152d80 100644 --- a/src/rest/lib/config.json +++ b/src/rest/lib/config.json @@ -44,5 +44,5 @@ ] } }, - "sha": "766b9223ff249ba0b09a4ebd16c9cabb44cc63a6" + "sha": "c820ff3f990e9f1ae900163bc27591d01e3ef933" } \ No newline at end of file diff --git a/src/webhooks/lib/config.json b/src/webhooks/lib/config.json index 31c4a6b53b..9ca146231b 100644 --- a/src/webhooks/lib/config.json +++ b/src/webhooks/lib/config.json @@ -1,3 +1,3 @@ { - "sha": "766b9223ff249ba0b09a4ebd16c9cabb44cc63a6" + "sha": "c820ff3f990e9f1ae900163bc27591d01e3ef933" } \ No newline at end of file