Skip to content

Commit 7afbb17

Browse files
committed
WIP octokit/openapi updated
1 parent b6f4734 commit 7afbb17

16 files changed

+1029
-77
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
name: Get a summary of Copilot usage for enterprise members
3+
example: octokit.rest.copilot.usageMetricsForEnterprise({ enterprise })
4+
route: GET /enterprises/{enterprise}/copilot/usage
5+
scope: copilot
6+
type: API method
7+
---
8+
9+
# Get a summary of Copilot usage for enterprise members
10+
11+
**Note**: This endpoint is in beta and is subject to change.
12+
13+
You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE
14+
for all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances,
15+
and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.
16+
17+
The response contains metrics for the prior 28 days. Usage metrics are processed once per day for the previous day,
18+
and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
19+
they must have telemetry enabled in their IDE.
20+
21+
Only the owners and billing managers of enterprises with a Copilot Business or Enterprise subscription can view Copilot usage
22+
metrics for the enterprise.
23+
24+
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.
25+
26+
```js
27+
octokit.rest.copilot.usageMetricsForEnterprise({
28+
enterprise,
29+
});
30+
```
31+
32+
## Parameters
33+
34+
<table>
35+
<thead>
36+
<tr>
37+
<th>name</th>
38+
<th>required</th>
39+
<th>description</th>
40+
</tr>
41+
</thead>
42+
<tbody>
43+
<tr><td>enterprise</td><td>yes</td><td>
44+
45+
The slug version of the enterprise name. You can also substitute this value with the enterprise id.
46+
47+
</td></tr>
48+
<tr><td>since</td><td>no</td><td>
49+
50+
Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago.
51+
52+
</td></tr>
53+
<tr><td>until</td><td>no</td><td>
54+
55+
Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed.
56+
57+
</td></tr>
58+
<tr><td>page</td><td>no</td><td>
59+
60+
The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
61+
62+
</td></tr>
63+
<tr><td>per_page</td><td>no</td><td>
64+
65+
The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
66+
67+
</td></tr>
68+
</tbody>
69+
</table>
70+
71+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-enterprise-members).

docs/copilot/usageMetricsForOrg.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
name: Get a summary of Copilot usage for organization members
3+
example: octokit.rest.copilot.usageMetricsForOrg({ org })
4+
route: GET /orgs/{org}/copilot/usage
5+
scope: copilot
6+
type: API method
7+
---
8+
9+
# Get a summary of Copilot usage for organization members
10+
11+
**Note**: This endpoint is in beta and is subject to change.
12+
13+
You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE
14+
across an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.
15+
See the response schema tab for detailed metrics definitions.
16+
17+
The response contains metrics for the prior 28 days. Usage metrics are processed once per day for the previous day,
18+
and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
19+
they must have telemetry enabled in their IDE.
20+
21+
Copilot Business or Copilot Enterprise organization owners, and owners and billing managers of their parent enterprises, can view
22+
Copilot usage metrics.
23+
24+
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.
25+
26+
```js
27+
octokit.rest.copilot.usageMetricsForOrg({
28+
org,
29+
});
30+
```
31+
32+
## Parameters
33+
34+
<table>
35+
<thead>
36+
<tr>
37+
<th>name</th>
38+
<th>required</th>
39+
<th>description</th>
40+
</tr>
41+
</thead>
42+
<tbody>
43+
<tr><td>org</td><td>yes</td><td>
44+
45+
The organization name. The name is not case sensitive.
46+
47+
</td></tr>
48+
<tr><td>since</td><td>no</td><td>
49+
50+
Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago.
51+
52+
</td></tr>
53+
<tr><td>until</td><td>no</td><td>
54+
55+
Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed.
56+
57+
</td></tr>
58+
<tr><td>page</td><td>no</td><td>
59+
60+
The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
61+
62+
</td></tr>
63+
<tr><td>per_page</td><td>no</td><td>
64+
65+
The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
66+
67+
</td></tr>
68+
</tbody>
69+
</table>
70+
71+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-organization-members).

docs/copilot/usageMetricsForTeam.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
name: Get a summary of Copilot usage for a team
3+
example: octokit.rest.copilot.usageMetricsForTeam({ org, team_slug })
4+
route: GET /orgs/{org}/team/{team_slug}/copilot/usage
5+
scope: copilot
6+
type: API method
7+
---
8+
9+
# Get a summary of Copilot usage for a team
10+
11+
**Note**: This endpoint is in beta and is subject to change.
12+
13+
You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE
14+
for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.
15+
See the response schema tab for detailed metrics definitions.
16+
17+
The response contains metrics for the prior 28 days. Usage metrics are processed once per day for the previous day,
18+
and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
19+
they must have telemetry enabled in their IDE.
20+
21+
**Note**: This endpoint will only return results for a given day if the team had five or more members on that day.
22+
23+
Copilot Business or Copilot Enterprise organization owners for the organization that contains this team,
24+
and owners and billing managers of their parent enterprises, can view Copilot usage metrics for a team.
25+
26+
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.
27+
28+
```js
29+
octokit.rest.copilot.usageMetricsForTeam({
30+
org,
31+
team_slug,
32+
});
33+
```
34+
35+
## Parameters
36+
37+
<table>
38+
<thead>
39+
<tr>
40+
<th>name</th>
41+
<th>required</th>
42+
<th>description</th>
43+
</tr>
44+
</thead>
45+
<tbody>
46+
<tr><td>org</td><td>yes</td><td>
47+
48+
The organization name. The name is not case sensitive.
49+
50+
</td></tr>
51+
<tr><td>team_slug</td><td>yes</td><td>
52+
53+
The slug of the team name.
54+
55+
</td></tr>
56+
<tr><td>since</td><td>no</td><td>
57+
58+
Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago.
59+
60+
</td></tr>
61+
<tr><td>until</td><td>no</td><td>
62+
63+
Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed.
64+
65+
</td></tr>
66+
<tr><td>page</td><td>no</td><td>
67+
68+
The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
69+
70+
</td></tr>
71+
<tr><td>per_page</td><td>no</td><td>
72+
73+
The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
74+
75+
</td></tr>
76+
</tbody>
77+
</table>
78+
79+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-a-team).

docs/pulls/create.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ This endpoint supports the following custom media types. For more information, s
2020
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
2121
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
2222
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
23-
- **`application/vnd.github.diff`**: For more information, see "[git-diff](https://git-scm.com/docs/git-diff)" in the Git documentation. If a diff is corrupt, contact us through the [GitHub Support portal](https://support.github.com/). Include the repository name and pull request ID in your message.
2423

2524
```js
2625
octokit.rest.pulls.create({

docs/pulls/list.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ This endpoint supports the following custom media types. For more information, s
2222
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
2323
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
2424
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
25-
- **`application/vnd.github.diff`**: For more information, see "[git-diff](https://git-scm.com/docs/git-diff)" in the Git documentation. If a diff is corrupt, contact us through the [GitHub Support portal](https://support.github.com/). Include the repository name and pull request ID in your message.
26-
- **`application/vnd.github.patch`**: For more information, see "[git-format-patch](https://git-scm.com/docs/git-format-patch)" in the Git documentation.
2725

2826
```js
2927
octokit.rest.pulls.list({

docs/pulls/listCommits.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ This endpoint supports the following custom media types. For more information, s
1818
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
1919
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
2020
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
21-
- **`application/vnd.github.diff`**: For more information, see "[git-diff](https://git-scm.com/docs/git-diff)" in the Git documentation. If a diff is corrupt, contact us through the [GitHub Support portal](https://support.github.com/). Include the repository name and pull request ID in your message.
2221

2322
```js
2423
octokit.rest.pulls.listCommits({

docs/pulls/listFiles.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ This endpoint supports the following custom media types. For more information, s
1919
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
2020
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
2121
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
22-
- **`application/vnd.github.diff`**: For more information, see "[git-diff](https://git-scm.com/docs/git-diff)" in the Git documentation. If a diff is corrupt, contact us through the [GitHub Support portal](https://support.github.com/). Include the repository name and pull request ID in your message.
2322

2423
```js
2524
octokit.rest.pulls.listFiles({

docs/pulls/update.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ This endpoint supports the following custom media types. For more information, s
1818
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
1919
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
2020
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
21-
- **`application/vnd.github.diff`**: For more information, see "[git-diff](https://git-scm.com/docs/git-diff)" in the Git documentation. If a diff is corrupt, contact us through the [GitHub Support portal](https://support.github.com/). Include the repository name and pull request ID in your message.
2221

2322
```js
2423
octokit.rest.pulls.update({

docs/repos/createOrgRuleset.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Create an organization repository ruleset
3-
example: octokit.rest.repos.createOrgRuleset({ org, name, enforcement, bypass_actors[].actor_id, bypass_actors[].actor_type, bypass_actors[].bypass_mode, rules[].type, rules[].parameters.update_allows_fetch_and_merge, rules[].parameters.required_deployment_environments, rules[].parameters.dismiss_stale_reviews_on_push, rules[].parameters.require_code_owner_review, rules[].parameters.require_last_push_approval, rules[].parameters.required_approving_review_count, rules[].parameters.required_review_thread_resolution, rules[].parameters.required_status_checks, rules[].parameters.required_status_checks[].context, rules[].parameters.strict_required_status_checks_policy, rules[].parameters.operator, rules[].parameters.pattern, rules[].parameters.workflows, rules[].parameters.workflows[].path, rules[].parameters.workflows[].repository_id })
3+
example: octokit.rest.repos.createOrgRuleset({ org, name, enforcement, bypass_actors[].actor_type, bypass_actors[].bypass_mode, rules[].type, rules[].parameters.update_allows_fetch_and_merge, rules[].parameters.required_deployment_environments, rules[].parameters.dismiss_stale_reviews_on_push, rules[].parameters.require_code_owner_review, rules[].parameters.require_last_push_approval, rules[].parameters.required_approving_review_count, rules[].parameters.required_review_thread_resolution, rules[].parameters.required_status_checks, rules[].parameters.required_status_checks[].context, rules[].parameters.strict_required_status_checks_policy, rules[].parameters.operator, rules[].parameters.pattern, rules[].parameters.restricted_file_paths, rules[].parameters.max_file_path_length, rules[].parameters.restricted_file_extensions, rules[].parameters.max_file_size, rules[].parameters.workflows, rules[].parameters.workflows[].path, rules[].parameters.workflows[].repository_id })
44
route: POST /orgs/{org}/rulesets
55
scope: repos
66
type: API method
@@ -15,7 +15,6 @@ octokit.rest.repos.createOrgRuleset({
1515
org,
1616
name,
1717
enforcement,
18-
bypass_actors[].actor_id,
1918
bypass_actors[].actor_type,
2019
bypass_actors[].bypass_mode,
2120
rules[].type,
@@ -31,6 +30,10 @@ rules[].parameters.required_status_checks[].context,
3130
rules[].parameters.strict_required_status_checks_policy,
3231
rules[].parameters.operator,
3332
rules[].parameters.pattern,
33+
rules[].parameters.restricted_file_paths,
34+
rules[].parameters.max_file_path_length,
35+
rules[].parameters.restricted_file_extensions,
36+
rules[].parameters.max_file_size,
3437
rules[].parameters.workflows,
3538
rules[].parameters.workflows[].path,
3639
rules[].parameters.workflows[].repository_id
@@ -60,7 +63,9 @@ The name of the ruleset.
6063
</td></tr>
6164
<tr><td>target</td><td>no</td><td>
6265

63-
The target of the ruleset.
66+
The target of the ruleset
67+
68+
**Note**: The `push` target is in beta and is subject to change.
6469

6570
</td></tr>
6671
<tr><td>enforcement</td><td>yes</td><td>
@@ -73,19 +78,19 @@ The enforcement level of the ruleset. `evaluate` allows admins to test rules bef
7378
The actors that can bypass the rules in this ruleset
7479

7580
</td></tr>
76-
<tr><td>bypass_actors[].actor_id</td><td>yes</td><td>
81+
<tr><td>bypass_actors[].actor_id</td><td>no</td><td>
7782

78-
The ID of the actor that can bypass a ruleset. If `actor_type` is `OrganizationAdmin`, this should be `1`.
83+
The ID of the actor that can bypass a ruleset. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories.
7984

8085
</td></tr>
8186
<tr><td>bypass_actors[].actor_type</td><td>yes</td><td>
8287

83-
The type of actor that can bypass a ruleset
88+
The type of actor that can bypass a ruleset.
8489

8590
</td></tr>
8691
<tr><td>bypass_actors[].bypass_mode</td><td>yes</td><td>
8792

88-
When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests.
93+
When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type.
8994

9095
</td></tr>
9196
<tr><td>conditions</td><td>no</td><td>
@@ -178,6 +183,26 @@ The operator to use for matching.
178183

179184
The pattern to match with.
180185

186+
</td></tr>
187+
<tr><td>rules[].parameters.restricted_file_paths</td><td>yes</td><td>
188+
189+
The file paths that are restricted from being pushed to the commit graph.
190+
191+
</td></tr>
192+
<tr><td>rules[].parameters.max_file_path_length</td><td>yes</td><td>
193+
194+
The maximum amount of characters allowed in file paths
195+
196+
</td></tr>
197+
<tr><td>rules[].parameters.restricted_file_extensions</td><td>yes</td><td>
198+
199+
The file extensions that are restricted from being pushed to the commit graph.
200+
201+
</td></tr>
202+
<tr><td>rules[].parameters.max_file_size</td><td>yes</td><td>
203+
204+
The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS).
205+
181206
</td></tr>
182207
<tr><td>rules[].parameters.workflows</td><td>yes</td><td>
183208

0 commit comments

Comments
 (0)