Skip to content

Commit

Permalink
feat: `octokit.interactions.{getRestrictionsForYourPublicRepos,remove…
Browse files Browse the repository at this point in the history
…RestrictionsForYourPublicRepos,setRestrictionsForYourPublicRepos}`
  • Loading branch information
gr2m committed Dec 1, 2020
1 parent ddaa863 commit e7988d9
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/generated/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,15 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
interactions: {
getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
getRestrictionsForYourPublicRepos: ["GET /user/interaction-limits"],
removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
removeRestrictionsForRepo: [
"DELETE /repos/{owner}/{repo}/interaction-limits",
],
removeRestrictionsForYourPublicRepos: ["DELETE /user/interaction-limits"],
setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
setRestrictionsForYourPublicRepos: ["PUT /user/interaction-limits"],
},
issues: {
addAssignees: [
Expand Down
57 changes: 49 additions & 8 deletions src/generated/method-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2105,7 +2105,7 @@ export type RestEndpointMethods = {
endpoint: EndpointInterface<{ url: string }>;
};
/**
* Lists all open code scanning alerts for the default branch (usually `master`) and protected branches in a repository. For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. GitHub Apps must have the `security_events` read permission to use this endpoint.
* Lists all open code scanning alerts for the default branch (usually `main` or `master`). For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. GitHub Apps must have the `security_events` read permission to use this endpoint.
*/
listAlertsForRepo: {
(
Expand Down Expand Up @@ -2781,7 +2781,7 @@ export type RestEndpointMethods = {
};
interactions: {
/**
* Shows which group of GitHub users can interact with this organization and when the restriction expires. If there are no restrictions, you will see an empty response.
* Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response.
*/
getRestrictionsForOrg: {
(
Expand All @@ -2793,7 +2793,7 @@ export type RestEndpointMethods = {
endpoint: EndpointInterface<{ url: string }>;
};
/**
* Shows which group of GitHub users can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response.
* Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response.
*/
getRestrictionsForRepo: {
(
Expand All @@ -2804,6 +2804,18 @@ export type RestEndpointMethods = {
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
/**
* Shows which type of GitHub user can interact with your public repositories and when the restriction expires. If there are no restrictions, you will see an empty response.
*/
getRestrictionsForYourPublicRepos: {
(
params?: RestEndpointMethodTypes["interactions"]["getRestrictionsForYourPublicRepos"]["parameters"]
): Promise<
RestEndpointMethodTypes["interactions"]["getRestrictionsForYourPublicRepos"]["response"]
>;
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
/**
* Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions.
*/
Expand All @@ -2817,7 +2829,7 @@ export type RestEndpointMethods = {
endpoint: EndpointInterface<{ url: string }>;
};
/**
* Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions.
* Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository.
*/
removeRestrictionsForRepo: {
(
Expand All @@ -2829,7 +2841,19 @@ export type RestEndpointMethods = {
endpoint: EndpointInterface<{ url: string }>;
};
/**
* Temporarily restricts interactions to certain GitHub users in any public repository in the given organization. You must be an organization owner to set these restrictions.
* Removes any interaction restrictions from your public repositories.
*/
removeRestrictionsForYourPublicRepos: {
(
params?: RestEndpointMethodTypes["interactions"]["removeRestrictionsForYourPublicRepos"]["parameters"]
): Promise<
RestEndpointMethodTypes["interactions"]["removeRestrictionsForYourPublicRepos"]["response"]
>;
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
/**
* Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization.
*/
setRestrictionsForOrg: {
(
Expand All @@ -2841,7 +2865,7 @@ export type RestEndpointMethods = {
endpoint: EndpointInterface<{ url: string }>;
};
/**
* Temporarily restricts interactions to certain GitHub users within the given repository. You must have owner or admin access to set restrictions.
* Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository.
*/
setRestrictionsForRepo: {
(
Expand All @@ -2852,6 +2876,18 @@ export type RestEndpointMethods = {
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
/**
* Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user.
*/
setRestrictionsForYourPublicRepos: {
(
params?: RestEndpointMethodTypes["interactions"]["setRestrictionsForYourPublicRepos"]["parameters"]
): Promise<
RestEndpointMethodTypes["interactions"]["setRestrictionsForYourPublicRepos"]["response"]
>;
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
};
issues: {
/**
Expand Down Expand Up @@ -6023,7 +6059,12 @@ export type RestEndpointMethods = {
endpoint: EndpointInterface<{ url: string }>;
};
/**
* This endpoint will return all community profile metrics, including an overall health score, repository description, the presence of documentation, detected code of conduct, detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE, README, and CONTRIBUTING files.
* This endpoint will return all community profile metrics, including an
* overall health score, repository description, the presence of documentation, detected
* code of conduct, detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE,
* README, and CONTRIBUTING files.
*
* `content_reports_enabled` is only returned for organization-owned repositories.
*/
getCommunityProfileMetrics: {
(
Expand Down Expand Up @@ -7133,7 +7174,7 @@ export type RestEndpointMethods = {
*
* `q=windows+label:bug+language:python+state:open&sort=created&order=asc`
*
* This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, whick means the oldest issues appear first in the search results.
* This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results.
*
* **Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)."
*/
Expand Down
24 changes: 24 additions & 0 deletions src/generated/parameters-and-response-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1602,6 +1602,14 @@ export type RestEndpointMethodTypes = {
>;
response: Endpoints["GET /repos/{owner}/{repo}/interaction-limits"]["response"];
};
getRestrictionsForYourPublicRepos: {
parameters: RequestParameters &
Omit<
Endpoints["GET /user/interaction-limits"]["parameters"],
"baseUrl" | "headers" | "mediaType"
>;
response: Endpoints["GET /user/interaction-limits"]["response"];
};
removeRestrictionsForOrg: {
parameters: RequestParameters &
Omit<
Expand All @@ -1618,6 +1626,14 @@ export type RestEndpointMethodTypes = {
>;
response: Endpoints["DELETE /repos/{owner}/{repo}/interaction-limits"]["response"];
};
removeRestrictionsForYourPublicRepos: {
parameters: RequestParameters &
Omit<
Endpoints["DELETE /user/interaction-limits"]["parameters"],
"baseUrl" | "headers" | "mediaType"
>;
response: Endpoints["DELETE /user/interaction-limits"]["response"];
};
setRestrictionsForOrg: {
parameters: RequestParameters &
Omit<
Expand All @@ -1634,6 +1650,14 @@ export type RestEndpointMethodTypes = {
>;
response: Endpoints["PUT /repos/{owner}/{repo}/interaction-limits"]["response"];
};
setRestrictionsForYourPublicRepos: {
parameters: RequestParameters &
Omit<
Endpoints["PUT /user/interaction-limits"]["parameters"],
"baseUrl" | "headers" | "mediaType"
>;
response: Endpoints["PUT /user/interaction-limits"]["response"];
};
};
issues: {
addAssignees: {
Expand Down

0 comments on commit e7988d9

Please sign in to comment.