pub struct Caller<Connector, Sleep, SleepFut, SleepOut>where
Connector: Connect + Clone + Sync + Send + 'static,
Sleep: Fn(Duration) -> SleepFut,
SleepFut: Future<Output = SleepOut>,{ /* private fields */ }
Implementations§
Source§impl<Connector, Sleep, SleepFut, SleepOut> Caller<Connector, Sleep, SleepFut, SleepOut>
impl<Connector, Sleep, SleepFut, SleepOut> Caller<Connector, Sleep, SleepFut, SleepOut>
pub fn new( client: Client<Connector>, config: Configuration, sleep: Sleep, ) -> Caller<Connector, Sleep, SleepFut, SleepOut>
Sourcepub async fn meta_root(&self) -> Result<Response<Body>, ApiError>
pub async fn meta_root(&self) -> Result<Response<Body>, ApiError>
GitHub API Root
Get Hypermedia links to resources accessible in GitHub’s REST API
Sourcepub async fn apps_get_authenticated(&self) -> Result<Response<Body>, ApiError>
pub async fn apps_get_authenticated(&self) -> Result<Response<Body>, ApiError>
Get the authenticated app
Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the installations_count
in the response. For more details about your app’s installations, see the “List installations for the authenticated app” endpoint.
You must use a JWT to access this endpoint.
Sourcepub async fn apps_create_from_manifest(
&self,
code: &str,
) -> Result<Response<Body>, ApiError>
pub async fn apps_create_from_manifest( &self, code: &str, ) -> Result<Response<Body>, ApiError>
Create a GitHub App from a manifest
Use this endpoint to complete the handshake necessary when implementing the GitHub App Manifest flow. When you create a GitHub App with the manifest flow, you receive a temporary code
used to retrieve the GitHub App’s id
, pem
(private key), and webhook_secret
.
Sourcepub async fn apps_get_webhook_config_for_app(
&self,
) -> Result<Response<Body>, ApiError>
pub async fn apps_get_webhook_config_for_app( &self, ) -> Result<Response<Body>, ApiError>
Get a webhook configuration for an app
Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see “Creating a GitHub App.”
You must use a JWT to access this endpoint.
Sourcepub async fn apps_update_webhook_config_for_app<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn apps_update_webhook_config_for_app<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a webhook configuration for an app
Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see “Creating a GitHub App.”
You must use a JWT to access this endpoint.
§Content
Sourcepub async fn apps_list_webhook_deliveries(
&self,
per_page: Option<i64>,
cursor: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn apps_list_webhook_deliveries( &self, per_page: Option<i64>, cursor: Option<&str>, ) -> Result<Response<Body>, ApiError>
List deliveries for an app webhook
Returns a list of webhook deliveries for the webhook configured for a GitHub App.
You must use a JWT to access this endpoint.
Sourcepub async fn apps_get_webhook_delivery(
&self,
delivery_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn apps_get_webhook_delivery( &self, delivery_id: i64, ) -> Result<Response<Body>, ApiError>
Get a delivery for an app webhook
Returns a delivery for the webhook configured for a GitHub App.
You must use a JWT to access this endpoint.
Sourcepub async fn apps_redeliver_webhook_delivery(
&self,
delivery_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn apps_redeliver_webhook_delivery( &self, delivery_id: i64, ) -> Result<Response<Body>, ApiError>
Redeliver a delivery for an app webhook
Redeliver a delivery for the webhook configured for a GitHub App.
You must use a JWT to access this endpoint.
Sourcepub async fn apps_list_installations(
&self,
per_page: Option<i64>,
page: Option<i64>,
since: Option<&str>,
outdated: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn apps_list_installations( &self, per_page: Option<i64>, page: Option<i64>, since: Option<&str>, outdated: Option<&str>, ) -> Result<Response<Body>, ApiError>
List installations for the authenticated app
You must use a JWT to access this endpoint.
The permissions the installation has are included under the permissions
key.
Sourcepub async fn apps_get_installation(
&self,
installation_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn apps_get_installation( &self, installation_id: i64, ) -> Result<Response<Body>, ApiError>
Get an installation for the authenticated app
Enables an authenticated GitHub App to find an installation’s information using the installation id.
You must use a JWT to access this endpoint.
Sourcepub async fn apps_delete_installation(
&self,
installation_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn apps_delete_installation( &self, installation_id: i64, ) -> Result<Response<Body>, ApiError>
Delete an installation for the authenticated app
Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app’s access to your account’s resources, then we recommend the “Suspend an app installation” endpoint.
You must use a JWT to access this endpoint.
Sourcepub async fn apps_create_installation_access_token<Content>(
&self,
installation_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn apps_create_installation_access_token<Content>( &self, installation_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create an installation access token for an app
Creates an installation access token that enables a GitHub App to make authenticated API requests for the app’s installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of 401 - Unauthorized
, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the repository_ids
when creating the token. When you omit repository_ids
, the response does not contain the repositories
key.
You must use a JWT to access this endpoint.
§Content
Sourcepub async fn apps_suspend_installation(
&self,
installation_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn apps_suspend_installation( &self, installation_id: i64, ) -> Result<Response<Body>, ApiError>
Suspend an app installation
Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account’s resources. When a GitHub App is suspended, the app’s access to the GitHub API or webhook events is blocked for that account.
You must use a JWT to access this endpoint.
Sourcepub async fn apps_unsuspend_installation(
&self,
installation_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn apps_unsuspend_installation( &self, installation_id: i64, ) -> Result<Response<Body>, ApiError>
Unsuspend an app installation
Removes a GitHub App installation suspension.
You must use a JWT to access this endpoint.
List your grants
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the list your authorizations API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on the application authorizations settings screen within GitHub. The scopes
returned are the union of scopes authorized for the application. For example, if an application has one token with repo
scope and another token with user
scope, the grant will return ["repo", "user"]
.
Get a single grant
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Delete a grant
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Deleting an OAuth application’s grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on the application authorizations settings screen within GitHub.
Delete an app authorization
OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use Basic Authentication when accessing this endpoint, using the OAuth application’s client_id
and client_secret
as the username and password. You must also provide a valid OAuth access_token
as an input parameter and the grant for the token’s owner will be deleted.
Deleting an OAuth application’s grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user’s account and will no longer be listed on the application authorizations settings screen within GitHub.
§Content
Sourcepub async fn apps_check_token<Content>(
&self,
client_id: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn apps_check_token<Content>( &self, client_id: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Check a token
OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use Basic Authentication to use this endpoint, where the username is the OAuth application client_id
and the password is its client_secret
. Invalid tokens will return 404 NOT FOUND
.
§Content
Sourcepub async fn apps_delete_token<Content>(
&self,
client_id: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn apps_delete_token<Content>( &self, client_id: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Delete an app token
OAuth application owners can revoke a single token for an OAuth application. You must use Basic Authentication when accessing this endpoint, using the OAuth application’s client_id
and client_secret
as the username and password.
§Content
Sourcepub async fn apps_reset_token<Content>(
&self,
client_id: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn apps_reset_token<Content>( &self, client_id: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Reset a token
OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the “token” property in the response because changes take effect immediately. You must use Basic Authentication when accessing this endpoint, using the OAuth application’s client_id
and client_secret
as the username and password. Invalid tokens will return 404 NOT FOUND
.
§Content
Sourcepub async fn apps_scope_token<Content>(
&self,
client_id: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn apps_scope_token<Content>( &self, client_id: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a scoped access token
Use a non-scoped user-to-server OAuth access token to create a repository scoped and/or permission scoped user-to-server OAuth access token. You can specify which repositories the token can access and which permissions are granted to the token. You must use Basic Authentication when accessing this endpoint, using the OAuth application’s client_id
and client_secret
as the username and password. Invalid tokens will return 404 NOT FOUND
.
§Content
Sourcepub async fn apps_get_by_slug(
&self,
app_slug: &str,
) -> Result<Response<Body>, ApiError>
pub async fn apps_get_by_slug( &self, app_slug: &str, ) -> Result<Response<Body>, ApiError>
Get an app
Note: The :app_slug
is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., https://github.com/settings/apps/:app_slug
).
If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a personal access token or an installation access token to access this endpoint.
List your authorizations
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Create a new authorization
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Warning: Apps must use the web application flow to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the blog post.
Creates OAuth tokens using Basic Authentication. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”
To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app’s client ID and secret, found on your OAuth application’s settings page. If your OAuth application intends to create multiple tokens for one user, use fingerprint
to differentiate between them.
You can also create tokens on GitHub from the personal access tokens settings page. Read more about these tokens in the GitHub Help documentation.
Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in the GitHub Help documentation.
§Content
Get-or-create an authorization for a specific app
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Warning: Apps must use the web application flow to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the blog post.
Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn’t already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user’s existing authorization for the application if one is present. Otherwise, it creates and returns a new one.
If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
§Content
Get-or-create an authorization for a specific app and fingerprint
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Warning: Apps must use the web application flow to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the blog post.
This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. fingerprint
is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user’s existing authorization for the application if one is present. Otherwise, it creates and returns a new one.
If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”
§Content
Get a single authorization
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Delete an authorization
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Update an existing authorization
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”
You can only send one of these scope keys at a time.
§Content
Sourcepub async fn codes_of_conduct_get_all_codes_of_conduct(
&self,
) -> Result<Response<Body>, ApiError>
pub async fn codes_of_conduct_get_all_codes_of_conduct( &self, ) -> Result<Response<Body>, ApiError>
Get all codes of conduct
Sourcepub async fn codes_of_conduct_get_conduct_code(
&self,
key: &str,
) -> Result<Response<Body>, ApiError>
pub async fn codes_of_conduct_get_conduct_code( &self, key: &str, ) -> Result<Response<Body>, ApiError>
Get a code of conduct
Sourcepub async fn actions_get_actions_cache_usage_for_enterprise(
&self,
enterprise: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_actions_cache_usage_for_enterprise( &self, enterprise: &str, ) -> Result<Response<Body>, ApiError>
Get GitHub Actions cache usage for an enterprise
Gets the total GitHub Actions cache usage for an enterprise.
The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.
You must authenticate using an access token with the admin:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_get_github_actions_permissions_enterprise(
&self,
enterprise: &str,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_get_github_actions_permissions_enterprise( &self, enterprise: &str, ) -> Result<Response<Body>, ApiError>
Get GitHub Actions permissions for an enterprise
Gets the GitHub Actions permissions policy for organizations and allowed actions and reusable workflows in an enterprise.
You must authenticate using an access token with the admin:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_set_github_actions_permissions_enterprise<Content>(
&self,
enterprise: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_set_github_actions_permissions_enterprise<Content>( &self, enterprise: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set GitHub Actions permissions for an enterprise
Sets the GitHub Actions permissions policy for organizations and allowed actions and reusable workflows in an enterprise.
You must authenticate using an access token with the admin:enterprise
scope to use this endpoint.
§Content
Sourcepub async fn enterprise_admin_list_selected_organizations_enabled_github_actions_enterprise(
&self,
enterprise: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_list_selected_organizations_enabled_github_actions_enterprise( &self, enterprise: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List selected organizations enabled for GitHub Actions in an enterprise
Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations
must be configured to selected
. For more information, see “Set GitHub Actions permissions for an enterprise.”
You must authenticate using an access token with the admin:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_set_selected_organizations_enabled_github_actions_enterprise<Content>(
&self,
enterprise: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_set_selected_organizations_enabled_github_actions_enterprise<Content>( &self, enterprise: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set selected organizations enabled for GitHub Actions in an enterprise
Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations
must be configured to selected
. For more information, see “Set GitHub Actions permissions for an enterprise.”
You must authenticate using an access token with the admin:enterprise
scope to use this endpoint.
§Content
Sourcepub async fn enterprise_admin_enable_selected_organization_github_actions_enterprise(
&self,
enterprise: &str,
org_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_enable_selected_organization_github_actions_enterprise( &self, enterprise: &str, org_id: i64, ) -> Result<Response<Body>, ApiError>
Enable a selected organization for GitHub Actions in an enterprise
Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations
must be configured to selected
. For more information, see “Set GitHub Actions permissions for an enterprise.”
You must authenticate using an access token with the admin:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_disable_selected_organization_github_actions_enterprise(
&self,
enterprise: &str,
org_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_disable_selected_organization_github_actions_enterprise( &self, enterprise: &str, org_id: i64, ) -> Result<Response<Body>, ApiError>
Disable a selected organization for GitHub Actions in an enterprise
Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations
must be configured to selected
. For more information, see “Set GitHub Actions permissions for an enterprise.”
You must authenticate using an access token with the admin:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_get_allowed_actions_enterprise(
&self,
enterprise: &str,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_get_allowed_actions_enterprise( &self, enterprise: &str, ) -> Result<Response<Body>, ApiError>
Get allowed actions and reusable workflows for an enterprise
Gets the selected actions and reusable workflows that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for allowed_actions
must be configured to selected
. For more information, see “Set GitHub Actions permissions for an enterprise.”
You must authenticate using an access token with the admin:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_set_allowed_actions_enterprise<Content>(
&self,
enterprise: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_set_allowed_actions_enterprise<Content>( &self, enterprise: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set allowed actions and reusable workflows for an enterprise
Sets the actions and reusable workflows that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for allowed_actions
must be configured to selected
. For more information, see “Set GitHub Actions permissions for an enterprise.”
You must authenticate using an access token with the admin:enterprise
scope to use this endpoint.
§Content
Sourcepub async fn actions_get_github_actions_default_workflow_permissions_enterprise(
&self,
enterprise: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_github_actions_default_workflow_permissions_enterprise( &self, enterprise: &str, ) -> Result<Response<Body>, ApiError>
Get default workflow permissions for an enterprise
Gets the default workflow permissions granted to the GITHUB_TOKEN
when running workflows in an enterprise,
as well as whether GitHub Actions can submit approving pull request reviews. For more information, see
“Enforcing a policy for workflow permissions in your enterprise.”
You must authenticate using an access token with the admin:enterprise
scope to use this endpoint.
GitHub Apps must have the enterprise_administration:write
permission to use this endpoint.
Sourcepub async fn actions_set_github_actions_default_workflow_permissions_enterprise<Content>(
&self,
enterprise: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_set_github_actions_default_workflow_permissions_enterprise<Content>( &self, enterprise: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set default workflow permissions for an enterprise
Sets the default workflow permissions granted to the GITHUB_TOKEN
when running workflows in an enterprise, and sets
whether GitHub Actions can submit approving pull request reviews. For more information, see
“Enforcing a policy for workflow permissions in your enterprise.”
You must authenticate using an access token with the admin:enterprise
scope to use this endpoint.
GitHub Apps must have the enterprise_administration:write
permission to use this endpoint.
§Content
Sourcepub async fn enterprise_admin_list_self_hosted_runner_groups_for_enterprise(
&self,
enterprise: &str,
per_page: Option<i64>,
page: Option<i64>,
visible_to_organization: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_list_self_hosted_runner_groups_for_enterprise( &self, enterprise: &str, per_page: Option<i64>, page: Option<i64>, visible_to_organization: Option<&str>, ) -> Result<Response<Body>, ApiError>
List self-hosted runner groups for an enterprise
Lists all self-hosted runner groups for an enterprise.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_create_self_hosted_runner_group_for_enterprise<Content>(
&self,
enterprise: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_create_self_hosted_runner_group_for_enterprise<Content>( &self, enterprise: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a self-hosted runner group for an enterprise
Creates a new self-hosted runner group for an enterprise.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
§Content
Sourcepub async fn enterprise_admin_get_self_hosted_runner_group_for_enterprise(
&self,
enterprise: &str,
runner_group_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_get_self_hosted_runner_group_for_enterprise( &self, enterprise: &str, runner_group_id: i64, ) -> Result<Response<Body>, ApiError>
Get a self-hosted runner group for an enterprise
Gets a specific self-hosted runner group for an enterprise.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_delete_self_hosted_runner_group_from_enterprise(
&self,
enterprise: &str,
runner_group_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_delete_self_hosted_runner_group_from_enterprise( &self, enterprise: &str, runner_group_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a self-hosted runner group from an enterprise
Deletes a self-hosted runner group for an enterprise.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_update_self_hosted_runner_group_for_enterprise<Content>(
&self,
enterprise: &str,
runner_group_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_update_self_hosted_runner_group_for_enterprise<Content>( &self, enterprise: &str, runner_group_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a self-hosted runner group for an enterprise
Updates the name
and visibility
of a self-hosted runner group in an enterprise.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
§Content
Sourcepub async fn enterprise_admin_list_org_access_to_self_hosted_runner_group_in_enterprise(
&self,
enterprise: &str,
runner_group_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_list_org_access_to_self_hosted_runner_group_in_enterprise( &self, enterprise: &str, runner_group_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List organization access to a self-hosted runner group in an enterprise
Lists the organizations with access to a self-hosted runner group.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_set_org_access_to_self_hosted_runner_group_in_enterprise<Content>(
&self,
enterprise: &str,
runner_group_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_set_org_access_to_self_hosted_runner_group_in_enterprise<Content>( &self, enterprise: &str, runner_group_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set organization access for a self-hosted runner group in an enterprise
Replaces the list of organizations that have access to a self-hosted runner configured in an enterprise.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
§Content
Sourcepub async fn enterprise_admin_add_org_access_to_self_hosted_runner_group_in_enterprise(
&self,
enterprise: &str,
runner_group_id: i64,
org_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_add_org_access_to_self_hosted_runner_group_in_enterprise( &self, enterprise: &str, runner_group_id: i64, org_id: i64, ) -> Result<Response<Body>, ApiError>
Add organization access to a self-hosted runner group in an enterprise
Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have visibility
set to selected
. For more information, see “Create a self-hosted runner group for an enterprise.”
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_remove_org_access_to_self_hosted_runner_group_in_enterprise(
&self,
enterprise: &str,
runner_group_id: i64,
org_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_remove_org_access_to_self_hosted_runner_group_in_enterprise( &self, enterprise: &str, runner_group_id: i64, org_id: i64, ) -> Result<Response<Body>, ApiError>
Remove organization access to a self-hosted runner group in an enterprise
Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have visibility
set to selected
. For more information, see “Create a self-hosted runner group for an enterprise.”
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_list_self_hosted_runners_in_group_for_enterprise(
&self,
enterprise: &str,
runner_group_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_list_self_hosted_runners_in_group_for_enterprise( &self, enterprise: &str, runner_group_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List self-hosted runners in a group for an enterprise
Lists the self-hosted runners that are in a specific enterprise group.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_set_self_hosted_runners_in_group_for_enterprise<Content>(
&self,
enterprise: &str,
runner_group_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_set_self_hosted_runners_in_group_for_enterprise<Content>( &self, enterprise: &str, runner_group_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set self-hosted runners in a group for an enterprise
Replaces the list of self-hosted runners that are part of an enterprise runner group.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
§Content
Sourcepub async fn enterprise_admin_add_self_hosted_runner_to_group_for_enterprise(
&self,
enterprise: &str,
runner_group_id: i64,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_add_self_hosted_runner_to_group_for_enterprise( &self, enterprise: &str, runner_group_id: i64, runner_id: i64, ) -> Result<Response<Body>, ApiError>
Add a self-hosted runner to a group for an enterprise
Adds a self-hosted runner to a runner group configured in an enterprise.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_remove_self_hosted_runner_from_group_for_enterprise(
&self,
enterprise: &str,
runner_group_id: i64,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_remove_self_hosted_runner_from_group_for_enterprise( &self, enterprise: &str, runner_group_id: i64, runner_id: i64, ) -> Result<Response<Body>, ApiError>
Remove a self-hosted runner from a group for an enterprise
Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_list_self_hosted_runners_for_enterprise(
&self,
enterprise: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_list_self_hosted_runners_for_enterprise( &self, enterprise: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List self-hosted runners for an enterprise
Lists all self-hosted runners configured for an enterprise.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_list_runner_applications_for_enterprise(
&self,
enterprise: &str,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_list_runner_applications_for_enterprise( &self, enterprise: &str, ) -> Result<Response<Body>, ApiError>
List runner applications for an enterprise
Lists binaries for the runner application that you can download and run.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_create_registration_token_for_enterprise(
&self,
enterprise: &str,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_create_registration_token_for_enterprise( &self, enterprise: &str, ) -> Result<Response<Body>, ApiError>
Create a registration token for an enterprise
Returns a token that you can pass to the config
script. The token expires after one hour.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
§Example using registration token
Configure your self-hosted runner, replacing TOKEN
with the registration token provided by this endpoint.
./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN
Sourcepub async fn enterprise_admin_create_remove_token_for_enterprise(
&self,
enterprise: &str,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_create_remove_token_for_enterprise( &self, enterprise: &str, ) -> Result<Response<Body>, ApiError>
Create a remove token for an enterprise
Returns a token that you can pass to the config
script to remove a self-hosted runner from an enterprise. The token expires after one hour.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
§Example using remove token
To remove your self-hosted runner from an enterprise, replace TOKEN
with the remove token provided by this
endpoint.
./config.sh remove --token TOKEN
Sourcepub async fn enterprise_admin_get_self_hosted_runner_for_enterprise(
&self,
enterprise: &str,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_get_self_hosted_runner_for_enterprise( &self, enterprise: &str, runner_id: i64, ) -> Result<Response<Body>, ApiError>
Get a self-hosted runner for an enterprise
Gets a specific self-hosted runner configured in an enterprise.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_delete_self_hosted_runner_from_enterprise(
&self,
enterprise: &str,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_delete_self_hosted_runner_from_enterprise( &self, enterprise: &str, runner_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a self-hosted runner from an enterprise
Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_list_labels_for_self_hosted_runner_for_enterprise(
&self,
enterprise: &str,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_list_labels_for_self_hosted_runner_for_enterprise( &self, enterprise: &str, runner_id: i64, ) -> Result<Response<Body>, ApiError>
List labels for a self-hosted runner for an enterprise
Lists all labels for a self-hosted runner configured in an enterprise.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_set_custom_labels_for_self_hosted_runner_for_enterprise<Content>(
&self,
enterprise: &str,
runner_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_set_custom_labels_for_self_hosted_runner_for_enterprise<Content>( &self, enterprise: &str, runner_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set custom labels for a self-hosted runner for an enterprise
Remove all previous custom labels and set the new custom labels for a specific self-hosted runner configured in an enterprise.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
§Content
Sourcepub async fn enterprise_admin_add_custom_labels_to_self_hosted_runner_for_enterprise<Content>(
&self,
enterprise: &str,
runner_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_add_custom_labels_to_self_hosted_runner_for_enterprise<Content>( &self, enterprise: &str, runner_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add custom labels to a self-hosted runner for an enterprise
Add custom labels to a self-hosted runner configured in an enterprise.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
§Content
Sourcepub async fn enterprise_admin_remove_all_custom_labels_from_self_hosted_runner_for_enterprise(
&self,
enterprise: &str,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_remove_all_custom_labels_from_self_hosted_runner_for_enterprise( &self, enterprise: &str, runner_id: i64, ) -> Result<Response<Body>, ApiError>
Remove all custom labels from a self-hosted runner for an enterprise
Remove all custom labels from a self-hosted runner configured in an enterprise. Returns the remaining read-only labels from the runner.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_remove_custom_label_from_self_hosted_runner_for_enterprise(
&self,
enterprise: &str,
runner_id: i64,
name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_remove_custom_label_from_self_hosted_runner_for_enterprise( &self, enterprise: &str, runner_id: i64, name: &str, ) -> Result<Response<Body>, ApiError>
Remove a custom label from a self-hosted runner for an enterprise
Remove a custom label from a self-hosted runner configured in an enterprise. Returns the remaining labels from the runner.
This endpoint returns a 404 Not Found
status if the custom label is not
present on the runner.
You must authenticate using an access token with the manage_runners:enterprise
scope to use this endpoint.
Sourcepub async fn enterprise_admin_get_audit_log(
&self,
enterprise: &str,
phrase: Option<&str>,
include: Option<&str>,
after: Option<&str>,
before: Option<&str>,
order: Option<&str>,
page: Option<i64>,
per_page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_get_audit_log( &self, enterprise: &str, phrase: Option<&str>, include: Option<&str>, after: Option<&str>, before: Option<&str>, order: Option<&str>, page: Option<i64>, per_page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Get the audit log for an enterprise
Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the admin:enterprise
scope.
Sourcepub async fn secret_scanning_list_alerts_for_enterprise(
&self,
enterprise: &str,
state: Option<&str>,
secret_type: Option<&str>,
resolution: Option<&str>,
per_page: Option<i64>,
before: Option<&str>,
after: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn secret_scanning_list_alerts_for_enterprise( &self, enterprise: &str, state: Option<&str>, secret_type: Option<&str>, resolution: Option<&str>, per_page: Option<i64>, before: Option<&str>, after: Option<&str>, ) -> Result<Response<Body>, ApiError>
List secret scanning alerts for an enterprise
Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.
To use this endpoint, you must be a member of the enterprise, and you must use an access token with the repo
scope or security_events
scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager.
Sourcepub async fn billing_get_github_actions_billing_ghe(
&self,
enterprise: &str,
) -> Result<Response<Body>, ApiError>
pub async fn billing_get_github_actions_billing_ghe( &self, enterprise: &str, ) -> Result<Response<Body>, ApiError>
Get GitHub Actions billing for an enterprise
Gets the summary of the free and paid GitHub Actions minutes used.
Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see “Managing billing for GitHub Actions”.
The authenticated user must be an enterprise admin.
Sourcepub async fn billing_get_github_advanced_security_billing_ghe(
&self,
enterprise: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn billing_get_github_advanced_security_billing_ghe( &self, enterprise: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Get GitHub Advanced Security active committers for an enterprise
Gets the GitHub Advanced Security active committers for an enterprise per repository. Each distinct user login across all repositories is counted as a single Advanced Security seat, so the total_advanced_security_committers is not the sum of active_users for each repository.
Sourcepub async fn billing_get_github_packages_billing_ghe(
&self,
enterprise: &str,
) -> Result<Response<Body>, ApiError>
pub async fn billing_get_github_packages_billing_ghe( &self, enterprise: &str, ) -> Result<Response<Body>, ApiError>
Get GitHub Packages billing for an enterprise
Gets the free and paid storage used for GitHub Packages in gigabytes.
Paid minutes only apply to packages stored for private repositories. For more information, see “Managing billing for GitHub Packages.”
The authenticated user must be an enterprise admin.
Get shared storage billing for an enterprise
Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages.
Paid minutes only apply to packages stored for private repositories. For more information, see “Managing billing for GitHub Packages.”
The authenticated user must be an enterprise admin.
Sourcepub async fn activity_list_public_events(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_public_events( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List public events
We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago.
Sourcepub async fn activity_get_feeds(&self) -> Result<Response<Body>, ApiError>
pub async fn activity_get_feeds(&self) -> Result<Response<Body>, ApiError>
Get feeds
GitHub provides several timeline resources in Atom format. The Feeds API lists all the feeds available to the authenticated user:
- Timeline: The GitHub global public timeline
- User: The public timeline for any user, using URI template
- Current user public: The public timeline for the authenticated user
- Current user: The private timeline for the authenticated user
- Current user actor: The private timeline for activity created by the authenticated user
- Current user organizations: The private timeline for the organizations the authenticated user is a member of.
- Security advisories: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub.
Note: Private feeds are only returned when authenticating via Basic Auth since current feed URIs use the older, non revocable auth tokens.
Sourcepub async fn gists_list(
&self,
since: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn gists_list( &self, since: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List gists for the authenticated user
Lists the authenticated user’s gists or if called anonymously, this endpoint returns all public gists:
Sourcepub async fn gists_create<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn gists_create<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a gist
Allows you to add a new gist with one or more files.
Note: Don’t name your files “gistfile” with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally.
§Content
Sourcepub async fn gists_list_public(
&self,
since: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn gists_list_public( &self, since: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List public gists
List public gists sorted by most recently updated to least recently updated.
Note: With pagination, you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page.
Sourcepub async fn gists_list_starred(
&self,
since: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn gists_list_starred( &self, since: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn gists_delete(
&self,
gist_id: &str,
) -> Result<Response<Body>, ApiError>
pub async fn gists_delete( &self, gist_id: &str, ) -> Result<Response<Body>, ApiError>
Delete a gist
Sourcepub async fn gists_update<Content>(
&self,
gist_id: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn gists_update<Content>( &self, gist_id: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a gist
Allows you to update or delete a gist file and rename gist files. Files from the previous version of the gist that aren’t explicitly changed during an edit are unchanged.
§Content
Sourcepub async fn gists_list_comments(
&self,
gist_id: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn gists_list_comments( &self, gist_id: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List gist comments
Sourcepub async fn gists_create_comment<Content>(
&self,
gist_id: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn gists_create_comment<Content>( &self, gist_id: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a gist comment
§Content
Sourcepub async fn gists_get_comment(
&self,
gist_id: &str,
comment_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn gists_get_comment( &self, gist_id: &str, comment_id: i64, ) -> Result<Response<Body>, ApiError>
Get a gist comment
Sourcepub async fn gists_delete_comment(
&self,
gist_id: &str,
comment_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn gists_delete_comment( &self, gist_id: &str, comment_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a gist comment
Sourcepub async fn gists_update_comment<Content>(
&self,
gist_id: &str,
comment_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn gists_update_comment<Content>( &self, gist_id: &str, comment_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a gist comment
§Content
Sourcepub async fn gists_list_commits(
&self,
gist_id: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn gists_list_commits( &self, gist_id: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List gist commits
Sourcepub async fn gists_list_forks(
&self,
gist_id: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn gists_list_forks( &self, gist_id: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List gist forks
Sourcepub async fn gists_check_is_starred(
&self,
gist_id: &str,
) -> Result<Response<Body>, ApiError>
pub async fn gists_check_is_starred( &self, gist_id: &str, ) -> Result<Response<Body>, ApiError>
Check if a gist is starred
Sourcepub async fn gists_star(
&self,
gist_id: &str,
) -> Result<Response<Body>, ApiError>
pub async fn gists_star( &self, gist_id: &str, ) -> Result<Response<Body>, ApiError>
Star a gist
Note that you’ll need to set Content-Length
to zero when calling out to this endpoint. For more information, see “HTTP verbs.”
Sourcepub async fn gists_unstar(
&self,
gist_id: &str,
) -> Result<Response<Body>, ApiError>
pub async fn gists_unstar( &self, gist_id: &str, ) -> Result<Response<Body>, ApiError>
Unstar a gist
Sourcepub async fn gists_get_revision(
&self,
gist_id: &str,
sha: &str,
) -> Result<Response<Body>, ApiError>
pub async fn gists_get_revision( &self, gist_id: &str, sha: &str, ) -> Result<Response<Body>, ApiError>
Get a gist revision
Sourcepub async fn gitignore_get_all_templates(
&self,
) -> Result<Response<Body>, ApiError>
pub async fn gitignore_get_all_templates( &self, ) -> Result<Response<Body>, ApiError>
Get all gitignore templates
List all templates available to pass as an option when creating a repository.
Sourcepub async fn gitignore_get_template(
&self,
name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn gitignore_get_template( &self, name: &str, ) -> Result<Response<Body>, ApiError>
Get a gitignore template
The API also allows fetching the source of a single template. Use the raw media type to get the raw contents.
Sourcepub async fn apps_list_repos_accessible_to_installation(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn apps_list_repos_accessible_to_installation( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repositories accessible to the app installation
List repositories that an app installation can access.
You must use an installation access token to access this endpoint.
Sourcepub async fn apps_revoke_installation_access_token(
&self,
) -> Result<Response<Body>, ApiError>
pub async fn apps_revoke_installation_access_token( &self, ) -> Result<Response<Body>, ApiError>
Revoke an installation access token
Revokes the installation token you’re using to authenticate as an installation and access this endpoint.
Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the “Create an installation access token for an app” endpoint.
You must use an installation access token to access this endpoint.
Sourcepub async fn issues_list(
&self,
filter: &IssueFilter<'_>,
sort: &Sort<'_>,
collab: Option<bool>,
orgs: Option<bool>,
owned: Option<bool>,
pulls: Option<bool>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn issues_list( &self, filter: &IssueFilter<'_>, sort: &Sort<'_>, collab: Option<bool>, orgs: Option<bool>, owned: Option<bool>, pulls: Option<bool>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List issues assigned to the authenticated user
List issues assigned to the authenticated user across all visible repositories including owned repositories, member
repositories, and organization repositories. You can use the filter
query parameter to fetch issues that are not
necessarily assigned to you.
Note: GitHub’s REST API v3 considers every pull request an issue, but not every issue is a pull request. For this
reason, “Issues” endpoints may return both issues and pull requests in the response. You can identify pull requests by
the pull_request
key. Be aware that the id
of a pull request returned from “Issues” endpoints will be an issue id. To find out the pull
request id, use the “List pull requests” endpoint.
Sourcepub async fn licenses_get_all_commonly_used(
&self,
featured: Option<bool>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn licenses_get_all_commonly_used( &self, featured: Option<bool>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Get all commonly used licenses
Sourcepub async fn licenses_get(
&self,
license: &str,
) -> Result<Response<Body>, ApiError>
pub async fn licenses_get( &self, license: &str, ) -> Result<Response<Body>, ApiError>
Get a license
Sourcepub async fn markdown_render<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn markdown_render<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Render a Markdown document
§Content
Sourcepub async fn markdown_render_raw<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn markdown_render_raw<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Render a Markdown document in raw mode
You must send Markdown as plain text (using a Content-Type
header of text/plain
or text/x-markdown
) to this endpoint, rather than using JSON format. In raw mode, GitHub Flavored Markdown is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less.
§Content
Sourcepub async fn apps_get_subscription_plan_for_account(
&self,
account_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn apps_get_subscription_plan_for_account( &self, account_id: i64, ) -> Result<Response<Body>, ApiError>
Get a subscription plan for an account
Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won’t be processed until the end of their billing cycle, you will also see the upcoming pending change.
GitHub Apps must use a JWT to access this endpoint. OAuth Apps must use basic authentication with their client ID and client secret to access this endpoint.
Sourcepub async fn apps_list_plans(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn apps_list_plans( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List plans
Lists all plans that are part of your GitHub Marketplace listing.
GitHub Apps must use a JWT to access this endpoint. OAuth Apps must use basic authentication with their client ID and client secret to access this endpoint.
Sourcepub async fn apps_list_accounts_for_plan(
&self,
plan_id: i64,
sort: &Sort<'_>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn apps_list_accounts_for_plan( &self, plan_id: i64, sort: &Sort<'_>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List accounts for a plan
Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won’t be processed until the end of their billing cycle, you will also see the upcoming pending change.
GitHub Apps must use a JWT to access this endpoint. OAuth Apps must use basic authentication with their client ID and client secret to access this endpoint.
Sourcepub async fn apps_get_subscription_plan_for_account_stubbed(
&self,
account_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn apps_get_subscription_plan_for_account_stubbed( &self, account_id: i64, ) -> Result<Response<Body>, ApiError>
Get a subscription plan for an account (stubbed)
Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won’t be processed until the end of their billing cycle, you will also see the upcoming pending change.
GitHub Apps must use a JWT to access this endpoint. OAuth Apps must use basic authentication with their client ID and client secret to access this endpoint.
Sourcepub async fn apps_list_plans_stubbed(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn apps_list_plans_stubbed( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List plans (stubbed)
Lists all plans that are part of your GitHub Marketplace listing.
GitHub Apps must use a JWT to access this endpoint. OAuth Apps must use basic authentication with their client ID and client secret to access this endpoint.
Sourcepub async fn apps_list_accounts_for_plan_stubbed(
&self,
plan_id: i64,
sort: &Sort<'_>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn apps_list_accounts_for_plan_stubbed( &self, plan_id: i64, sort: &Sort<'_>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List accounts for a plan (stubbed)
Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won’t be processed until the end of their billing cycle, you will also see the upcoming pending change.
GitHub Apps must use a JWT to access this endpoint. OAuth Apps must use basic authentication with their client ID and client secret to access this endpoint.
Sourcepub async fn meta_get(&self) -> Result<Response<Body>, ApiError>
pub async fn meta_get(&self) -> Result<Response<Body>, ApiError>
Get GitHub meta information
Returns meta information about GitHub, including a list of GitHub’s IP addresses. For more information, see “About GitHub’s IP addresses.”
Note: The IP addresses shown in the documentation’s response are only example values. You must always query the API directly to get the latest list of IP addresses.
Sourcepub async fn activity_list_public_events_for_repo_network(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_public_events_for_repo_network( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List public events for a network of repositories
Sourcepub async fn activity_list_notifications_for_authenticated_user(
&self,
all: Option<bool>,
participating: Option<bool>,
since: Option<&str>,
before: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_notifications_for_authenticated_user( &self, all: Option<bool>, participating: Option<bool>, since: Option<&str>, before: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List notifications for the authenticated user
List all notifications for the current user, sorted by most recently updated.
Sourcepub async fn activity_mark_notifications_as_read<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn activity_mark_notifications_as_read<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Mark notifications as read
Marks all notifications as “read” removes it from the default view on GitHub. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted
status and GitHub will run an asynchronous process to mark notifications as “read.” To check whether any “unread” notifications remain, you can use the List notifications for the authenticated user endpoint and pass the query parameter all=false
.
§Content
Sourcepub async fn activity_get_thread(
&self,
thread_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn activity_get_thread( &self, thread_id: i64, ) -> Result<Response<Body>, ApiError>
Get a thread
Sourcepub async fn activity_mark_thread_as_read(
&self,
thread_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn activity_mark_thread_as_read( &self, thread_id: i64, ) -> Result<Response<Body>, ApiError>
Mark a thread as read
Sourcepub async fn activity_get_thread_subscription_for_authenticated_user(
&self,
thread_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn activity_get_thread_subscription_for_authenticated_user( &self, thread_id: i64, ) -> Result<Response<Body>, ApiError>
Get a thread subscription for the authenticated user
This checks to see if the current user is subscribed to a thread. You can also get a repository subscription.
Note that subscriptions are only generated if a user is participating in a conversation–for example, they’ve replied to the thread, were @mentioned, or manually subscribe to a thread.
Sourcepub async fn activity_set_thread_subscription<Content>(
&self,
thread_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn activity_set_thread_subscription<Content>( &self, thread_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set a thread subscription
If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an @mention.
You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.
Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the Delete a thread subscription endpoint.
§Content
Sourcepub async fn activity_delete_thread_subscription(
&self,
thread_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn activity_delete_thread_subscription( &self, thread_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a thread subscription
Mutes all future notifications for a conversation until you comment on the thread or get an @mention. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the Set a thread subscription endpoint and set ignore
to true
.
Sourcepub async fn orgs_list(
&self,
since: Option<i64>,
per_page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_list( &self, since: Option<i64>, per_page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List organizations
Lists all organizations, in the order that they were created on GitHub.
Note: Pagination is powered exclusively by the since
parameter. Use the Link header to get the URL for the next page of organizations.
Sourcepub async fn orgs_list_custom_roles(
&self,
organization_id: &str,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_list_custom_roles( &self, organization_id: &str, ) -> Result<Response<Body>, ApiError>
List custom repository roles in an organization
List the custom repository roles available in this organization. In order to see custom repository roles in an organization, the authenticated user must be an organization owner.
For more information on custom repository roles, see “Managing custom repository roles for an organization”.
Sourcepub async fn orgs_get(&self, org: &str) -> Result<Response<Body>, ApiError>
pub async fn orgs_get(&self, org: &str) -> Result<Response<Body>, ApiError>
Get an organization
To see many of the organization response values, you need to be an authenticated organization owner with the admin:org
scope. When the value of two_factor_requirement_enabled
is true
, the organization requires all members, billing managers, and outside collaborators to enable two-factor authentication.
GitHub Apps with the Organization plan
permission can use this endpoint to retrieve information about an organization’s GitHub plan. See “Authenticating with GitHub Apps” for details. For an example response, see ‘Response with GitHub plan information’ below.“
Sourcepub async fn orgs_update<Content>(
&self,
org: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_update<Content>( &self, org: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update an organization
Parameter Deprecation Notice: GitHub will replace and discontinue members_allowed_repository_creation_type
in favor of more granular permissions. The new input parameters are members_can_create_public_repositories
, members_can_create_private_repositories
for all organizations and members_can_create_internal_repositories
for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the blog post.
Enables an authenticated organization owner with the admin:org
scope to update the organization’s profile and member privileges.
§Content
Sourcepub async fn actions_get_actions_cache_usage_for_org(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_actions_cache_usage_for_org( &self, org: &str, ) -> Result<Response<Body>, ApiError>
Get GitHub Actions cache usage for an organization
Gets the total GitHub Actions cache usage for an organization.
The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.
You must authenticate using an access token with the read:org
scope to use this endpoint. GitHub Apps must have the organization_admistration:read
permission to use this endpoint.
Sourcepub async fn actions_get_actions_cache_usage_by_repo_for_org(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_actions_cache_usage_by_repo_for_org( &self, org: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repositories with GitHub Actions cache usage for an organization
Lists repositories and their GitHub Actions cache usage for an organization.
The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.
You must authenticate using an access token with the read:org
scope to use this endpoint. GitHub Apps must have the organization_admistration:read
permission to use this endpoint.
Sourcepub async fn actions_get_github_actions_permissions_organization(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_github_actions_permissions_organization( &self, org: &str, ) -> Result<Response<Body>, ApiError>
Get GitHub Actions permissions for an organization
Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the administration
organization permission to use this API.
Sourcepub async fn actions_set_github_actions_permissions_organization<Content>(
&self,
org: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_set_github_actions_permissions_organization<Content>( &self, org: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set GitHub Actions permissions for an organization
Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.
If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as allowed_actions
to selected
actions and reusable workflows, then you cannot override them for the organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the administration
organization permission to use this API.
§Content
Sourcepub async fn actions_list_selected_repositories_enabled_github_actions_organization(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_selected_repositories_enabled_github_actions_organization( &self, org: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List selected repositories enabled for GitHub Actions in an organization
Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories
must be configured to selected
. For more information, see “Set GitHub Actions permissions for an organization.”
You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the administration
organization permission to use this API.
Sourcepub async fn actions_set_selected_repositories_enabled_github_actions_organization<Content>(
&self,
org: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_set_selected_repositories_enabled_github_actions_organization<Content>( &self, org: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set selected repositories enabled for GitHub Actions in an organization
Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories
must be configured to selected
. For more information, see “Set GitHub Actions permissions for an organization.”
You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the administration
organization permission to use this API.
§Content
Sourcepub async fn actions_enable_selected_repository_github_actions_organization(
&self,
org: &str,
repository_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_enable_selected_repository_github_actions_organization( &self, org: &str, repository_id: i64, ) -> Result<Response<Body>, ApiError>
Enable a selected repository for GitHub Actions in an organization
Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories
must be must be configured to selected
. For more information, see “Set GitHub Actions permissions for an organization.”
You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the administration
organization permission to use this API.
Sourcepub async fn actions_disable_selected_repository_github_actions_organization(
&self,
org: &str,
repository_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_disable_selected_repository_github_actions_organization( &self, org: &str, repository_id: i64, ) -> Result<Response<Body>, ApiError>
Disable a selected repository for GitHub Actions in an organization
Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories
must be configured to selected
. For more information, see “Set GitHub Actions permissions for an organization.”
You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the administration
organization permission to use this API.
Sourcepub async fn actions_get_allowed_actions_organization(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_allowed_actions_organization( &self, org: &str, ) -> Result<Response<Body>, ApiError>
Get allowed actions and reusable workflows for an organization
Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for allowed_actions
must be configured to selected
. For more information, see “Set GitHub Actions permissions for an organization.”“
You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the administration
organization permission to use this API.
Sourcepub async fn actions_set_allowed_actions_organization<Content>(
&self,
org: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_set_allowed_actions_organization<Content>( &self, org: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set allowed actions and reusable workflows for an organization
Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for allowed_actions
must be configured to selected
. For more information, see “Set GitHub Actions permissions for an organization.”
If the organization belongs to an enterprise that has selected
actions and reusable workflows set at the enterprise level, then you cannot override any of the enterprise’s allowed actions and reusable workflows settings.
To use the patterns_allowed
setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the patterns_allowed
setting only applies to public repositories in the organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the administration
organization permission to use this API.
§Content
Sourcepub async fn actions_get_github_actions_default_workflow_permissions_organization(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_github_actions_default_workflow_permissions_organization( &self, org: &str, ) -> Result<Response<Body>, ApiError>
Get default workflow permissions for an organization
Gets the default workflow permissions granted to the GITHUB_TOKEN
when running workflows in an organization,
as well as whether GitHub Actions can submit approving pull request reviews. For more information, see
“Setting the permissions of the GITHUB_TOKEN for your organization.”
You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the administration
organization permission to use this API.
Sourcepub async fn actions_set_github_actions_default_workflow_permissions_organization<Content>(
&self,
org: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_set_github_actions_default_workflow_permissions_organization<Content>( &self, org: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set default workflow permissions for an organization
Sets the default workflow permissions granted to the GITHUB_TOKEN
when running workflows in an organization, and sets if GitHub Actions
can submit approving pull request reviews. For more information, see
“Setting the permissions of the GITHUB_TOKEN for your organization.”
You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the administration
organization permission to use this API.
§Content
Sourcepub async fn actions_list_self_hosted_runner_groups_for_org(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
visible_to_repository: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_self_hosted_runner_groups_for_org( &self, org: &str, per_page: Option<i64>, page: Option<i64>, visible_to_repository: Option<&str>, ) -> Result<Response<Body>, ApiError>
List self-hosted runner groups for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see “GitHub’s products.”
Lists all self-hosted runner groups configured in an organization and inherited from an enterprise.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_create_self_hosted_runner_group_for_org<Content>(
&self,
org: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_create_self_hosted_runner_group_for_org<Content>( &self, org: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a self-hosted runner group for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see “GitHub’s products.”
Creates a new self-hosted runner group for an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
§Content
Sourcepub async fn actions_get_self_hosted_runner_group_for_org(
&self,
org: &str,
runner_group_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_self_hosted_runner_group_for_org( &self, org: &str, runner_group_id: i64, ) -> Result<Response<Body>, ApiError>
Get a self-hosted runner group for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see “GitHub’s products.”
Gets a specific self-hosted runner group for an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_delete_self_hosted_runner_group_from_org(
&self,
org: &str,
runner_group_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_delete_self_hosted_runner_group_from_org( &self, org: &str, runner_group_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a self-hosted runner group from an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see “GitHub’s products.”
Deletes a self-hosted runner group for an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_update_self_hosted_runner_group_for_org<Content>(
&self,
org: &str,
runner_group_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_update_self_hosted_runner_group_for_org<Content>( &self, org: &str, runner_group_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a self-hosted runner group for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see “GitHub’s products.”
Updates the name
and visibility
of a self-hosted runner group in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
§Content
Sourcepub async fn actions_list_repo_access_to_self_hosted_runner_group_in_org(
&self,
org: &str,
runner_group_id: i64,
page: Option<i64>,
per_page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_repo_access_to_self_hosted_runner_group_in_org( &self, org: &str, runner_group_id: i64, page: Option<i64>, per_page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repository access to a self-hosted runner group in an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see “GitHub’s products.”
Lists the repositories with access to a self-hosted runner group configured in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_set_repo_access_to_self_hosted_runner_group_in_org<Content>(
&self,
org: &str,
runner_group_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_set_repo_access_to_self_hosted_runner_group_in_org<Content>( &self, org: &str, runner_group_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set repository access for a self-hosted runner group in an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see “GitHub’s products.”
Replaces the list of repositories that have access to a self-hosted runner group configured in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
§Content
Sourcepub async fn actions_add_repo_access_to_self_hosted_runner_group_in_org(
&self,
org: &str,
runner_group_id: i64,
repository_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_add_repo_access_to_self_hosted_runner_group_in_org( &self, org: &str, runner_group_id: i64, repository_id: i64, ) -> Result<Response<Body>, ApiError>
Add repository access to a self-hosted runner group in an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see “GitHub’s products.”
Adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have visibility
set to selected
. For more information, see “Create a self-hosted runner group for an organization.”
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_remove_repo_access_to_self_hosted_runner_group_in_org(
&self,
org: &str,
runner_group_id: i64,
repository_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_remove_repo_access_to_self_hosted_runner_group_in_org( &self, org: &str, runner_group_id: i64, repository_id: i64, ) -> Result<Response<Body>, ApiError>
Remove repository access to a self-hosted runner group in an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see “GitHub’s products.”
Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have visibility
set to selected
. For more information, see “Create a self-hosted runner group for an organization.”
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_list_self_hosted_runners_in_group_for_org(
&self,
org: &str,
runner_group_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_self_hosted_runners_in_group_for_org( &self, org: &str, runner_group_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List self-hosted runners in a group for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see “GitHub’s products.”
Lists self-hosted runners that are in a specific organization group.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_set_self_hosted_runners_in_group_for_org<Content>(
&self,
org: &str,
runner_group_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_set_self_hosted_runners_in_group_for_org<Content>( &self, org: &str, runner_group_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set self-hosted runners in a group for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see “GitHub’s products.”
Replaces the list of self-hosted runners that are part of an organization runner group.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
§Content
Sourcepub async fn actions_add_self_hosted_runner_to_group_for_org(
&self,
org: &str,
runner_group_id: i64,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_add_self_hosted_runner_to_group_for_org( &self, org: &str, runner_group_id: i64, runner_id: i64, ) -> Result<Response<Body>, ApiError>
Add a self-hosted runner to a group for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see “GitHub’s products.”
Adds a self-hosted runner to a runner group configured in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_remove_self_hosted_runner_from_group_for_org(
&self,
org: &str,
runner_group_id: i64,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_remove_self_hosted_runner_from_group_for_org( &self, org: &str, runner_group_id: i64, runner_id: i64, ) -> Result<Response<Body>, ApiError>
Remove a self-hosted runner from a group for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see “GitHub’s products.”
Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_list_self_hosted_runners_for_org(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_self_hosted_runners_for_org( &self, org: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List self-hosted runners for an organization
Lists all self-hosted runners configured in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_list_runner_applications_for_org(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_runner_applications_for_org( &self, org: &str, ) -> Result<Response<Body>, ApiError>
List runner applications for an organization
Lists binaries for the runner application that you can download and run.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_create_registration_token_for_org(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_create_registration_token_for_org( &self, org: &str, ) -> Result<Response<Body>, ApiError>
Create a registration token for an organization
Returns a token that you can pass to the config
script. The token expires after one hour.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
§Example using registration token
Configure your self-hosted runner, replacing TOKEN
with the registration token provided by this endpoint.
./config.sh --url https://github.com/octo-org --token TOKEN
Sourcepub async fn actions_create_remove_token_for_org(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_create_remove_token_for_org( &self, org: &str, ) -> Result<Response<Body>, ApiError>
Create a remove token for an organization
Returns a token that you can pass to the config
script to remove a self-hosted runner from an organization. The token expires after one hour.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
§Example using remove token
To remove your self-hosted runner from an organization, replace TOKEN
with the remove token provided by this
endpoint.
./config.sh remove --token TOKEN
Sourcepub async fn actions_get_self_hosted_runner_for_org(
&self,
org: &str,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_self_hosted_runner_for_org( &self, org: &str, runner_id: i64, ) -> Result<Response<Body>, ApiError>
Get a self-hosted runner for an organization
Gets a specific self-hosted runner configured in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_delete_self_hosted_runner_from_org(
&self,
org: &str,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_delete_self_hosted_runner_from_org( &self, org: &str, runner_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a self-hosted runner from an organization
Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_list_labels_for_self_hosted_runner_for_org(
&self,
org: &str,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_labels_for_self_hosted_runner_for_org( &self, org: &str, runner_id: i64, ) -> Result<Response<Body>, ApiError>
List labels for a self-hosted runner for an organization
Lists all labels for a self-hosted runner configured in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_set_custom_labels_for_self_hosted_runner_for_org<Content>(
&self,
org: &str,
runner_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_set_custom_labels_for_self_hosted_runner_for_org<Content>( &self, org: &str, runner_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set custom labels for a self-hosted runner for an organization
Remove all previous custom labels and set the new custom labels for a specific self-hosted runner configured in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
§Content
Sourcepub async fn actions_add_custom_labels_to_self_hosted_runner_for_org<Content>(
&self,
org: &str,
runner_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_add_custom_labels_to_self_hosted_runner_for_org<Content>( &self, org: &str, runner_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add custom labels to a self-hosted runner for an organization
Add custom labels to a self-hosted runner configured in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
§Content
Sourcepub async fn actions_remove_all_custom_labels_from_self_hosted_runner_for_org(
&self,
org: &str,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_remove_all_custom_labels_from_self_hosted_runner_for_org( &self, org: &str, runner_id: i64, ) -> Result<Response<Body>, ApiError>
Remove all custom labels from a self-hosted runner for an organization
Remove all custom labels from a self-hosted runner configured in an organization. Returns the remaining read-only labels from the runner.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_remove_custom_label_from_self_hosted_runner_for_org(
&self,
org: &str,
runner_id: i64,
name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_remove_custom_label_from_self_hosted_runner_for_org( &self, org: &str, runner_id: i64, name: &str, ) -> Result<Response<Body>, ApiError>
Remove a custom label from a self-hosted runner for an organization
Remove a custom label from a self-hosted runner configured in an organization. Returns the remaining labels from the runner.
This endpoint returns a 404 Not Found
status if the custom label is not
present on the runner.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Sourcepub async fn actions_list_org_secrets(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_org_secrets( &self, org: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List organization secrets
Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the secrets
organization permission to use this endpoint.
Sourcepub async fn actions_get_org_public_key(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_org_public_key( &self, org: &str, ) -> Result<Response<Body>, ApiError>
Get an organization public key
Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the secrets
organization permission to use this endpoint.
Sourcepub async fn actions_get_org_secret(
&self,
org: &str,
secret_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_org_secret( &self, org: &str, secret_name: &str, ) -> Result<Response<Body>, ApiError>
Get an organization secret
Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the secrets
organization permission to use this endpoint.
Sourcepub async fn actions_create_or_update_org_secret<Content>(
&self,
org: &str,
secret_name: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_create_or_update_org_secret<Content>( &self, org: &str, secret_name: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create or update an organization secret
Creates or updates an organization secret with an encrypted value. Encrypt your secret using
LibSodium. You must authenticate using an access
token with the admin:org
scope to use this endpoint. GitHub Apps must have the secrets
organization permission to
use this endpoint.
§Example encrypting a secret using Node.js
Encrypt your secret using the tweetsodium library.
const sodium = require('tweetsodium');
const key = "base64-encoded-public-key";
const value = "plain-text-secret";
// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
console.log(encrypted);
§Example encrypting a secret using Python
Encrypt your secret using pynacl with Python 3.
from base64 import b64encode
from nacl import encoding, public
def encrypt(public_key: str, secret_value: str) -> str:
"""Encrypt a Unicode string using the public key."""
public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
sealed_box = public.SealedBox(public_key)
encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
return b64encode(encrypted).decode("utf-8")
§Example encrypting a secret using C#
Encrypt your secret using the Sodium.Core package.
var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));
§Example encrypting a secret using Ruby
Encrypt your secret using the rbnacl gem.
require "rbnacl"
require "base64"
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")
# Print the base64 encoded secret
puts Base64.strict_encode64(encrypted_secret)
§Content
Sourcepub async fn actions_delete_org_secret(
&self,
org: &str,
secret_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_delete_org_secret( &self, org: &str, secret_name: &str, ) -> Result<Response<Body>, ApiError>
Delete an organization secret
Deletes a secret in an organization using the secret name. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the secrets
organization permission to use this endpoint.
Sourcepub async fn actions_list_selected_repos_for_org_secret(
&self,
org: &str,
secret_name: &str,
page: Option<i64>,
per_page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_selected_repos_for_org_secret( &self, org: &str, secret_name: &str, page: Option<i64>, per_page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List selected repositories for an organization secret
Lists all repositories that have been selected when the visibility
for repository access to a secret is set to selected
. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the secrets
organization permission to use this endpoint.
Sourcepub async fn actions_set_selected_repos_for_org_secret<Content>(
&self,
org: &str,
secret_name: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_set_selected_repos_for_org_secret<Content>( &self, org: &str, secret_name: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set selected repositories for an organization secret
Replaces all repositories for an organization secret when the visibility
for repository access is set to selected
. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the secrets
organization permission to use this endpoint.
§Content
Sourcepub async fn actions_add_selected_repo_to_org_secret(
&self,
org: &str,
secret_name: &str,
repository_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_add_selected_repo_to_org_secret( &self, org: &str, secret_name: &str, repository_id: i64, ) -> Result<Response<Body>, ApiError>
Add selected repository to an organization secret
Adds a repository to an organization secret when the visibility
for repository access is set to selected
. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the secrets
organization permission to use this endpoint.
Sourcepub async fn actions_remove_selected_repo_from_org_secret(
&self,
org: &str,
secret_name: &str,
repository_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_remove_selected_repo_from_org_secret( &self, org: &str, secret_name: &str, repository_id: i64, ) -> Result<Response<Body>, ApiError>
Remove selected repository from an organization secret
Removes a repository from an organization secret when the visibility
for repository access is set to selected
. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the secrets
organization permission to use this endpoint.
Sourcepub async fn orgs_get_audit_log(
&self,
org: &str,
phrase: Option<&str>,
include: Option<&str>,
after: Option<&str>,
before: Option<&str>,
order: Option<&str>,
per_page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_get_audit_log( &self, org: &str, phrase: Option<&str>, include: Option<&str>, after: Option<&str>, before: Option<&str>, order: Option<&str>, per_page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Get the audit log for an organization
Gets the audit log for an organization. For more information, see “Reviewing the audit log for your organization.”
This endpoint is available for organizations on GitHub Enterprise Cloud. To use this endpoint, you must be an organization owner, and you must use an access token with the admin:org
scope. GitHub Apps must have the organization_administration
read permission to use this endpoint.
By default, the response includes up to 30 events from the past three months. Use the phrase
parameter to filter results and retrieve older events. For example, use the phrase
parameter with the created
qualifier to filter events based on when the events occurred. For more information, see “Reviewing the audit log for your organization.”
Use pagination to retrieve fewer or more than 30 events. For more information, see “Resources in the REST API.”
Sourcepub async fn orgs_list_blocked_users(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_list_blocked_users( &self, org: &str, ) -> Result<Response<Body>, ApiError>
List users blocked by an organization
List the users blocked by an organization.
Sourcepub async fn orgs_check_blocked_user(
&self,
org: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_check_blocked_user( &self, org: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Check if a user is blocked by an organization
Sourcepub async fn orgs_block_user(
&self,
org: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_block_user( &self, org: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Block a user from an organization
Sourcepub async fn orgs_unblock_user(
&self,
org: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_unblock_user( &self, org: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Unblock a user from an organization
Sourcepub async fn code_scanning_list_alerts_for_org(
&self,
org: &str,
tool_name: Option<&str>,
tool_guid: Option<Option<&str>>,
before: Option<&str>,
after: Option<&str>,
page: Option<i64>,
per_page: Option<i64>,
state: Option<&str>,
sort: &Sort<'_>,
) -> Result<Response<Body>, ApiError>
pub async fn code_scanning_list_alerts_for_org( &self, org: &str, tool_name: Option<&str>, tool_guid: Option<Option<&str>>, before: Option<&str>, after: Option<&str>, page: Option<i64>, per_page: Option<i64>, state: Option<&str>, sort: &Sort<'_>, ) -> Result<Response<Body>, ApiError>
List code scanning alerts for an organization
Lists all code scanning alerts for the default branch (usually main
or master
) for all eligible repositories in an organization.
To use this endpoint, you must be an administrator or security manager for the organization, and you must use an access token with the repo
scope or security_events
scope.
GitHub Apps must have the security_events
read permission to use this endpoint.
List SAML SSO authorizations for an organization
Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see GitHub’s products.
An authenticated organization owner with the read:org
scope can list all credential authorizations for an organization that uses SAML single sign-on (SSO). The credentials are either personal access tokens or SSH keys that organization members have authorized for the organization. For more information, see About authentication with SAML single sign-on.
Remove a SAML SSO authorization for an organization
Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see GitHub’s products.
An authenticated organization owner with the admin:org
scope can remove a credential authorization for an organization that uses SAML SSO. Once you remove someone’s credential authorization, they will need to create a new personal access token or SSH key and authorize it for the organization they want to access.
Sourcepub async fn dependabot_list_org_secrets(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn dependabot_list_org_secrets( &self, org: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List organization secrets
Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the dependabot_secrets
organization permission to use this endpoint.
Sourcepub async fn dependabot_get_org_public_key(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn dependabot_get_org_public_key( &self, org: &str, ) -> Result<Response<Body>, ApiError>
Get an organization public key
Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the dependabot_secrets
organization permission to use this endpoint.
Sourcepub async fn dependabot_get_org_secret(
&self,
org: &str,
secret_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn dependabot_get_org_secret( &self, org: &str, secret_name: &str, ) -> Result<Response<Body>, ApiError>
Get an organization secret
Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the dependabot_secrets
organization permission to use this endpoint.
Sourcepub async fn dependabot_create_or_update_org_secret<Content>(
&self,
org: &str,
secret_name: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn dependabot_create_or_update_org_secret<Content>( &self, org: &str, secret_name: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create or update an organization secret
Creates or updates an organization secret with an encrypted value. Encrypt your secret using
LibSodium. You must authenticate using an access
token with the admin:org
scope to use this endpoint. GitHub Apps must have the dependabot_secrets
organization
permission to use this endpoint.
§Example encrypting a secret using Node.js
Encrypt your secret using the tweetsodium library.
const sodium = require('tweetsodium');
const key = "base64-encoded-public-key";
const value = "plain-text-secret";
// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
console.log(encrypted);
§Example encrypting a secret using Python
Encrypt your secret using pynacl with Python 3.
from base64 import b64encode
from nacl import encoding, public
def encrypt(public_key: str, secret_value: str) -> str:
"""Encrypt a Unicode string using the public key."""
public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
sealed_box = public.SealedBox(public_key)
encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
return b64encode(encrypted).decode("utf-8")
§Example encrypting a secret using C#
Encrypt your secret using the Sodium.Core package.
var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));
§Example encrypting a secret using Ruby
Encrypt your secret using the rbnacl gem.
require "rbnacl"
require "base64"
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")
# Print the base64 encoded secret
puts Base64.strict_encode64(encrypted_secret)
§Content
Sourcepub async fn dependabot_delete_org_secret(
&self,
org: &str,
secret_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn dependabot_delete_org_secret( &self, org: &str, secret_name: &str, ) -> Result<Response<Body>, ApiError>
Delete an organization secret
Deletes a secret in an organization using the secret name. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the dependabot_secrets
organization permission to use this endpoint.
Sourcepub async fn dependabot_list_selected_repos_for_org_secret(
&self,
org: &str,
secret_name: &str,
page: Option<i64>,
per_page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn dependabot_list_selected_repos_for_org_secret( &self, org: &str, secret_name: &str, page: Option<i64>, per_page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List selected repositories for an organization secret
Lists all repositories that have been selected when the visibility
for repository access to a secret is set to selected
. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the dependabot_secrets
organization permission to use this endpoint.
Sourcepub async fn dependabot_set_selected_repos_for_org_secret<Content>(
&self,
org: &str,
secret_name: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn dependabot_set_selected_repos_for_org_secret<Content>( &self, org: &str, secret_name: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set selected repositories for an organization secret
Replaces all repositories for an organization secret when the visibility
for repository access is set to selected
. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the dependabot_secrets
organization permission to use this endpoint.
§Content
Sourcepub async fn dependabot_add_selected_repo_to_org_secret(
&self,
org: &str,
secret_name: &str,
repository_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn dependabot_add_selected_repo_to_org_secret( &self, org: &str, secret_name: &str, repository_id: i64, ) -> Result<Response<Body>, ApiError>
Add selected repository to an organization secret
Adds a repository to an organization secret when the visibility
for repository access is set to selected
. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the dependabot_secrets
organization permission to use this endpoint.
Sourcepub async fn dependabot_remove_selected_repo_from_org_secret(
&self,
org: &str,
secret_name: &str,
repository_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn dependabot_remove_selected_repo_from_org_secret( &self, org: &str, secret_name: &str, repository_id: i64, ) -> Result<Response<Body>, ApiError>
Remove selected repository from an organization secret
Removes a repository from an organization secret when the visibility
for repository access is set to selected
. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the dependabot_secrets
organization permission to use this endpoint.
Sourcepub async fn activity_list_public_org_events(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_public_org_events( &self, org: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List public organization events
Sourcepub async fn teams_external_idp_group_info_for_org(
&self,
org: &str,
group_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_external_idp_group_info_for_org( &self, org: &str, group_id: i64, ) -> Result<Response<Body>, ApiError>
Get an external group
Displays information about the specific group’s usage. Provides a list of the group’s external members as well as a list of teams that this group is connected to.
You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see “GitHub’s products” in the GitHub Help documentation.
Sourcepub async fn teams_list_external_idp_groups_for_org(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
display_name: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_external_idp_groups_for_org( &self, org: &str, per_page: Option<i64>, page: Option<i64>, display_name: Option<&str>, ) -> Result<Response<Body>, ApiError>
List external groups in an organization
Lists external groups available in an organization. You can query the groups using the display_name
parameter, only groups with a group_name
containing the text provided in the display_name
parameter will be returned. You can also limit your page results using the per_page
parameter. GitHub generates a url-encoded page
token using a cursor value for where the next page begins. For more information on cursor pagination, see “Offset and Cursor Pagination explained.”
You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see “GitHub’s products” in the GitHub Help documentation.
Sourcepub async fn orgs_list_failed_invitations(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_list_failed_invitations( &self, org: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List failed organization invitations
The return hash contains failed_at
and failed_reason
fields which represent the time at which the invitation failed and the reason for the failure.
Sourcepub async fn orgs_list_webhooks(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_list_webhooks( &self, org: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List organization webhooks
Sourcepub async fn orgs_create_webhook<Content>(
&self,
org: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_create_webhook<Content>( &self, org: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create an organization webhook
Here’s how you can create a hook that posts payloads in JSON format:
§Content
Sourcepub async fn orgs_get_webhook(
&self,
org: &str,
hook_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_get_webhook( &self, org: &str, hook_id: i64, ) -> Result<Response<Body>, ApiError>
Get an organization webhook
Returns a webhook configured in an organization. To get only the webhook config
properties, see “Get a webhook configuration for an organization.”
Sourcepub async fn orgs_delete_webhook(
&self,
org: &str,
hook_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_delete_webhook( &self, org: &str, hook_id: i64, ) -> Result<Response<Body>, ApiError>
Delete an organization webhook
Sourcepub async fn orgs_update_webhook<Content>(
&self,
org: &str,
hook_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_update_webhook<Content>( &self, org: &str, hook_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update an organization webhook
Updates a webhook configured in an organization. When you update a webhook, the secret
will be overwritten. If you previously had a secret
set, you must provide the same secret
or set a new secret
or the secret will be removed. If you are only updating individual webhook config
properties, use “Update a webhook configuration for an organization.”
§Content
Sourcepub async fn orgs_get_webhook_config_for_org(
&self,
org: &str,
hook_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_get_webhook_config_for_org( &self, org: &str, hook_id: i64, ) -> Result<Response<Body>, ApiError>
Get a webhook configuration for an organization
Returns the webhook configuration for an organization. To get more information about the webhook, including the active
state and events
, use “Get an organization webhook .”
Access tokens must have the admin:org_hook
scope, and GitHub Apps must have the organization_hooks:read
permission.
Sourcepub async fn orgs_update_webhook_config_for_org<Content>(
&self,
org: &str,
hook_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_update_webhook_config_for_org<Content>( &self, org: &str, hook_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a webhook configuration for an organization
Updates the webhook configuration for an organization. To update more information about the webhook, including the active
state and events
, use “Update an organization webhook .”
Access tokens must have the admin:org_hook
scope, and GitHub Apps must have the organization_hooks:write
permission.
§Content
Sourcepub async fn orgs_list_webhook_deliveries(
&self,
org: &str,
hook_id: i64,
per_page: Option<i64>,
cursor: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_list_webhook_deliveries( &self, org: &str, hook_id: i64, per_page: Option<i64>, cursor: Option<&str>, ) -> Result<Response<Body>, ApiError>
List deliveries for an organization webhook
Returns a list of webhook deliveries for a webhook configured in an organization.
Sourcepub async fn orgs_get_webhook_delivery(
&self,
org: &str,
hook_id: i64,
delivery_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_get_webhook_delivery( &self, org: &str, hook_id: i64, delivery_id: i64, ) -> Result<Response<Body>, ApiError>
Get a webhook delivery for an organization webhook
Returns a delivery for a webhook configured in an organization.
Sourcepub async fn orgs_redeliver_webhook_delivery(
&self,
org: &str,
hook_id: i64,
delivery_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_redeliver_webhook_delivery( &self, org: &str, hook_id: i64, delivery_id: i64, ) -> Result<Response<Body>, ApiError>
Redeliver a delivery for an organization webhook
Redeliver a delivery for a webhook configured in an organization.
Sourcepub async fn orgs_ping_webhook(
&self,
org: &str,
hook_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_ping_webhook( &self, org: &str, hook_id: i64, ) -> Result<Response<Body>, ApiError>
Ping an organization webhook
This will trigger a ping event to be sent to the hook.
Sourcepub async fn apps_get_org_installation(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn apps_get_org_installation( &self, org: &str, ) -> Result<Response<Body>, ApiError>
Get an organization installation for the authenticated app
Enables an authenticated GitHub App to find the organization’s installation information.
You must use a JWT to access this endpoint.
Sourcepub async fn orgs_list_app_installations(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_list_app_installations( &self, org: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List app installations for an organization
Lists all GitHub Apps in an organization. The installation count includes all GitHub Apps installed on repositories in the organization. You must be an organization owner with admin:read
scope to use this endpoint.
Sourcepub async fn interactions_get_restrictions_for_org(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn interactions_get_restrictions_for_org( &self, org: &str, ) -> Result<Response<Body>, ApiError>
Get interaction restrictions for an organization
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.
Sourcepub async fn interactions_set_restrictions_for_org<Content>(
&self,
org: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn interactions_set_restrictions_for_org<Content>( &self, org: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set interaction restrictions for an organization
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.
§Content
Sourcepub async fn interactions_remove_restrictions_for_org(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn interactions_remove_restrictions_for_org( &self, org: &str, ) -> Result<Response<Body>, ApiError>
Remove interaction restrictions for an organization
Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions.
Sourcepub async fn orgs_list_pending_invitations(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_list_pending_invitations( &self, org: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List pending organization invitations
The return hash contains a role
field which refers to the Organization Invitation role and will be one of the following values: direct_member
, admin
, billing_manager
, hiring_manager
, or reinstate
. If the invitee is not a GitHub member, the login
field in the return hash will be null
.
Sourcepub async fn orgs_create_invitation<Content>(
&self,
org: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_create_invitation<Content>( &self, org: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create an organization invitation
Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
§Content
Sourcepub async fn orgs_cancel_invitation(
&self,
org: &str,
invitation_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_cancel_invitation( &self, org: &str, invitation_id: i64, ) -> Result<Response<Body>, ApiError>
Cancel an organization invitation
Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner.
This endpoint triggers notifications.
Sourcepub async fn orgs_list_invitation_teams(
&self,
org: &str,
invitation_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_list_invitation_teams( &self, org: &str, invitation_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List organization invitation teams
List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner.
Sourcepub async fn issues_list_for_org(
&self,
org: &str,
filter: Option<&str>,
state: Option<&str>,
labels: Option<&str>,
sort: &Sort<'_>,
since: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn issues_list_for_org( &self, org: &str, filter: Option<&str>, state: Option<&str>, labels: Option<&str>, sort: &Sort<'_>, since: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List organization issues assigned to the authenticated user
List issues in an organization assigned to the authenticated user.
Note: GitHub’s REST API v3 considers every pull request an issue, but not every issue is a pull request. For this
reason, “Issues” endpoints may return both issues and pull requests in the response. You can identify pull requests by
the pull_request
key. Be aware that the id
of a pull request returned from “Issues” endpoints will be an issue id. To find out the pull
request id, use the “List pull requests” endpoint.
Sourcepub async fn orgs_list_members(
&self,
org: &str,
filter: Option<&str>,
role: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_list_members( &self, org: &str, filter: Option<&str>, role: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List organization members
List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.
Sourcepub async fn orgs_check_membership_for_user(
&self,
org: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_check_membership_for_user( &self, org: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Check organization membership for a user
Check if a user is, publicly or privately, a member of the organization.
Sourcepub async fn orgs_remove_member(
&self,
org: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_remove_member( &self, org: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Remove an organization member
Removing a user from this list will remove them from all teams and they will no longer have any access to the organization’s repositories.
Sourcepub async fn orgs_get_membership_for_user(
&self,
org: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_get_membership_for_user( &self, org: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Get organization membership for a user
In order to get a user’s membership with an organization, the authenticated user must be an organization member. The state
parameter in the response can be used to identify the user’s membership status.
Sourcepub async fn orgs_set_membership_for_user<Content>(
&self,
org: &str,
username: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_set_membership_for_user<Content>( &self, org: &str, username: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set organization membership for a user
Only authenticated organization owners can add a member to the organization or update the member’s role.
-
If the authenticated user is adding a member to the organization, the invited user will receive an email inviting them to the organization. The user’s membership status will be
pending
until they accept the invitation. -
Authenticated users can update a user’s membership by passing the
role
parameter. If the authenticated user changes a member’s role toadmin
, the affected user will receive an email notifying them that they’ve been made an organization owner. If the authenticated user changes an owner’s role tomember
, no email will be sent.
Rate limits
To prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period.
§Content
Sourcepub async fn orgs_remove_membership_for_user(
&self,
org: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_remove_membership_for_user( &self, org: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Remove organization membership for a user
In order to remove a user’s membership with an organization, the authenticated user must be an organization owner.
If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases.
Sourcepub async fn migrations_list_for_org(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
exclude: Option<&[Cow<'_, str>]>,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_list_for_org( &self, org: &str, per_page: Option<i64>, page: Option<i64>, exclude: Option<&[Cow<'_, str>]>, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn migrations_start_for_org<Content>(
&self,
org: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_start_for_org<Content>( &self, org: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn migrations_get_status_for_org(
&self,
org: &str,
migration_id: i64,
exclude: Option<&[Cow<'_, str>]>,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_get_status_for_org( &self, org: &str, migration_id: i64, exclude: Option<&[Cow<'_, str>]>, ) -> Result<Response<Body>, ApiError>
Get an organization migration status
Fetches the status of a migration.
The state
of a migration can be one of the following values:
pending
, which means the migration hasn’t started yet.exporting
, which means the migration is in progress.exported
, which means the migration finished successfully.failed
, which means the migration failed.
Sourcepub async fn migrations_download_archive_for_org(
&self,
org: &str,
migration_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_download_archive_for_org( &self, org: &str, migration_id: i64, ) -> Result<Response<Body>, ApiError>
Download an organization migration archive
Fetches the URL to a migration archive.
Sourcepub async fn migrations_delete_archive_for_org(
&self,
org: &str,
migration_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_delete_archive_for_org( &self, org: &str, migration_id: i64, ) -> Result<Response<Body>, ApiError>
Delete an organization migration archive
Deletes a previous migration archive. Migration archives are automatically deleted after seven days.
Sourcepub async fn migrations_unlock_repo_for_org(
&self,
org: &str,
migration_id: i64,
repo_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_unlock_repo_for_org( &self, org: &str, migration_id: i64, repo_name: &str, ) -> Result<Response<Body>, ApiError>
Unlock an organization repository
Unlocks a repository that was locked for migration. You should unlock each migrated repository and delete them when the migration is complete and you no longer need the source data.
Sourcepub async fn migrations_list_repos_for_org(
&self,
org: &str,
migration_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_list_repos_for_org( &self, org: &str, migration_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repositories in an organization migration
List all the repositories for this organization migration.
Sourcepub async fn orgs_list_outside_collaborators(
&self,
org: &str,
filter: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_list_outside_collaborators( &self, org: &str, filter: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List outside collaborators for an organization
List all users who are outside collaborators of an organization.
Sourcepub async fn orgs_convert_member_to_outside_collaborator(
&self,
org: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_convert_member_to_outside_collaborator( &self, org: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Convert an organization member to outside collaborator
When an organization member is converted to an outside collaborator, they’ll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see “Converting an organization member to an outside collaborator”. Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see “Enforcing repository management policies in your enterprise.”
Sourcepub async fn orgs_remove_outside_collaborator(
&self,
org: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_remove_outside_collaborator( &self, org: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Remove outside collaborator from an organization
Removing a user from this list will remove them from all the organization’s repositories.
Sourcepub async fn packages_list_packages_for_organization(
&self,
package_type: &str,
org: &str,
visibility: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn packages_list_packages_for_organization( &self, package_type: &str, org: &str, visibility: Option<&str>, ) -> Result<Response<Body>, ApiError>
List packages for an organization
Lists all packages in an organization readable by the user.
To use this endpoint, you must authenticate using an access token with the packages:read
scope.
If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn packages_get_package_for_organization(
&self,
package_type: &str,
package_name: &str,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn packages_get_package_for_organization( &self, package_type: &str, package_name: &str, org: &str, ) -> Result<Response<Body>, ApiError>
Get a package for an organization
Gets a specific package in an organization.
To use this endpoint, you must authenticate using an access token with the packages:read
scope.
If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn packages_delete_package_for_org(
&self,
package_type: &str,
package_name: &str,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn packages_delete_package_for_org( &self, package_type: &str, package_name: &str, org: &str, ) -> Result<Response<Body>, ApiError>
Delete a package for an organization
Deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.
To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the packages:read
and packages:delete
scopes. In addition:
- If
package_type
is notcontainer
, your token must also include therepo
scope. - If
package_type
iscontainer
, you must also have admin permissions to the container you want to delete.
Sourcepub async fn packages_restore_package_for_org(
&self,
package_type: &str,
package_name: &str,
org: &str,
token: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn packages_restore_package_for_org( &self, package_type: &str, package_name: &str, org: &str, token: Option<&str>, ) -> Result<Response<Body>, ApiError>
Restore a package for an organization
Restores an entire package in an organization.
You can restore a deleted package under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package’s namespace first.
To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the packages:read
and packages:write
scopes. In addition:
- If
package_type
is notcontainer
, your token must also include therepo
scope. - If
package_type
iscontainer
, you must also have admin permissions to the container that you want to restore.
Sourcepub async fn packages_get_all_package_versions_for_package_owned_by_org(
&self,
package_type: &str,
package_name: &str,
org: &str,
page: Option<i64>,
per_page: Option<i64>,
state: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn packages_get_all_package_versions_for_package_owned_by_org( &self, package_type: &str, package_name: &str, org: &str, page: Option<i64>, per_page: Option<i64>, state: Option<&str>, ) -> Result<Response<Body>, ApiError>
Get all package versions for a package owned by an organization
Returns all package versions for a package owned by an organization.
To use this endpoint, you must authenticate using an access token with the packages:read
scope.
If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn packages_get_package_version_for_organization(
&self,
package_type: &str,
package_name: &str,
org: &str,
package_version_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn packages_get_package_version_for_organization( &self, package_type: &str, package_name: &str, org: &str, package_version_id: i64, ) -> Result<Response<Body>, ApiError>
Get a package version for an organization
Gets a specific package version in an organization.
You must authenticate using an access token with the packages:read
scope.
If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn packages_delete_package_version_for_org(
&self,
package_type: &str,
package_name: &str,
org: &str,
package_version_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn packages_delete_package_version_for_org( &self, package_type: &str, package_name: &str, org: &str, package_version_id: i64, ) -> Result<Response<Body>, ApiError>
Delete package version for an organization
Deletes a specific package version in an organization. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.
To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the packages:read
and packages:delete
scopes. In addition:
- If
package_type
is notcontainer
, your token must also include therepo
scope. - If
package_type
iscontainer
, you must also have admin permissions to the container you want to delete.
Sourcepub async fn packages_restore_package_version_for_org(
&self,
package_type: &str,
package_name: &str,
org: &str,
package_version_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn packages_restore_package_version_for_org( &self, package_type: &str, package_name: &str, org: &str, package_version_id: i64, ) -> Result<Response<Body>, ApiError>
Restore package version for an organization
Restores a specific package version in an organization.
You can restore a deleted package under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package’s namespace first.
To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the packages:read
and packages:write
scopes. In addition:
- If
package_type
is notcontainer
, your token must also include therepo
scope. - If
package_type
iscontainer
, you must also have admin permissions to the container that you want to restore.
Sourcepub async fn projects_list_for_org(
&self,
org: &str,
state: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn projects_list_for_org( &self, org: &str, state: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List organization projects
Lists the projects in an organization. Returns a 404 Not Found
status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a 401 Unauthorized
or 410 Gone
status is returned.
Sourcepub async fn projects_create_for_org<Content>(
&self,
org: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn projects_create_for_org<Content>( &self, org: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create an organization project
Creates an organization project board. Returns a 404 Not Found
status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a 401 Unauthorized
or 410 Gone
status is returned.
§Content
Sourcepub async fn orgs_list_public_members(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_list_public_members( &self, org: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List public organization members
Members of an organization can choose to have their membership publicized or not.
Sourcepub async fn orgs_check_public_membership_for_user(
&self,
org: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_check_public_membership_for_user( &self, org: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Check public organization membership for a user
Sourcepub async fn orgs_set_public_membership_for_authenticated_user(
&self,
org: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_set_public_membership_for_authenticated_user( &self, org: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Set public organization membership for the authenticated user
The user can publicize their own membership. (A user cannot publicize the membership for another user.)
Note that you’ll need to set Content-Length
to zero when calling out to this endpoint. For more information, see “HTTP verbs.”
Sourcepub async fn orgs_remove_public_membership_for_authenticated_user(
&self,
org: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_remove_public_membership_for_authenticated_user( &self, org: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Remove public organization membership for the authenticated user
Sourcepub async fn repos_list_for_org(
&self,
org: &str,
type: Option<&str>,
sort: &Sort<'_>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_for_org( &self, org: &str, type: Option<&str>, sort: &Sort<'_>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List organization repositories
Lists repositories for the specified organization.
Sourcepub async fn repos_create_in_org<Content>(
&self,
org: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_in_org<Content>( &self, org: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create an organization repository
Creates a new repository in the specified organization. The authenticated user must be a member of the organization.
OAuth scope requirements
When using OAuth, authorizations must include:
public_repo
scope orrepo
scope to create a public repository. Note: For GitHub AE, userepo
scope to create an internal repository.repo
scope to create a private repository
§Content
Sourcepub async fn secret_scanning_list_alerts_for_org(
&self,
org: &str,
state: Option<&str>,
secret_type: Option<&str>,
resolution: Option<&str>,
page: Option<i64>,
per_page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn secret_scanning_list_alerts_for_org( &self, org: &str, state: Option<&str>, secret_type: Option<&str>, resolution: Option<&str>, page: Option<i64>, per_page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List secret scanning alerts for an organization
Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.
To use this endpoint, you must be an administrator or security manager for the organization, and you must use an access token with the repo
scope or security_events
scope.
GitHub Apps must have the secret_scanning_alerts
read permission to use this endpoint.
Sourcepub async fn billing_get_github_actions_billing_org(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn billing_get_github_actions_billing_org( &self, org: &str, ) -> Result<Response<Body>, ApiError>
Get GitHub Actions billing for an organization
Gets the summary of the free and paid GitHub Actions minutes used.
Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see “Managing billing for GitHub Actions”.
Access tokens must have the repo
or admin:org
scope.
Sourcepub async fn billing_get_github_advanced_security_billing_org(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn billing_get_github_advanced_security_billing_org( &self, org: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Get GitHub Advanced Security active committers for an organization
Gets the GitHub Advanced Security active committers for an organization per repository. Each distinct user login across all repositories is counted as a single Advanced Security seat, so the total_advanced_security_committers is not the sum of advanced_security_committers for each repository. If this organization defers to an enterprise for billing, the total_advanced_security_committers returned from the organization API may include some users that are in more than one organization, so they will only consume a single Advanced Security seat at the enterprise level.
Sourcepub async fn billing_get_github_packages_billing_org(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn billing_get_github_packages_billing_org( &self, org: &str, ) -> Result<Response<Body>, ApiError>
Get GitHub Packages billing for an organization
Gets the free and paid storage used for GitHub Packages in gigabytes.
Paid minutes only apply to packages stored for private repositories. For more information, see “Managing billing for GitHub Packages.”
Access tokens must have the repo
or admin:org
scope.
Get shared storage billing for an organization
Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages.
Paid minutes only apply to packages stored for private repositories. For more information, see “Managing billing for GitHub Packages.”
Access tokens must have the repo
or admin:org
scope.
Sourcepub async fn teams_list_idp_groups_for_org(
&self,
org: &str,
per_page: Option<i64>,
page: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_idp_groups_for_org( &self, org: &str, per_page: Option<i64>, page: Option<&str>, ) -> Result<Response<Body>, ApiError>
List IdP groups for an organization
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
List IdP groups available in an organization. You can limit your page results using the per_page
parameter. GitHub generates a url-encoded page
token using a cursor value for where the next page begins. For more information on cursor pagination, see “Offset and Cursor Pagination explained.”
Sourcepub async fn teams_list(
&self,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list( &self, org: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List teams
Lists all teams in an organization that are visible to the authenticated user.
Sourcepub async fn teams_create<Content>(
&self,
org: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_create<Content>( &self, org: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a team
To create a team, the authenticated user must be a member or owner of {org}
. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see “Setting team creation permissions.”
When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of maintainers
. For more information, see “About teams”.
§Content
Sourcepub async fn teams_get_by_name(
&self,
org: &str,
team_slug: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_get_by_name( &self, org: &str, team_slug: &str, ) -> Result<Response<Body>, ApiError>
Get a team by name
Gets a team using the team’s slug
. GitHub generates the slug
from the team name
.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}
.
Sourcepub async fn teams_delete_in_org(
&self,
org: &str,
team_slug: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_delete_in_org( &self, org: &str, team_slug: &str, ) -> Result<Response<Body>, ApiError>
Delete a team
To delete a team, the authenticated user must be an organization owner or team maintainer.
If you are an organization owner, deleting a parent team will delete all of its child teams as well.
Note: You can also specify a team by org_id
and team_id
using the route DELETE /organizations/{org_id}/team/{team_id}
.
Sourcepub async fn teams_update_in_org<Content>(
&self,
org: &str,
team_slug: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_update_in_org<Content>( &self, org: &str, team_slug: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a team
To edit a team, the authenticated user must either be an organization owner or a team maintainer.
Note: You can also specify a team by org_id
and team_id
using the route PATCH /organizations/{org_id}/team/{team_id}
.
§Content
Sourcepub async fn teams_list_discussions_in_org(
&self,
org: &str,
team_slug: &str,
direction: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
pinned: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_discussions_in_org( &self, org: &str, team_slug: &str, direction: Option<&str>, per_page: Option<i64>, page: Option<i64>, pinned: Option<&str>, ) -> Result<Response<Body>, ApiError>
List discussions
List all discussions on a team’s page. OAuth access tokens require the read:discussion
scope.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/discussions
.
Sourcepub async fn teams_create_discussion_in_org<Content>(
&self,
org: &str,
team_slug: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_create_discussion_in_org<Content>( &self, org: &str, team_slug: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a discussion
Creates a new discussion post on a team’s page. OAuth access tokens require the write:discussion
scope.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
Note: You can also specify a team by org_id
and team_id
using the route POST /organizations/{org_id}/team/{team_id}/discussions
.
§Content
Sourcepub async fn teams_get_discussion_in_org(
&self,
org: &str,
team_slug: &str,
discussion_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_get_discussion_in_org( &self, org: &str, team_slug: &str, discussion_number: i64, ) -> Result<Response<Body>, ApiError>
Get a discussion
Get a specific discussion on a team’s page. OAuth access tokens require the read:discussion
scope.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}
.
Sourcepub async fn teams_delete_discussion_in_org(
&self,
org: &str,
team_slug: &str,
discussion_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_delete_discussion_in_org( &self, org: &str, team_slug: &str, discussion_number: i64, ) -> Result<Response<Body>, ApiError>
Delete a discussion
Delete a discussion from a team’s page. OAuth access tokens require the write:discussion
scope.
Note: You can also specify a team by org_id
and team_id
using the route DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}
.
Sourcepub async fn teams_update_discussion_in_org<Content>(
&self,
org: &str,
team_slug: &str,
discussion_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_update_discussion_in_org<Content>( &self, org: &str, team_slug: &str, discussion_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a discussion
Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the write:discussion
scope.
Note: You can also specify a team by org_id
and team_id
using the route PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}
.
§Content
Sourcepub async fn teams_list_discussion_comments_in_org(
&self,
org: &str,
team_slug: &str,
discussion_number: i64,
direction: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_discussion_comments_in_org( &self, org: &str, team_slug: &str, discussion_number: i64, direction: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List discussion comments
List all comments on a team discussion. OAuth access tokens require the read:discussion
scope.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments
.
Sourcepub async fn teams_create_discussion_comment_in_org<Content>(
&self,
org: &str,
team_slug: &str,
discussion_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_create_discussion_comment_in_org<Content>( &self, org: &str, team_slug: &str, discussion_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a discussion comment
Creates a new comment on a team discussion. OAuth access tokens require the write:discussion
scope.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
Note: You can also specify a team by org_id
and team_id
using the route POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments
.
§Content
Sourcepub async fn teams_get_discussion_comment_in_org(
&self,
org: &str,
team_slug: &str,
discussion_number: i64,
comment_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_get_discussion_comment_in_org( &self, org: &str, team_slug: &str, discussion_number: i64, comment_number: i64, ) -> Result<Response<Body>, ApiError>
Get a discussion comment
Get a specific comment on a team discussion. OAuth access tokens require the read:discussion
scope.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}
.
Sourcepub async fn teams_delete_discussion_comment_in_org(
&self,
org: &str,
team_slug: &str,
discussion_number: i64,
comment_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_delete_discussion_comment_in_org( &self, org: &str, team_slug: &str, discussion_number: i64, comment_number: i64, ) -> Result<Response<Body>, ApiError>
Delete a discussion comment
Deletes a comment on a team discussion. OAuth access tokens require the write:discussion
scope.
Note: You can also specify a team by org_id
and team_id
using the route DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}
.
Sourcepub async fn teams_update_discussion_comment_in_org<Content>(
&self,
org: &str,
team_slug: &str,
discussion_number: i64,
comment_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_update_discussion_comment_in_org<Content>( &self, org: &str, team_slug: &str, discussion_number: i64, comment_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a discussion comment
Edits the body text of a discussion comment. OAuth access tokens require the write:discussion
scope.
Note: You can also specify a team by org_id
and team_id
using the route PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}
.
§Content
Sourcepub async fn reactions_list_for_team_discussion_comment_in_org(
&self,
org: &str,
team_slug: &str,
discussion_number: i64,
comment_number: i64,
content: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_list_for_team_discussion_comment_in_org( &self, org: &str, team_slug: &str, discussion_number: i64, comment_number: i64, content: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List reactions for a team discussion comment
List the reactions to a team discussion comment. OAuth access tokens require the read:discussion
scope.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions
.
Sourcepub async fn reactions_create_for_team_discussion_comment_in_org<Content>(
&self,
org: &str,
team_slug: &str,
discussion_number: i64,
comment_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_create_for_team_discussion_comment_in_org<Content>( &self, org: &str, team_slug: &str, discussion_number: i64, comment_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create reaction for a team discussion comment
Create a reaction to a team discussion comment. OAuth access tokens require the write:discussion
scope. A response with an HTTP 200
status means that you already added the reaction type to this team discussion comment.
Note: You can also specify a team by org_id
and team_id
using the route POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions
.
§Content
Sourcepub async fn reactions_delete_for_team_discussion_comment(
&self,
org: &str,
team_slug: &str,
discussion_number: i64,
comment_number: i64,
reaction_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_delete_for_team_discussion_comment( &self, org: &str, team_slug: &str, discussion_number: i64, comment_number: i64, reaction_id: i64, ) -> Result<Response<Body>, ApiError>
Delete team discussion comment reaction
Note: You can also specify a team or organization with team_id
and org_id
using the route DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id
.
Delete a reaction to a team discussion comment. OAuth access tokens require the write:discussion
scope.
Sourcepub async fn reactions_list_for_team_discussion_in_org(
&self,
org: &str,
team_slug: &str,
discussion_number: i64,
content: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_list_for_team_discussion_in_org( &self, org: &str, team_slug: &str, discussion_number: i64, content: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List reactions for a team discussion
List the reactions to a team discussion. OAuth access tokens require the read:discussion
scope.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions
.
Sourcepub async fn reactions_create_for_team_discussion_in_org<Content>(
&self,
org: &str,
team_slug: &str,
discussion_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_create_for_team_discussion_in_org<Content>( &self, org: &str, team_slug: &str, discussion_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create reaction for a team discussion
Create a reaction to a team discussion. OAuth access tokens require the write:discussion
scope. A response with an HTTP 200
status means that you already added the reaction type to this team discussion.
Note: You can also specify a team by org_id
and team_id
using the route POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions
.
§Content
Sourcepub async fn reactions_delete_for_team_discussion(
&self,
org: &str,
team_slug: &str,
discussion_number: i64,
reaction_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_delete_for_team_discussion( &self, org: &str, team_slug: &str, discussion_number: i64, reaction_id: i64, ) -> Result<Response<Body>, ApiError>
Delete team discussion reaction
Note: You can also specify a team or organization with team_id
and org_id
using the route DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id
.
Delete a reaction to a team discussion. OAuth access tokens require the write:discussion
scope.
Sourcepub async fn teams_list_linked_external_idp_groups_to_team_for_org(
&self,
org: &str,
team_slug: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_linked_external_idp_groups_to_team_for_org( &self, org: &str, team_slug: &str, ) -> Result<Response<Body>, ApiError>
List a connection between an external group and a team
Lists a connection between a team and an external group.
You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see “GitHub’s products” in the GitHub Help documentation.
Sourcepub async fn teams_unlink_external_idp_group_from_team_for_org(
&self,
org: &str,
team_slug: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_unlink_external_idp_group_from_team_for_org( &self, org: &str, team_slug: &str, ) -> Result<Response<Body>, ApiError>
Remove the connection between an external group and a team
Deletes a connection between a team and an external group.
You can manage team membership with your IdP using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
Sourcepub async fn teams_link_external_idp_group_to_team_for_org<Content>(
&self,
org: &str,
team_slug: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_link_external_idp_group_to_team_for_org<Content>( &self, org: &str, team_slug: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update the connection between an external group and a team
Creates a connection between a team and an external group. Only one external group can be linked to a team.
You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see “GitHub’s products” in the GitHub Help documentation.
§Content
Sourcepub async fn teams_list_pending_invitations_in_org(
&self,
org: &str,
team_slug: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_pending_invitations_in_org( &self, org: &str, team_slug: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List pending team invitations
The return hash contains a role
field which refers to the Organization Invitation role and will be one of the following values: direct_member
, admin
, billing_manager
, hiring_manager
, or reinstate
. If the invitee is not a GitHub member, the login
field in the return hash will be null
.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/invitations
.
Sourcepub async fn teams_list_members_in_org(
&self,
org: &str,
team_slug: &str,
role: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_members_in_org( &self, org: &str, team_slug: &str, role: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List team members
Team members will include the members of child teams.
To list members in a team, the team must be visible to the authenticated user.
Sourcepub async fn teams_get_membership_for_user_in_org(
&self,
org: &str,
team_slug: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_get_membership_for_user_in_org( &self, org: &str, team_slug: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Get team membership for a user
Team members will include the members of child teams.
To get a user’s membership with a team, the team must be visible to the authenticated user.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/memberships/{username}
.
Note:
The response contains the state
of the membership and the member’s role
.
The role
for organization owners is set to maintainer
. For more information about maintainer
roles, see see Create a team.
Sourcepub async fn teams_add_or_update_membership_for_user_in_org<Content>(
&self,
org: &str,
team_slug: &str,
username: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_add_or_update_membership_for_user_in_org<Content>( &self, org: &str, team_slug: &str, username: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add or update team membership for a user
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team.
Note: When you have team synchronization set up for a team with your organization’s identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team’s membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see “Synchronizing teams between your identity provider and GitHub.”
An organization owner can add someone who is not part of the team’s organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the “pending” state until the person accepts the invitation, at which point the membership will transition to the “active” state and the user will be added as a member of the team.
If the user is already a member of the team, this endpoint will update the role of the team member’s role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.
Note: You can also specify a team by org_id
and team_id
using the route PUT /organizations/{org_id}/team/{team_id}/memberships/{username}
.
§Content
Sourcepub async fn teams_remove_membership_for_user_in_org(
&self,
org: &str,
team_slug: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_remove_membership_for_user_in_org( &self, org: &str, team_slug: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Remove team membership for a user
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
To remove a membership between a user and a team, the authenticated user must have ‘admin’ permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.
Note: When you have team synchronization set up for a team with your organization’s identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team’s membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see “Synchronizing teams between your identity provider and GitHub.”
Note: You can also specify a team by org_id
and team_id
using the route DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}
.
Sourcepub async fn teams_list_projects_in_org(
&self,
org: &str,
team_slug: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_projects_in_org( &self, org: &str, team_slug: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List team projects
Lists the organization projects for a team.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/projects
.
Sourcepub async fn teams_check_permissions_for_project_in_org(
&self,
org: &str,
team_slug: &str,
project_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_check_permissions_for_project_in_org( &self, org: &str, team_slug: &str, project_id: i64, ) -> Result<Response<Body>, ApiError>
Check team permissions for a project
Checks whether a team has read
, write
, or admin
permissions for an organization project. The response includes projects inherited from a parent team.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/projects/{project_id}
.
Sourcepub async fn teams_add_or_update_project_permissions_in_org<Content>(
&self,
org: &str,
team_slug: &str,
project_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_add_or_update_project_permissions_in_org<Content>( &self, org: &str, team_slug: &str, project_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add or update team project permissions
Adds an organization project to a team. To add a project to a team or update the team’s permission on a project, the authenticated user must have admin
permissions for the project. The project and team must be part of the same organization.
Note: You can also specify a team by org_id
and team_id
using the route PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}
.
§Content
Sourcepub async fn teams_remove_project_in_org(
&self,
org: &str,
team_slug: &str,
project_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_remove_project_in_org( &self, org: &str, team_slug: &str, project_id: i64, ) -> Result<Response<Body>, ApiError>
Remove a project from a team
Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have read
access to both the team and project, or admin
access to the team or project. This endpoint removes the project from the team, but does not delete the project.
Note: You can also specify a team by org_id
and team_id
using the route DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}
.
Sourcepub async fn teams_list_repos_in_org(
&self,
org: &str,
team_slug: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_repos_in_org( &self, org: &str, team_slug: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List team repositories
Lists a team’s repositories visible to the authenticated user.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/repos
.
Sourcepub async fn teams_check_permissions_for_repo_in_org(
&self,
org: &str,
team_slug: &str,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_check_permissions_for_repo_in_org( &self, org: &str, team_slug: &str, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Check team permissions for a repository
Checks whether a team has admin
, push
, maintain
, triage
, or pull
permission for a repository. Repositories inherited through a parent team will also be checked.
You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom media type via the application/vnd.github.v3.repository+json
accept header.
If a team doesn’t have permission for the repository, you will receive a 404 Not Found
response status.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}
.
Sourcepub async fn teams_add_or_update_repo_permissions_in_org<Content>(
&self,
org: &str,
team_slug: &str,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_add_or_update_repo_permissions_in_org<Content>( &self, org: &str, team_slug: &str, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add or update team repository permissions
To add a repository to a team or update the team’s permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a 422 Unprocessable Entity
status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you’ll need to set Content-Length
to zero when calling out to this endpoint. For more information, see “HTTP verbs.”
Note: You can also specify a team by org_id
and team_id
using the route PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}
.
For more information about the permission levels, see “Repository permission levels for an organization”.
§Content
Sourcepub async fn teams_remove_repo_in_org(
&self,
org: &str,
team_slug: &str,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_remove_repo_in_org( &self, org: &str, team_slug: &str, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Remove a repository from a team
If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team.
Note: You can also specify a team by org_id
and team_id
using the route DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}
.
Sourcepub async fn teams_list_idp_groups_in_org(
&self,
org: &str,
team_slug: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_idp_groups_in_org( &self, org: &str, team_slug: &str, ) -> Result<Response<Body>, ApiError>
List IdP groups for a team
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
List IdP groups connected to a team on GitHub.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/team-sync/group-mappings
.
Sourcepub async fn teams_create_or_update_idp_group_connections_in_org<Content>(
&self,
org: &str,
team_slug: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_create_or_update_idp_group_connections_in_org<Content>( &self, org: &str, team_slug: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create or update IdP group connections
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty groups
array will remove all connections for a team.
Note: You can also specify a team by org_id
and team_id
using the route PATCH /organizations/{org_id}/team/{team_id}/team-sync/group-mappings
.
§Content
Sourcepub async fn teams_list_child_in_org(
&self,
org: &str,
team_slug: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_child_in_org( &self, org: &str, team_slug: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List child teams
Lists the child teams of the team specified by {team_slug}
.
Note: You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/teams
.
Sourcepub async fn projects_get_card(
&self,
card_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn projects_get_card( &self, card_id: i64, ) -> Result<Response<Body>, ApiError>
Get a project card
Sourcepub async fn projects_delete_card(
&self,
card_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn projects_delete_card( &self, card_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a project card
Sourcepub async fn projects_update_card<Content>(
&self,
card_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn projects_update_card<Content>( &self, card_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update an existing project card
§Content
Sourcepub async fn projects_move_card<Content>(
&self,
card_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn projects_move_card<Content>( &self, card_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Move a project card
§Content
Sourcepub async fn projects_get_column(
&self,
column_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn projects_get_column( &self, column_id: i64, ) -> Result<Response<Body>, ApiError>
Get a project column
Sourcepub async fn projects_delete_column(
&self,
column_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn projects_delete_column( &self, column_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a project column
Sourcepub async fn projects_update_column<Content>(
&self,
column_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn projects_update_column<Content>( &self, column_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update an existing project column
§Content
Sourcepub async fn projects_list_cards(
&self,
column_id: i64,
archived_state: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn projects_list_cards( &self, column_id: i64, archived_state: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List project cards
Sourcepub async fn projects_create_card<Content>(
&self,
column_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn projects_create_card<Content>( &self, column_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn projects_move_column<Content>(
&self,
column_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn projects_move_column<Content>( &self, column_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Move a project column
§Content
Sourcepub async fn projects_get(
&self,
project_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn projects_get( &self, project_id: i64, ) -> Result<Response<Body>, ApiError>
Get a project
Gets a project by its id
. Returns a 404 Not Found
status if projects are disabled. If you do not have sufficient privileges to perform this action, a 401 Unauthorized
or 410 Gone
status is returned.
Sourcepub async fn projects_delete(
&self,
project_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn projects_delete( &self, project_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a project
Deletes a project board. Returns a 404 Not Found
status if projects are disabled.
Sourcepub async fn projects_update<Content>(
&self,
project_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn projects_update<Content>( &self, project_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a project
Updates a project board’s information. Returns a 404 Not Found
status if projects are disabled. If you do not have sufficient privileges to perform this action, a 401 Unauthorized
or 410 Gone
status is returned.
§Content
Sourcepub async fn projects_list_collaborators(
&self,
project_id: i64,
affiliation: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn projects_list_collaborators( &self, project_id: i64, affiliation: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List project collaborators
Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project admin
to list collaborators.
Sourcepub async fn projects_add_collaborator<Content>(
&self,
project_id: i64,
username: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn projects_add_collaborator<Content>( &self, project_id: i64, username: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add project collaborator
Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project admin
to add a collaborator.
§Content
Sourcepub async fn projects_remove_collaborator(
&self,
project_id: i64,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn projects_remove_collaborator( &self, project_id: i64, username: &str, ) -> Result<Response<Body>, ApiError>
Remove user as a collaborator
Removes a collaborator from an organization project. You must be an organization owner or a project admin
to remove a collaborator.
Sourcepub async fn projects_get_permission_for_user(
&self,
project_id: i64,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn projects_get_permission_for_user( &self, project_id: i64, username: &str, ) -> Result<Response<Body>, ApiError>
Get project permission for a user
Returns the collaborator’s permission level for an organization project. Possible values for the permission
key: admin
, write
, read
, none
. You must be an organization owner or a project admin
to review a user’s permission level.
Sourcepub async fn projects_list_columns(
&self,
project_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn projects_list_columns( &self, project_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List project columns
Sourcepub async fn projects_create_column<Content>(
&self,
project_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn projects_create_column<Content>( &self, project_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a project column
§Content
Sourcepub async fn rate_limit_get(&self) -> Result<Response<Body>, ApiError>
pub async fn rate_limit_get(&self) -> Result<Response<Body>, ApiError>
Get rate limit status for the authenticated user
Note: Accessing this endpoint does not count against your REST API rate limit.
Note: The rate
object is deprecated. If you’re writing new API client code or updating existing code, you should use the core
object instead of the rate
object. The core
object contains the same information that is present in the rate
object.
Sourcepub async fn repos_get(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get a repository
The parent
and source
objects are present when the repository is a fork. parent
is the repository this repository was forked from, source
is the ultimate source for the network.
Sourcepub async fn repos_delete(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Delete a repository
Deleting a repository requires admin access. If OAuth is used, the delete_repo
scope is required.
If an organization owner has configured the organization to prevent members from deleting organization-owned
repositories, you will get a 403 Forbidden
response.
Sourcepub async fn repos_update<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_update<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a repository
Note: To edit a repository’s topics, use the Replace all repository topics endpoint.
§Content
Sourcepub async fn actions_list_artifacts_for_repo(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_artifacts_for_repo( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List artifacts for a repository
Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn actions_get_artifact(
&self,
owner: &str,
repo: &str,
artifact_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_artifact( &self, owner: &str, repo: &str, artifact_id: i64, ) -> Result<Response<Body>, ApiError>
Get an artifact
Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn actions_delete_artifact(
&self,
owner: &str,
repo: &str,
artifact_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_delete_artifact( &self, owner: &str, repo: &str, artifact_id: i64, ) -> Result<Response<Body>, ApiError>
Delete an artifact
Deletes an artifact for a workflow run. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the actions:write
permission to use this endpoint.
Sourcepub async fn actions_download_artifact(
&self,
owner: &str,
repo: &str,
artifact_id: i64,
archive_format: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_download_artifact( &self, owner: &str, repo: &str, artifact_id: i64, archive_format: &str, ) -> Result<Response<Body>, ApiError>
Download an artifact
Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for Location:
in
the response header to find the URL for the download. The :archive_format
must be zip
. Anyone with read access to
the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope.
GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn actions_get_actions_cache_usage(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_actions_cache_usage( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get GitHub Actions cache usage for a repository
Gets GitHub Actions cache usage for a repository.
The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.
Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn actions_get_job_for_workflow_run(
&self,
owner: &str,
repo: &str,
job_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_job_for_workflow_run( &self, owner: &str, repo: &str, job_id: i64, ) -> Result<Response<Body>, ApiError>
Get a job for a workflow run
Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn actions_download_job_logs_for_workflow_run(
&self,
owner: &str,
repo: &str,
job_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_download_job_logs_for_workflow_run( &self, owner: &str, repo: &str, job_id: i64, ) -> Result<Response<Body>, ApiError>
Download job logs for a workflow run
Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look
for Location:
in the response header to find the URL for the download. Anyone with read access to the repository can
use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must
have the actions:read
permission to use this endpoint.
Sourcepub async fn actions_re_run_job_for_workflow_run(
&self,
owner: &str,
repo: &str,
job_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_re_run_job_for_workflow_run( &self, owner: &str, repo: &str, job_id: i64, ) -> Result<Response<Body>, ApiError>
Re-run a job from a workflow run
Re-run a job and its dependent jobs in a workflow run. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the actions:write
permission to use this endpoint.
Sourcepub async fn actions_get_github_actions_permissions_repository(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_github_actions_permissions_repository( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get GitHub Actions permissions for a repository
Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository.
You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the administration
repository permission to use this API.
Sourcepub async fn actions_set_github_actions_permissions_repository<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_set_github_actions_permissions_repository<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set GitHub Actions permissions for a repository
Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository.
If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as allowed_actions
to selected
actions and reusable workflows, then you cannot override them for the repository.
You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the administration
repository permission to use this API.
§Content
Sourcepub async fn actions_get_workflow_access_to_repository(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_workflow_access_to_repository( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get the level of access for workflows outside of the repository
Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. This endpoint only applies to internal repositories. For more information, see “Managing GitHub Actions settings for a repository.”
You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the
repository administration
permission to use this endpoint.
Sourcepub async fn actions_set_workflow_access_to_repository<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_set_workflow_access_to_repository<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set the level of access for workflows outside of the repository
Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. This endpoint only applies to internal repositories. For more information, see “Managing GitHub Actions settings for a repository.”
You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the
repository administration
permission to use this endpoint.
§Content
Sourcepub async fn actions_get_allowed_actions_repository(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_allowed_actions_repository( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get allowed actions and reusable workflows for a repository
Gets the settings for selected actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository policy for allowed_actions
must be configured to selected
. For more information, see “Set GitHub Actions permissions for a repository.”
You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the administration
repository permission to use this API.
Sourcepub async fn actions_set_allowed_actions_repository<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_set_allowed_actions_repository<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set allowed actions and reusable workflows for a repository
Sets the actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository permission policy for allowed_actions
must be configured to selected
. For more information, see “Set GitHub Actions permissions for a repository.”
If the repository belongs to an organization or enterprise that has selected
actions and reusable workflows set at the organization or enterprise levels, then you cannot override any of the allowed actions and reusable workflows settings.
To use the patterns_allowed
setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the patterns_allowed
setting only applies to public repositories.
You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the administration
repository permission to use this API.
§Content
Sourcepub async fn actions_get_github_actions_default_workflow_permissions_repository(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_github_actions_default_workflow_permissions_repository( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get default workflow permissions for a repository
Gets the default workflow permissions granted to the GITHUB_TOKEN
when running workflows in a repository,
as well as if GitHub Actions can submit approving pull request reviews.
For more information, see “Setting the permissions of the GITHUB_TOKEN for your repository.”
You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the repository administration
permission to use this API.
Sourcepub async fn actions_set_github_actions_default_workflow_permissions_repository<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_set_github_actions_default_workflow_permissions_repository<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set default workflow permissions for a repository
Sets the default workflow permissions granted to the GITHUB_TOKEN
when running workflows in a repository, and sets if GitHub Actions
can submit approving pull request reviews.
For more information, see “Setting the permissions of the GITHUB_TOKEN for your repository.”
You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the repository administration
permission to use this API.
§Content
Sourcepub async fn actions_list_self_hosted_runners_for_repo(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_self_hosted_runners_for_repo( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List self-hosted runners for a repository
Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the repo
scope to use this endpoint.
Sourcepub async fn actions_list_runner_applications_for_repo(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_runner_applications_for_repo( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
List runner applications for a repository
Lists binaries for the runner application that you can download and run.
You must authenticate using an access token with the repo
scope to use this endpoint.
Sourcepub async fn actions_create_registration_token_for_repo(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_create_registration_token_for_repo( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Create a registration token for a repository
Returns a token that you can pass to the config
script. The token expires after one hour. You must authenticate
using an access token with the repo
scope to use this endpoint.
§Example using registration token
Configure your self-hosted runner, replacing TOKEN
with the registration token provided by this endpoint.
./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN
Sourcepub async fn actions_create_remove_token_for_repo(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_create_remove_token_for_repo( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Create a remove token for a repository
Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour.
You must authenticate using an access token with the repo
scope to use this endpoint.
§Example using remove token
To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint.
./config.sh remove --token TOKEN
Sourcepub async fn actions_get_self_hosted_runner_for_repo(
&self,
owner: &str,
repo: &str,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_self_hosted_runner_for_repo( &self, owner: &str, repo: &str, runner_id: i64, ) -> Result<Response<Body>, ApiError>
Get a self-hosted runner for a repository
Gets a specific self-hosted runner configured in a repository.
You must authenticate using an access token with the repo
scope to use this
endpoint.
Sourcepub async fn actions_delete_self_hosted_runner_from_repo(
&self,
owner: &str,
repo: &str,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_delete_self_hosted_runner_from_repo( &self, owner: &str, repo: &str, runner_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a self-hosted runner from a repository
Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.
You must authenticate using an access token with the repo
scope to use this endpoint.
Sourcepub async fn actions_list_labels_for_self_hosted_runner_for_repo(
&self,
owner: &str,
repo: &str,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_labels_for_self_hosted_runner_for_repo( &self, owner: &str, repo: &str, runner_id: i64, ) -> Result<Response<Body>, ApiError>
List labels for a self-hosted runner for a repository
Lists all labels for a self-hosted runner configured in a repository.
You must authenticate using an access token with the repo
scope to use this
endpoint.
Sourcepub async fn actions_set_custom_labels_for_self_hosted_runner_for_repo<Content>(
&self,
owner: &str,
repo: &str,
runner_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_set_custom_labels_for_self_hosted_runner_for_repo<Content>( &self, owner: &str, repo: &str, runner_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set custom labels for a self-hosted runner for a repository
Remove all previous custom labels and set the new custom labels for a specific self-hosted runner configured in a repository.
You must authenticate using an access token with the repo
scope to use this
endpoint.
§Content
Sourcepub async fn actions_add_custom_labels_to_self_hosted_runner_for_repo<Content>(
&self,
owner: &str,
repo: &str,
runner_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_add_custom_labels_to_self_hosted_runner_for_repo<Content>( &self, owner: &str, repo: &str, runner_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add custom labels to a self-hosted runner for a repository
Add custom labels to a self-hosted runner configured in a repository.
You must authenticate using an access token with the repo
scope to use this
endpoint.
§Content
Sourcepub async fn actions_remove_all_custom_labels_from_self_hosted_runner_for_repo(
&self,
owner: &str,
repo: &str,
runner_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_remove_all_custom_labels_from_self_hosted_runner_for_repo( &self, owner: &str, repo: &str, runner_id: i64, ) -> Result<Response<Body>, ApiError>
Remove all custom labels from a self-hosted runner for a repository
Remove all custom labels from a self-hosted runner configured in a repository. Returns the remaining read-only labels from the runner.
You must authenticate using an access token with the repo
scope to use this
endpoint.
Sourcepub async fn actions_remove_custom_label_from_self_hosted_runner_for_repo(
&self,
owner: &str,
repo: &str,
runner_id: i64,
name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_remove_custom_label_from_self_hosted_runner_for_repo( &self, owner: &str, repo: &str, runner_id: i64, name: &str, ) -> Result<Response<Body>, ApiError>
Remove a custom label from a self-hosted runner for a repository
Remove a custom label from a self-hosted runner configured in a repository. Returns the remaining labels from the runner.
This endpoint returns a 404 Not Found
status if the custom label is not
present on the runner.
You must authenticate using an access token with the repo
scope to use this
endpoint.
Sourcepub async fn actions_list_workflow_runs_for_repo(
&self,
owner: &str,
repo: &str,
actor: Option<&str>,
branch: Option<&str>,
event: Option<&str>,
status: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
created: Option<&str>,
exclude_pull_requests: Option<bool>,
check_suite_id: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_workflow_runs_for_repo( &self, owner: &str, repo: &str, actor: Option<&str>, branch: Option<&str>, event: Option<&str>, status: Option<&str>, per_page: Option<i64>, page: Option<i64>, created: Option<&str>, exclude_pull_requests: Option<bool>, check_suite_id: Option<i64>, ) -> Result<Response<Body>, ApiError>
List workflow runs for a repository
Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.
Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn actions_get_workflow_run(
&self,
owner: &str,
repo: &str,
run_id: i64,
exclude_pull_requests: Option<bool>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_workflow_run( &self, owner: &str, repo: &str, run_id: i64, exclude_pull_requests: Option<bool>, ) -> Result<Response<Body>, ApiError>
Get a workflow run
Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn actions_delete_workflow_run(
&self,
owner: &str,
repo: &str,
run_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_delete_workflow_run( &self, owner: &str, repo: &str, run_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a workflow run
Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is
private you must use an access token with the repo
scope. GitHub Apps must have the actions:write
permission to use
this endpoint.
Sourcepub async fn actions_get_reviews_for_run(
&self,
owner: &str,
repo: &str,
run_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_reviews_for_run( &self, owner: &str, repo: &str, run_id: i64, ) -> Result<Response<Body>, ApiError>
Get the review history for a workflow run
Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn actions_approve_workflow_run(
&self,
owner: &str,
repo: &str,
run_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_approve_workflow_run( &self, owner: &str, repo: &str, run_id: i64, ) -> Result<Response<Body>, ApiError>
Approve a workflow run for a fork pull request
Approves a workflow run for a pull request from a public fork of a first time contributor. For more information, see “Approving workflow runs from public forks.“
You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the actions:write
permission to use this endpoint.
Sourcepub async fn actions_list_workflow_run_artifacts(
&self,
owner: &str,
repo: &str,
run_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_workflow_run_artifacts( &self, owner: &str, repo: &str, run_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List workflow run artifacts
Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn actions_get_workflow_run_attempt(
&self,
owner: &str,
repo: &str,
run_id: i64,
attempt_number: i64,
exclude_pull_requests: Option<bool>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_workflow_run_attempt( &self, owner: &str, repo: &str, run_id: i64, attempt_number: i64, exclude_pull_requests: Option<bool>, ) -> Result<Response<Body>, ApiError>
Get a workflow run attempt
Gets a specific workflow run attempt. Anyone with read access to the repository
can use this endpoint. If the repository is private you must use an access token
with the repo
scope. GitHub Apps must have the actions:read
permission to
use this endpoint.
Sourcepub async fn actions_list_jobs_for_workflow_run_attempt(
&self,
owner: &str,
repo: &str,
run_id: i64,
attempt_number: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_jobs_for_workflow_run_attempt( &self, owner: &str, repo: &str, run_id: i64, attempt_number: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List jobs for a workflow run attempt
Lists jobs for a specific workflow run attempt. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.
Sourcepub async fn actions_download_workflow_run_attempt_logs(
&self,
owner: &str,
repo: &str,
run_id: i64,
attempt_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_download_workflow_run_attempt_logs( &self, owner: &str, repo: &str, run_id: i64, attempt_number: i64, ) -> Result<Response<Body>, ApiError>
Download workflow run attempt logs
Gets a redirect URL to download an archive of log files for a specific workflow run attempt. This link expires after
1 minute. Look for Location:
in the response header to find the URL for the download. Anyone with read access to
the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope.
GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn actions_cancel_workflow_run(
&self,
owner: &str,
repo: &str,
run_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_cancel_workflow_run( &self, owner: &str, repo: &str, run_id: i64, ) -> Result<Response<Body>, ApiError>
Cancel a workflow run
Cancels a workflow run using its id
. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the actions:write
permission to use this endpoint.
Sourcepub async fn actions_list_jobs_for_workflow_run(
&self,
owner: &str,
repo: &str,
run_id: i64,
filter: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_jobs_for_workflow_run( &self, owner: &str, repo: &str, run_id: i64, filter: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List jobs for a workflow run
Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.
Sourcepub async fn actions_download_workflow_run_logs(
&self,
owner: &str,
repo: &str,
run_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_download_workflow_run_logs( &self, owner: &str, repo: &str, run_id: i64, ) -> Result<Response<Body>, ApiError>
Download workflow run logs
Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for
Location:
in the response header to find the URL for the download. Anyone with read access to the repository can use
this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have
the actions:read
permission to use this endpoint.
Sourcepub async fn actions_delete_workflow_run_logs(
&self,
owner: &str,
repo: &str,
run_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_delete_workflow_run_logs( &self, owner: &str, repo: &str, run_id: i64, ) -> Result<Response<Body>, ApiError>
Delete workflow run logs
Deletes all logs for a workflow run. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the actions:write
permission to use this endpoint.
Sourcepub async fn actions_get_pending_deployments_for_run(
&self,
owner: &str,
repo: &str,
run_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_pending_deployments_for_run( &self, owner: &str, repo: &str, run_id: i64, ) -> Result<Response<Body>, ApiError>
Get pending deployments for a workflow run
Get all deployment environments for a workflow run that are waiting for protection rules to pass.
Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn actions_review_pending_deployments_for_run<Content>(
&self,
owner: &str,
repo: &str,
run_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_review_pending_deployments_for_run<Content>( &self, owner: &str, repo: &str, run_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Review pending deployments for a workflow run
Approve or reject pending deployments that are waiting on approval by a required reviewer.
Anyone with read access to the repository contents and deployments can use this endpoint.
§Content
Sourcepub async fn actions_re_run_workflow(
&self,
owner: &str,
repo: &str,
run_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_re_run_workflow( &self, owner: &str, repo: &str, run_id: i64, ) -> Result<Response<Body>, ApiError>
Re-run a workflow
Re-runs your workflow run using its id
. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the actions:write
permission to use this endpoint.
Sourcepub async fn actions_re_run_workflow_failed_jobs(
&self,
owner: &str,
repo: &str,
run_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_re_run_workflow_failed_jobs( &self, owner: &str, repo: &str, run_id: i64, ) -> Result<Response<Body>, ApiError>
Re-run failed jobs from a workflow run
Re-run all of the failed jobs and their dependent jobs in a workflow run using the id
of the workflow run. You must authenticate using an access token with the repo
scope to use this endpoint.
Sourcepub async fn actions_get_workflow_run_usage(
&self,
owner: &str,
repo: &str,
run_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_workflow_run_usage( &self, owner: &str, repo: &str, run_id: i64, ) -> Result<Response<Body>, ApiError>
Get workflow run usage
Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see “Managing billing for GitHub Actions”.
Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn actions_list_repo_secrets(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_repo_secrets( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repository secrets
Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the secrets
repository permission to use this endpoint.
Sourcepub async fn actions_get_repo_public_key(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_repo_public_key( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get a repository public key
Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the secrets
repository permission to use this endpoint.
Sourcepub async fn actions_get_repo_secret(
&self,
owner: &str,
repo: &str,
secret_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_repo_secret( &self, owner: &str, repo: &str, secret_name: &str, ) -> Result<Response<Body>, ApiError>
Get a repository secret
Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the secrets
repository permission to use this endpoint.
Sourcepub async fn actions_create_or_update_repo_secret<Content>(
&self,
owner: &str,
repo: &str,
secret_name: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_create_or_update_repo_secret<Content>( &self, owner: &str, repo: &str, secret_name: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create or update a repository secret
Creates or updates a repository secret with an encrypted value. Encrypt your secret using
LibSodium. You must authenticate using an access
token with the repo
scope to use this endpoint. GitHub Apps must have the secrets
repository permission to use
this endpoint.
§Example encrypting a secret using Node.js
Encrypt your secret using the tweetsodium library.
const sodium = require('tweetsodium');
const key = "base64-encoded-public-key";
const value = "plain-text-secret";
// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
console.log(encrypted);
§Example encrypting a secret using Python
Encrypt your secret using pynacl with Python 3.
from base64 import b64encode
from nacl import encoding, public
def encrypt(public_key: str, secret_value: str) -> str:
"""Encrypt a Unicode string using the public key."""
public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
sealed_box = public.SealedBox(public_key)
encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
return b64encode(encrypted).decode("utf-8")
§Example encrypting a secret using C#
Encrypt your secret using the Sodium.Core package.
var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));
§Example encrypting a secret using Ruby
Encrypt your secret using the rbnacl gem.
require "rbnacl"
require "base64"
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")
# Print the base64 encoded secret
puts Base64.strict_encode64(encrypted_secret)
§Content
Sourcepub async fn actions_delete_repo_secret(
&self,
owner: &str,
repo: &str,
secret_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_delete_repo_secret( &self, owner: &str, repo: &str, secret_name: &str, ) -> Result<Response<Body>, ApiError>
Delete a repository secret
Deletes a secret in a repository using the secret name. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the secrets
repository permission to use this endpoint.
Sourcepub async fn actions_list_repo_workflows(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_repo_workflows( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repository workflows
Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn actions_get_workflow(
&self,
owner: &str,
repo: &str,
workflow_id: &Value,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_workflow( &self, owner: &str, repo: &str, workflow_id: &Value, ) -> Result<Response<Body>, ApiError>
Get a workflow
Gets a specific workflow. You can replace workflow_id
with the workflow file name. For example, you could use main.yaml
. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn actions_disable_workflow(
&self,
owner: &str,
repo: &str,
workflow_id: &Value,
) -> Result<Response<Body>, ApiError>
pub async fn actions_disable_workflow( &self, owner: &str, repo: &str, workflow_id: &Value, ) -> Result<Response<Body>, ApiError>
Disable a workflow
Disables a workflow and sets the state
of the workflow to disabled_manually
. You can replace workflow_id
with the workflow file name. For example, you could use main.yaml
.
You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the actions:write
permission to use this endpoint.
Sourcepub async fn actions_create_workflow_dispatch<Content>(
&self,
owner: &str,
repo: &str,
workflow_id: &Value,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_create_workflow_dispatch<Content>( &self, owner: &str, repo: &str, workflow_id: &Value, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a workflow dispatch event
You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace workflow_id
with the workflow file name. For example, you could use main.yaml
.
You must configure your GitHub Actions workflow to run when the workflow_dispatch
webhook event occurs. The inputs
are configured in the workflow file. For more information about how to configure the workflow_dispatch
event in the workflow file, see “Events that trigger workflows.”
You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the actions:write
permission to use this endpoint. For more information, see “Creating a personal access token for the command line.”
§Content
Sourcepub async fn actions_enable_workflow(
&self,
owner: &str,
repo: &str,
workflow_id: &Value,
) -> Result<Response<Body>, ApiError>
pub async fn actions_enable_workflow( &self, owner: &str, repo: &str, workflow_id: &Value, ) -> Result<Response<Body>, ApiError>
Enable a workflow
Enables a workflow and sets the state
of the workflow to active
. You can replace workflow_id
with the workflow file name. For example, you could use main.yaml
.
You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the actions:write
permission to use this endpoint.
Sourcepub async fn actions_list_workflow_runs(
&self,
owner: &str,
repo: &str,
workflow_id: &Value,
actor: Option<&str>,
branch: Option<&str>,
event: Option<&str>,
status: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
created: Option<&str>,
exclude_pull_requests: Option<bool>,
check_suite_id: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_workflow_runs( &self, owner: &str, repo: &str, workflow_id: &Value, actor: Option<&str>, branch: Option<&str>, event: Option<&str>, status: Option<&str>, per_page: Option<i64>, page: Option<i64>, created: Option<&str>, exclude_pull_requests: Option<bool>, check_suite_id: Option<i64>, ) -> Result<Response<Body>, ApiError>
List workflow runs
List all workflow runs for a workflow. You can replace workflow_id
with the workflow file name. For example, you could use main.yaml
. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.
Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope.
Sourcepub async fn actions_get_workflow_usage(
&self,
owner: &str,
repo: &str,
workflow_id: &Value,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_workflow_usage( &self, owner: &str, repo: &str, workflow_id: &Value, ) -> Result<Response<Body>, ApiError>
Get workflow usage
Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see “Managing billing for GitHub Actions”.
You can replace workflow_id
with the workflow file name. For example, you could use main.yaml
. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn issues_list_assignees(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn issues_list_assignees( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn issues_check_user_can_be_assigned(
&self,
owner: &str,
repo: &str,
assignee: &str,
) -> Result<Response<Body>, ApiError>
pub async fn issues_check_user_can_be_assigned( &self, owner: &str, repo: &str, assignee: &str, ) -> Result<Response<Body>, ApiError>
Check if a user can be assigned
Checks if a user has permission to be assigned to an issue in this repository.
If the assignee
can be assigned to issues in the repository, a 204
header with no content is returned.
Otherwise a 404
status code is returned.
Sourcepub async fn repos_list_autolinks(
&self,
owner: &str,
repo: &str,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_autolinks( &self, owner: &str, repo: &str, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List all autolinks of a repository
This returns a list of autolinks configured for the given repository.
Information about autolinks are only available to repository administrators.
Sourcepub async fn repos_create_autolink<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_autolink<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create an autolink reference for a repository
Users with admin access to the repository can create an autolink.
§Content
Sourcepub async fn repos_get_autolink(
&self,
owner: &str,
repo: &str,
autolink_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_autolink( &self, owner: &str, repo: &str, autolink_id: i64, ) -> Result<Response<Body>, ApiError>
Get an autolink reference of a repository
This returns a single autolink reference by ID that was configured for the given repository.
Information about autolinks are only available to repository administrators.
Sourcepub async fn repos_delete_autolink(
&self,
owner: &str,
repo: &str,
autolink_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_autolink( &self, owner: &str, repo: &str, autolink_id: i64, ) -> Result<Response<Body>, ApiError>
Delete an autolink reference from a repository
This deletes a single autolink reference by ID that was configured for the given repository.
Information about autolinks are only available to repository administrators.
Sourcepub async fn repos_enable_automated_security_fixes(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_enable_automated_security_fixes( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Enable automated security fixes
Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see “Configuring automated security fixes”.
Sourcepub async fn repos_disable_automated_security_fixes(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_disable_automated_security_fixes( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Disable automated security fixes
Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see “Configuring automated security fixes”.
Sourcepub async fn repos_list_branches(
&self,
owner: &str,
repo: &str,
protected: Option<bool>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_branches( &self, owner: &str, repo: &str, protected: Option<bool>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List branches
Sourcepub async fn repos_get_branch(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_branch( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Get a branch
Sourcepub async fn repos_get_branch_protection(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_branch_protection( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Get branch protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Sourcepub async fn repos_update_branch_protection<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_update_branch_protection<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update branch protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Protecting a branch requires admin or owner permissions to the repository.
Note: Passing new arrays of users
and teams
replaces their previous values.
Note: The list of users, apps, and teams in total is limited to 100 items.
§Content
Sourcepub async fn repos_delete_branch_protection(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_branch_protection( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Delete branch protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Sourcepub async fn repos_get_admin_branch_protection(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_admin_branch_protection( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Get admin branch protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Sourcepub async fn repos_set_admin_branch_protection(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_set_admin_branch_protection( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Set admin branch protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.
Sourcepub async fn repos_delete_admin_branch_protection(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_admin_branch_protection( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Delete admin branch protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.
Sourcepub async fn repos_get_pull_request_review_protection(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_pull_request_review_protection( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Get pull request review protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Sourcepub async fn repos_delete_pull_request_review_protection(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_pull_request_review_protection( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Delete pull request review protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Sourcepub async fn repos_update_pull_request_review_protection<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_update_pull_request_review_protection<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update pull request review protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled.
Note: Passing new arrays of users
and teams
replaces their previous values.
§Content
Sourcepub async fn repos_get_commit_signature_protection(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_commit_signature_protection( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Get commit signature protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of true
indicates you must sign commits on this branch. For more information, see Signing commits with GPG in GitHub Help.
Note: You must enable branch protection to require signed commits.
Sourcepub async fn repos_create_commit_signature_protection(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_commit_signature_protection( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Create commit signature protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits.
Sourcepub async fn repos_delete_commit_signature_protection(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_commit_signature_protection( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Delete commit signature protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits.
Sourcepub async fn repos_get_status_checks_protection(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_status_checks_protection( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Get status checks protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Sourcepub async fn repos_remove_status_check_protection(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_remove_status_check_protection( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Remove status check protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Sourcepub async fn repos_update_status_check_protection<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_update_status_check_protection<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update status check protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled.
§Content
Sourcepub async fn repos_get_all_status_check_contexts(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_all_status_check_contexts( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Get all status check contexts
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Sourcepub async fn repos_set_status_check_contexts<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_set_status_check_contexts<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set status check contexts
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
§Content
Sourcepub async fn repos_add_status_check_contexts<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_add_status_check_contexts<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add status check contexts
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
§Content
Sourcepub async fn repos_remove_status_check_contexts<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_remove_status_check_contexts<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Remove status check contexts
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
§Content
Sourcepub async fn repos_get_access_restrictions(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_access_restrictions( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Get access restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Lists who has access to this protected branch.
Note: Users, apps, and teams restrictions
are only available for organization-owned repositories.
Sourcepub async fn repos_delete_access_restrictions(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_access_restrictions( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Delete access restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Disables the ability to restrict who can push to this branch.
Sourcepub async fn repos_get_apps_with_access_to_protected_branch(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_apps_with_access_to_protected_branch( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Get apps with access to the protected branch
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Lists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with write
access to the contents
permission can be added as authorized actors on a protected branch.
Sourcepub async fn repos_set_app_access_restrictions<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_set_app_access_restrictions<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set app access restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with write
access to the contents
permission can be added as authorized actors on a protected branch.
Type | Description |
---|---|
array | The GitHub Apps that have push access to this branch. Use the app’s slug . Note: The list of users, apps, and teams in total is limited to 100 items. |
§Content
Sourcepub async fn repos_add_app_access_restrictions<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_add_app_access_restrictions<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add app access restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Grants the specified apps push access for this branch. Only installed GitHub Apps with write
access to the contents
permission can be added as authorized actors on a protected branch.
Type | Description |
---|---|
array | The GitHub Apps that have push access to this branch. Use the app’s slug . Note: The list of users, apps, and teams in total is limited to 100 items. |
§Content
Sourcepub async fn repos_remove_app_access_restrictions<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_remove_app_access_restrictions<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Remove app access restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Removes the ability of an app to push to this branch. Only installed GitHub Apps with write
access to the contents
permission can be added as authorized actors on a protected branch.
Type | Description |
---|---|
array | The GitHub Apps that have push access to this branch. Use the app’s slug . Note: The list of users, apps, and teams in total is limited to 100 items. |
§Content
Sourcepub async fn repos_get_teams_with_access_to_protected_branch(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_teams_with_access_to_protected_branch( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Get teams with access to the protected branch
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Lists the teams who have push access to this branch. The list includes child teams.
Sourcepub async fn repos_set_team_access_restrictions<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_set_team_access_restrictions<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set team access restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams.
Type | Description |
---|---|
array | The teams that can have push access. Use the team’s slug . Note: The list of users, apps, and teams in total is limited to 100 items. |
§Content
Sourcepub async fn repos_add_team_access_restrictions<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_add_team_access_restrictions<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add team access restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Grants the specified teams push access for this branch. You can also give push access to child teams.
Type | Description |
---|---|
array | The teams that can have push access. Use the team’s slug . Note: The list of users, apps, and teams in total is limited to 100 items. |
§Content
Sourcepub async fn repos_remove_team_access_restrictions<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_remove_team_access_restrictions<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Remove team access restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Removes the ability of a team to push to this branch. You can also remove push access for child teams.
Type | Description |
---|---|
array | Teams that should no longer have push access. Use the team’s slug . Note: The list of users, apps, and teams in total is limited to 100 items. |
§Content
Sourcepub async fn repos_get_users_with_access_to_protected_branch(
&self,
owner: &str,
repo: &str,
branch: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_users_with_access_to_protected_branch( &self, owner: &str, repo: &str, branch: &str, ) -> Result<Response<Body>, ApiError>
Get users with access to the protected branch
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Lists the people who have push access to this branch.
Sourcepub async fn repos_set_user_access_restrictions<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_set_user_access_restrictions<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set user access restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people.
Type | Description |
---|---|
array | Usernames for people who can have push access. Note: The list of users, apps, and teams in total is limited to 100 items. |
§Content
Sourcepub async fn repos_add_user_access_restrictions<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_add_user_access_restrictions<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add user access restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Grants the specified people push access for this branch.
Type | Description |
---|---|
array | Usernames for people who can have push access. Note: The list of users, apps, and teams in total is limited to 100 items. |
§Content
Sourcepub async fn repos_remove_user_access_restrictions<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_remove_user_access_restrictions<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Remove user access restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Removes the ability of a user to push to this branch.
Type | Description |
---|---|
array | Usernames of the people who should no longer have push access. Note: The list of users, apps, and teams in total is limited to 100 items. |
§Content
Sourcepub async fn repos_rename_branch<Content>(
&self,
owner: &str,
repo: &str,
branch: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_rename_branch<Content>( &self, owner: &str, repo: &str, branch: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Rename a branch
Renames a branch in a repository.
Note: Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won’t be able to push to the old branch name while the rename process is in progress. For more information, see “Renaming a branch”.
The permissions required to use this endpoint depends on whether you are renaming the default branch.
To rename a non-default branch:
- Users must have push access.
- GitHub Apps must have the
contents:write
repository permission.
To rename the default branch:
- Users must have admin or owner permissions.
- GitHub Apps must have the
administration:write
repository permission.
§Content
Sourcepub async fn checks_create<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn checks_create<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a check run
Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests
array.
Creates a new check run for a specific commit in a repository. Your GitHub App must have the checks:write
permission to create check runs.
In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs.
§Content
Sourcepub async fn checks_get(
&self,
owner: &str,
repo: &str,
check_run_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn checks_get( &self, owner: &str, repo: &str, check_run_id: i64, ) -> Result<Response<Body>, ApiError>
Get a check run
Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests
array.
Gets a single check run using its id
. GitHub Apps must have the checks:read
permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the repo
scope to get check runs in a private repository.
Sourcepub async fn checks_update<Content>(
&self,
owner: &str,
repo: &str,
check_run_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn checks_update<Content>( &self, owner: &str, repo: &str, check_run_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a check run
Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests
array.
Updates a check run for a specific commit in a repository. Your GitHub App must have the checks:write
permission to edit check runs.
§Content
Sourcepub async fn checks_list_annotations(
&self,
owner: &str,
repo: &str,
check_run_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn checks_list_annotations( &self, owner: &str, repo: &str, check_run_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List check run annotations
Lists annotations for a check run using the annotation id
. GitHub Apps must have the checks:read
permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the repo
scope to get annotations for a check run in a private repository.
Sourcepub async fn checks_rerequest_run(
&self,
owner: &str,
repo: &str,
check_run_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn checks_rerequest_run( &self, owner: &str, repo: &str, check_run_id: i64, ) -> Result<Response<Body>, ApiError>
Rerequest a check run
Triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the check_run
webhook event with the action rerequested
. When a check run is rerequested
, its status
is reset to queued
and the conclusion
is cleared.
To rerequest a check run, your GitHub App must have the checks:read
permission on a private repository or pull access to a public repository.
Sourcepub async fn checks_create_suite<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn checks_create_suite<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a check suite
Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests
array and a null
value for head_branch
.
By default, check suites are automatically created when you create a check run. You only need to use this endpoint for manually creating check suites when you’ve disabled automatic creation using “Update repository preferences for check suites”. Your GitHub App must have the checks:write
permission to create check suites.
§Content
Sourcepub async fn checks_set_suites_preferences<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn checks_set_suites_preferences<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update repository preferences for check suites
Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually Create a check suite. You must have admin permissions in the repository to set preferences for check suites.
§Content
Sourcepub async fn checks_get_suite(
&self,
owner: &str,
repo: &str,
check_suite_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn checks_get_suite( &self, owner: &str, repo: &str, check_suite_id: i64, ) -> Result<Response<Body>, ApiError>
Get a check suite
Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests
array and a null
value for head_branch
.
Gets a single check suite using its id
. GitHub Apps must have the checks:read
permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the repo
scope to get check suites in a private repository.
Sourcepub async fn checks_list_for_suite(
&self,
owner: &str,
repo: &str,
check_suite_id: i64,
check_name: Option<&str>,
status: Option<&str>,
filter: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn checks_list_for_suite( &self, owner: &str, repo: &str, check_suite_id: i64, check_name: Option<&str>, status: Option<&str>, filter: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List check runs in a check suite
Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests
array.
Lists check runs for a check suite using its id
. GitHub Apps must have the checks:read
permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the repo
scope to get check runs in a private repository.
Sourcepub async fn checks_rerequest_suite(
&self,
owner: &str,
repo: &str,
check_suite_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn checks_rerequest_suite( &self, owner: &str, repo: &str, check_suite_id: i64, ) -> Result<Response<Body>, ApiError>
Rerequest a check suite
Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the check_suite
webhook event with the action rerequested
. When a check suite is rerequested
, its status
is reset to queued
and the conclusion
is cleared.
To rerequest a check suite, your GitHub App must have the checks:read
permission on a private repository or pull access to a public repository.
Sourcepub async fn code_scanning_list_alerts_for_repo(
&self,
owner: &str,
repo: &str,
tool_name: Option<&str>,
tool_guid: Option<Option<&str>>,
page: Option<i64>,
per_page: Option<i64>,
ref: Option<&str>,
sort: &Sort<'_>,
state: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn code_scanning_list_alerts_for_repo( &self, owner: &str, repo: &str, tool_name: Option<&str>, tool_guid: Option<Option<&str>>, page: Option<i64>, per_page: Option<i64>, ref: Option<&str>, sort: &Sort<'_>, state: Option<&str>, ) -> Result<Response<Body>, ApiError>
List code scanning alerts for a repository
Lists all open code scanning alerts for the default branch (usually main
or master
). You must use an access token with the security_events
scope to use
this endpoint with private repos, the public_repo
scope also grants permission to read
security events on public repos only. GitHub Apps must have the security_events
read
permission to use this endpoint.
The response includes a most_recent_instance
object.
This provides details of the most recent instance of this alert
for the default branch or for the specified Git reference
(if you used ref
in the request).
Sourcepub async fn code_scanning_get_alert(
&self,
owner: &str,
repo: &str,
alert_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn code_scanning_get_alert( &self, owner: &str, repo: &str, alert_number: i64, ) -> Result<Response<Body>, ApiError>
Get a code scanning alert
Gets a single code scanning alert. You must use an access token with the security_events
scope to use this endpoint with private repos, the public_repo
scope also grants permission to read security events on public repos only. GitHub Apps must have the security_events
read permission to use this endpoint.
Deprecation notice:
The instances field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The same information can now be retrieved via a GET request to the URL specified by instances_url
.
Sourcepub async fn code_scanning_update_alert<Content>(
&self,
owner: &str,
repo: &str,
alert_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn code_scanning_update_alert<Content>( &self, owner: &str, repo: &str, alert_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a code scanning alert
Updates the status of a single code scanning alert. You must use an access token with the security_events
scope to use this endpoint with private repositories. You can also use tokens with the public_repo
scope for public repositories only. GitHub Apps must have the security_events
write permission to use this endpoint.
§Content
Sourcepub async fn code_scanning_list_alert_instances(
&self,
owner: &str,
repo: &str,
alert_number: i64,
page: Option<i64>,
per_page: Option<i64>,
ref: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn code_scanning_list_alert_instances( &self, owner: &str, repo: &str, alert_number: i64, page: Option<i64>, per_page: Option<i64>, ref: Option<&str>, ) -> Result<Response<Body>, ApiError>
List instances of a code scanning alert
Lists all instances of the specified code scanning alert.
You must use an access token with the security_events
scope to use this endpoint with private repos,
the public_repo
scope also grants permission to read security events on public repos only.
GitHub Apps must have the security_events
read permission to use this endpoint.
Sourcepub async fn code_scanning_list_recent_analyses(
&self,
owner: &str,
repo: &str,
tool_name: Option<&str>,
tool_guid: Option<Option<&str>>,
page: Option<i64>,
per_page: Option<i64>,
ref: Option<&str>,
sarif_id: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn code_scanning_list_recent_analyses( &self, owner: &str, repo: &str, tool_name: Option<&str>, tool_guid: Option<Option<&str>>, page: Option<i64>, per_page: Option<i64>, ref: Option<&str>, sarif_id: Option<&str>, ) -> Result<Response<Body>, ApiError>
List code scanning analyses for a repository
Lists the details of all code scanning analyses for a repository,
starting with the most recent.
The response is paginated and you can use the page
and per_page
parameters
to list the analyses you’re interested in.
By default 30 analyses are listed per page.
The rules_count
field in the response give the number of rules
that were run in the analysis.
For very old analyses this data is not available,
and 0
is returned in this field.
You must use an access token with the security_events
scope to use this endpoint with private repos,
the public_repo
scope also grants permission to read security events on public repos only.
GitHub Apps must have the security_events
read permission to use this endpoint.
Deprecation notice:
The tool_name
field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the tool
field.
Sourcepub async fn code_scanning_get_analysis(
&self,
owner: &str,
repo: &str,
analysis_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn code_scanning_get_analysis( &self, owner: &str, repo: &str, analysis_id: i64, ) -> Result<Response<Body>, ApiError>
Get a code scanning analysis for a repository
Gets a specified code scanning analysis for a repository.
You must use an access token with the security_events
scope to use this endpoint with private repos,
the public_repo
scope also grants permission to read security events on public repos only.
GitHub Apps must have the security_events
read permission to use this endpoint.
The default JSON response contains fields that describe the analysis. This includes the Git reference and commit SHA to which the analysis relates, the datetime of the analysis, the name of the code scanning tool, and the number of alerts.
The rules_count
field in the default response give the number of rules
that were run in the analysis.
For very old analyses this data is not available,
and 0
is returned in this field.
If you use the Accept header application/sarif+json
,
the response contains the analysis data that was uploaded.
This is formatted as
SARIF version 2.1.0.
Sourcepub async fn code_scanning_delete_analysis(
&self,
owner: &str,
repo: &str,
analysis_id: i64,
confirm_delete: Option<Option<&str>>,
) -> Result<Response<Body>, ApiError>
pub async fn code_scanning_delete_analysis( &self, owner: &str, repo: &str, analysis_id: i64, confirm_delete: Option<Option<&str>>, ) -> Result<Response<Body>, ApiError>
Delete a code scanning analysis from a repository
Deletes a specified code scanning analysis from a repository. For
private repositories, you must use an access token with the repo
scope. For public repositories,
you must use an access token with public_repo
scope.
GitHub Apps must have the security_events
write permission to use this endpoint.
You can delete one analysis at a time. To delete a series of analyses, start with the most recent analysis and work backwards. Conceptually, the process is similar to the undo function in a text editor.
When you list the analyses for a repository, one or more will be identified as deletable in the response:
"deletable": true
An analysis is deletable when it’s the most recent in a set of analyses. Typically, a repository will have multiple sets of analyses for each enabled code scanning tool, where a set is determined by a unique combination of analysis values:
ref
tool
analysis_key
environment
If you attempt to delete an analysis that is not the most recent in a set, you’ll get a 400 response with the message:
Analysis specified is not deletable.
The response from a successful DELETE
operation provides you with
two alternative URLs for deleting the next analysis in the set:
next_analysis_url
and confirm_delete_url
.
Use the next_analysis_url
URL if you want to avoid accidentally deleting the final analysis
in a set. This is a useful option if you want to preserve at least one analysis
for the specified tool in your repository.
Use the confirm_delete_url
URL if you are content to remove all analyses for a tool.
When you delete the last analysis in a set, the value of next_analysis_url
and confirm_delete_url
in the 200 response is null
.
As an example of the deletion process, let’s imagine that you added a workflow that configured a particular code scanning tool to analyze the code in a repository. This tool has added 15 analyses: 10 on the default branch, and another 5 on a topic branch. You therefore have two separate sets of analyses for this tool. You’ve now decided that you want to remove all of the analyses for the tool. To do this you must make 15 separate deletion requests. To start, you must find an analysis that’s identified as deletable. Each set of analyses always has one that’s identified as deletable. Having found the deletable analysis for one of the two sets, delete this analysis and then continue deleting the next analysis in the set until they’re all deleted. Then repeat the process for the second set. The procedure therefore consists of a nested loop:
Outer loop:
-
List the analyses for the repository, filtered by tool.
-
Parse this list to find a deletable analysis. If found:
Inner loop:
- Delete the identified analysis.
- Parse the response for the value of
confirm_delete_url
and, if found, use this in the next iteration.
The above process assumes that you want to remove all trace of the tool’s analyses from the GitHub user interface, for the specified repository, and it therefore uses the confirm_delete_url
value. Alternatively, you could use the next_analysis_url
value, which would leave the last analysis in each set undeleted to avoid removing a tool’s analysis entirely.
Sourcepub async fn code_scanning_upload_sarif<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn code_scanning_upload_sarif<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Upload an analysis as SARIF data
Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the security_events
scope to use this endpoint for private repositories. You can also use tokens with the public_repo
scope for public repositories only. GitHub Apps must have the security_events
write permission to use this endpoint.
There are two places where you can upload code scanning results.
- If you upload to a pull request, for example
--ref refs/pull/42/merge
or--ref refs/pull/42/head
, then the results appear as alerts in a pull request check. For more information, see “Triaging code scanning alerts in pull requests.” - If you upload to a branch, for example
--ref refs/heads/my-branch
, then the results appear in the Security tab for your repository. For more information, see “Managing code scanning alerts for your repository.”
You must compress the SARIF-formatted analysis data that you want to upload, using gzip
, and then encode it as a Base64 format string. For example:
gzip -c analysis-data.sarif | base64 -w0
SARIF upload supports a maximum of 5000 results per analysis run. Any results over this limit are ignored and any SARIF uploads with more than 25,000 results are rejected. Typically, but not necessarily, a SARIF file contains a single run of a single tool. If a code scanning tool generates too many results, you should update the analysis configuration to run only the most important rules or queries.
The 202 Accepted
, response includes an id
value.
You can use this ID to check the status of the upload by using this for the /sarifs/{sarif_id}
endpoint.
For more information, see “Get information about a SARIF upload.”
§Content
Sourcepub async fn code_scanning_get_sarif(
&self,
owner: &str,
repo: &str,
sarif_id: &str,
) -> Result<Response<Body>, ApiError>
pub async fn code_scanning_get_sarif( &self, owner: &str, repo: &str, sarif_id: &str, ) -> Result<Response<Body>, ApiError>
Get information about a SARIF upload
Gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see “Get a code scanning analysis for a repository.” You must use an access token with the security_events
scope to use this endpoint with private repos, the public_repo
scope also grants permission to read security events on public repos only. GitHub Apps must have the security_events
read permission to use this endpoint.
Sourcepub async fn repos_codeowners_errors(
&self,
owner: &str,
repo: &str,
ref: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_codeowners_errors( &self, owner: &str, repo: &str, ref: Option<&str>, ) -> Result<Response<Body>, ApiError>
List CODEOWNERS errors
List any syntax errors that are detected in the CODEOWNERS file.
For more information about the correct CODEOWNERS syntax, see “About code owners.”
Sourcepub async fn codespaces_list_in_repository_for_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_list_in_repository_for_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
List codespaces in a repository for the authenticated user
Lists the codespaces associated to a specified repository and the authenticated user.
You must authenticate using an access token with the codespace
scope to use this endpoint.
GitHub Apps must have read access to the codespaces
repository permission to use this endpoint.
Sourcepub async fn codespaces_create_with_repo_for_authenticated_user<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_create_with_repo_for_authenticated_user<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a codespace in a repository
Creates a codespace owned by the authenticated user in the specified repository.
You must authenticate using an access token with the codespace
scope to use this endpoint.
GitHub Apps must have write access to the codespaces
repository permission to use this endpoint.
§Content
Sourcepub async fn codespaces_repo_machines_for_authenticated_user(
&self,
owner: &str,
repo: &str,
location: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_repo_machines_for_authenticated_user( &self, owner: &str, repo: &str, location: Option<&str>, ) -> Result<Response<Body>, ApiError>
List available machine types for a repository
List the machine types available for a given repository based on its configuration.
You must authenticate using an access token with the codespace
scope to use this endpoint.
GitHub Apps must have write access to the codespaces_metadata
repository permission to use this endpoint.
Sourcepub async fn codespaces_list_repo_secrets(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_list_repo_secrets( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repository secrets
Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the codespaces_secrets
repository permission to use this endpoint.
Sourcepub async fn codespaces_get_repo_public_key(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_get_repo_public_key( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get a repository public key
Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the codespaces_secrets
repository permission to use this endpoint.
Sourcepub async fn codespaces_get_repo_secret(
&self,
owner: &str,
repo: &str,
secret_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_get_repo_secret( &self, owner: &str, repo: &str, secret_name: &str, ) -> Result<Response<Body>, ApiError>
Get a repository secret
Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the codespaces_secrets
repository permission to use this endpoint.
Sourcepub async fn codespaces_create_or_update_repo_secret<Content>(
&self,
owner: &str,
repo: &str,
secret_name: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_create_or_update_repo_secret<Content>( &self, owner: &str, repo: &str, secret_name: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create or update a repository secret
Creates or updates a repository secret with an encrypted value. Encrypt your secret using
LibSodium. You must authenticate using an access
token with the repo
scope to use this endpoint. GitHub Apps must have the codespaces_secrets
repository
permission to use this endpoint.
§Example of encrypting a secret using Node.js
Encrypt your secret using the tweetsodium library.
const sodium = require('tweetsodium');
const key = "base64-encoded-public-key";
const value = "plain-text-secret";
// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
console.log(encrypted);
§Example of encrypting a secret using Python
Encrypt your secret using pynacl with Python 3.
from base64 import b64encode
from nacl import encoding, public
def encrypt(public_key: str, secret_value: str) -> str:
"""Encrypt a Unicode string using the public key."""
public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
sealed_box = public.SealedBox(public_key)
encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
return b64encode(encrypted).decode("utf-8")
§Example of encrypting a secret using C#
Encrypt your secret using the Sodium.Core package.
var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));
§Example of encrypting a secret using Ruby
Encrypt your secret using the rbnacl gem.
require "rbnacl"
require "base64"
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")
# Print the base64 encoded secret
puts Base64.strict_encode64(encrypted_secret)
§Content
Sourcepub async fn codespaces_delete_repo_secret(
&self,
owner: &str,
repo: &str,
secret_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_delete_repo_secret( &self, owner: &str, repo: &str, secret_name: &str, ) -> Result<Response<Body>, ApiError>
Delete a repository secret
Deletes a secret in a repository using the secret name. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the codespaces_secrets
repository permission to use this endpoint.
Sourcepub async fn repos_list_collaborators(
&self,
owner: &str,
repo: &str,
affiliation: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_collaborators( &self, owner: &str, repo: &str, affiliation: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repository collaborators
For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint.
Team members will include the members of child teams.
You must authenticate using an access token with the read:org
and repo
scopes with push access to use this
endpoint. GitHub Apps must have the members
organization permission and metadata
repository permission to use this
endpoint.
Sourcepub async fn repos_check_collaborator(
&self,
owner: &str,
repo: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_check_collaborator( &self, owner: &str, repo: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Check if a user is a repository collaborator
For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.
Team members will include the members of child teams.
You must authenticate using an access token with the read:org
and repo
scopes with push access to use this
endpoint. GitHub Apps must have the members
organization permission and metadata
repository permission to use this
endpoint.
Sourcepub async fn repos_add_collaborator<Content>(
&self,
owner: &str,
repo: &str,
username: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_add_collaborator<Content>( &self, owner: &str, repo: &str, username: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add a repository collaborator
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
Adding an outside collaborator may be restricted by enterprise administrators. For more information, see “Enforcing repository management policies in your enterprise.”
For more information on permission levels, see “Repository permission levels for an organization”. There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with:
Cannot assign {member} permission of {role name}
Note that, if you choose not to pass any parameters, you’ll need to set Content-Length
to zero when calling out to this endpoint. For more information, see “HTTP verbs.”
The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the repository invitations API endpoints.
Updating an existing collaborator’s permission level
The endpoint can also be used to change the permissions of an existing collaborator without first removing and re-adding the collaborator. To change the permissions, use the same endpoint and pass a different permission
parameter. The response will be a 204
, with no other indication that the permission level changed.
Rate limits
You are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository.
§Content
Sourcepub async fn repos_remove_collaborator(
&self,
owner: &str,
repo: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_remove_collaborator( &self, owner: &str, repo: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Remove a repository collaborator
Sourcepub async fn repos_get_collaborator_permission_level(
&self,
owner: &str,
repo: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_collaborator_permission_level( &self, owner: &str, repo: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Get repository permissions for a user
Checks the repository permission of a collaborator. The possible repository permissions are admin
, write
, read
, and none
.
Sourcepub async fn repos_list_commit_comments_for_repo(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_commit_comments_for_repo( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List commit comments for a repository
Commit Comments use these custom media types. You can read more about the use of media types in the API here.
Comments are ordered by ascending ID.
Sourcepub async fn repos_get_commit_comment(
&self,
owner: &str,
repo: &str,
comment_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_commit_comment( &self, owner: &str, repo: &str, comment_id: i64, ) -> Result<Response<Body>, ApiError>
Get a commit comment
Sourcepub async fn repos_delete_commit_comment(
&self,
owner: &str,
repo: &str,
comment_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_commit_comment( &self, owner: &str, repo: &str, comment_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a commit comment
Sourcepub async fn repos_update_commit_comment<Content>(
&self,
owner: &str,
repo: &str,
comment_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_update_commit_comment<Content>( &self, owner: &str, repo: &str, comment_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a commit comment
§Content
Sourcepub async fn reactions_list_for_commit_comment(
&self,
owner: &str,
repo: &str,
comment_id: i64,
content: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_list_for_commit_comment( &self, owner: &str, repo: &str, comment_id: i64, content: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List reactions for a commit comment
List the reactions to a commit comment.
Sourcepub async fn reactions_create_for_commit_comment<Content>(
&self,
owner: &str,
repo: &str,
comment_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_create_for_commit_comment<Content>( &self, owner: &str, repo: &str, comment_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create reaction for a commit comment
Create a reaction to a commit comment. A response with an HTTP 200
status means that you already added the reaction type to this commit comment.
§Content
Sourcepub async fn reactions_delete_for_commit_comment(
&self,
owner: &str,
repo: &str,
comment_id: i64,
reaction_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_delete_for_commit_comment( &self, owner: &str, repo: &str, comment_id: i64, reaction_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a commit comment reaction
Note: You can also specify a repository by repository_id
using the route DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id
.
Delete a reaction to a commit comment.
Sourcepub async fn repos_list_commits(
&self,
owner: &str,
repo: &str,
sha: Option<&str>,
path: Option<&str>,
author: Option<&str>,
since: Option<&str>,
until: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_commits( &self, owner: &str, repo: &str, sha: Option<&str>, path: Option<&str>, author: Option<&str>, since: Option<&str>, until: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List commits
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user’s account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
Sourcepub async fn repos_list_branches_for_head_commit(
&self,
owner: &str,
repo: &str,
commit_sha: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_branches_for_head_commit( &self, owner: &str, repo: &str, commit_sha: &str, ) -> Result<Response<Body>, ApiError>
List branches for HEAD commit
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch.
Sourcepub async fn repos_list_comments_for_commit(
&self,
owner: &str,
repo: &str,
commit_sha: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_comments_for_commit( &self, owner: &str, repo: &str, commit_sha: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List commit comments
Use the :commit_sha
to specify the commit that will have its comments listed.
Sourcepub async fn repos_create_commit_comment<Content>(
&self,
owner: &str,
repo: &str,
commit_sha: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_commit_comment<Content>( &self, owner: &str, repo: &str, commit_sha: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a commit comment
Create a comment for a commit using its :commit_sha
.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
§Content
Sourcepub async fn repos_list_pull_requests_associated_with_commit(
&self,
owner: &str,
repo: &str,
commit_sha: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_pull_requests_associated_with_commit( &self, owner: &str, repo: &str, commit_sha: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List pull requests associated with a commit
Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, additionally returns open pull requests associated with the commit. The results may include open and closed pull requests.
Sourcepub async fn repos_get_commit(
&self,
owner: &str,
repo: &str,
page: Option<i64>,
per_page: Option<i64>,
ref: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_commit( &self, owner: &str, repo: &str, page: Option<i64>, per_page: Option<i64>, ref: &str, ) -> Result<Response<Body>, ApiError>
Get a commit
Returns the contents of a single commit reference. You must have read
access for the repository to use this endpoint.
Note: If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.
You can pass the appropriate media type to fetch diff
and patch
formats. Diffs with binary data will have no patch
property.
To return only the SHA-1 hash of the commit reference, you can provide the sha
custom media type in the Accept
header. You can use this endpoint to check if a remote reference’s SHA-1 hash is the same as your local reference’s SHA-1 hash by providing the local SHA-1 reference as the ETag.
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user’s account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
Sourcepub async fn checks_list_for_ref(
&self,
owner: &str,
repo: &str,
ref: &str,
check_name: Option<&str>,
status: Option<&str>,
filter: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
app_id: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn checks_list_for_ref( &self, owner: &str, repo: &str, ref: &str, check_name: Option<&str>, status: Option<&str>, filter: Option<&str>, per_page: Option<i64>, page: Option<i64>, app_id: Option<i64>, ) -> Result<Response<Body>, ApiError>
List check runs for a Git reference
Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests
array.
Lists check runs for a commit ref. The ref
can be a SHA, branch name, or a tag name. GitHub Apps must have the checks:read
permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the repo
scope to get check runs in a private repository.
Sourcepub async fn checks_list_suites_for_ref(
&self,
owner: &str,
repo: &str,
ref: &str,
app_id: Option<i64>,
check_name: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn checks_list_suites_for_ref( &self, owner: &str, repo: &str, ref: &str, app_id: Option<i64>, check_name: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List check suites for a Git reference
Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests
array and a null
value for head_branch
.
Lists check suites for a commit ref
. The ref
can be a SHA, branch name, or a tag name. GitHub Apps must have the checks:read
permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the repo
scope to get check suites in a private repository.
Sourcepub async fn repos_get_combined_status_for_ref(
&self,
owner: &str,
repo: &str,
ref: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_combined_status_for_ref( &self, owner: &str, repo: &str, ref: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Get the combined status for a specific reference
Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name.
Additionally, a combined state
is returned. The state
is one of:
- failure if any of the contexts report as
error
orfailure
- pending if there are no statuses or a context is
pending
- success if the latest status for all contexts is
success
Sourcepub async fn repos_list_commit_statuses_for_ref(
&self,
owner: &str,
repo: &str,
ref: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_commit_statuses_for_ref( &self, owner: &str, repo: &str, ref: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List commit statuses for a reference
Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.
This resource is also available via a legacy route: GET /repos/:owner/:repo/statuses/:ref
.
Sourcepub async fn repos_get_community_profile_metrics(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_community_profile_metrics( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get community profile metrics
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.
The health_percentage
score is defined as a percentage of how many of
these four documents are present: README, CONTRIBUTING, LICENSE, and
CODE_OF_CONDUCT. For example, if all four documents are present, then
the health_percentage
is 100
. If only one is present, then the
health_percentage
is 25
.
content_reports_enabled
is only returned for organization-owned repositories.
Sourcepub async fn repos_compare_commits(
&self,
owner: &str,
repo: &str,
page: Option<i64>,
per_page: Option<i64>,
basehead: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_compare_commits( &self, owner: &str, repo: &str, page: Option<i64>, per_page: Option<i64>, basehead: &str, ) -> Result<Response<Body>, ApiError>
Compare two commits
The basehead
param is comprised of two parts: base
and head
. Both must be branch names in repo
. To compare branches across other repositories in the same network as repo
, use the format <USERNAME>:branch
.
The response from the API is equivalent to running the git log base..head
command; however, commits are returned in chronological order. Pass the appropriate media type to fetch diff and patch formats.
The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a renamed
status have a previous_filename
field showing the previous filename of the file, and files with a modified
status have a patch
field showing the changes made to the file.
Working with large comparisons
To process a response with a large number of commits, you can use (per_page
or page
) to paginate the results. When using paging, the list of changed files is only returned with page 1, but includes all changed files for the entire comparison. For more information on working with pagination, see “Traversing with pagination.”
When calling this API without any paging parameters (per_page
or page
), the returned list is limited to 250 commits and the last commit in the list is the most recent of the entire comparison. When a paging parameter is specified, the first commit in the returned list of each page is the earliest.
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user’s account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
Sourcepub async fn repos_get_content(
&self,
owner: &str,
repo: &str,
path: &str,
ref: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_content( &self, owner: &str, repo: &str, path: &str, ref: Option<&str>, ) -> Result<Response<Body>, ApiError>
Get repository content
Gets the contents of a file or directory in a repository. Specify the file path or directory in :path
. If you omit
:path
, you will receive the contents of the repository’s root directory. See the description below regarding what the API response includes for directories.
Files and symlinks support a custom media type for retrieving the raw content or rendered HTML (when supported). All content types support a custom media type to ensure the content is returned in a consistent object format.
Note:
- To get a repository’s contents recursively, you can recursively get the tree.
- This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the Git Trees API.
- This API supports files up to 1 megabyte in size.
§If the content is a directory
The response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their “type” specified as “file”. Logically, the value should be “submodule”. This behavior exists in API v3 for backwards compatibility purposes. In the next major version of the API, the type will be returned as “submodule”.
§If the content is a symlink
If the requested :path
points to a symlink, and the symlink’s target is a normal file in the repository, then the
API responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object
describing the symlink itself.
§If the content is a submodule
The submodule_git_url
identifies the location of the submodule repository, and the sha
identifies a specific
commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out
the submodule at that specific commit.
If the submodule repository is not hosted on github.com, the Git URLs (git_url
and _links["git"]
) and the
github.com URLs (html_url
and _links["html"]
) will have null values.
Sourcepub async fn repos_create_or_update_file_contents<Content>(
&self,
owner: &str,
repo: &str,
path: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_or_update_file_contents<Content>( &self, owner: &str, repo: &str, path: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create or update file contents
Creates a new file or replaces an existing file in a repository.
§Content
Sourcepub async fn repos_delete_file<Content>(
&self,
owner: &str,
repo: &str,
path: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_file<Content>( &self, owner: &str, repo: &str, path: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Delete a file
Deletes a file in a repository.
You can provide an additional committer
parameter, which is an object containing information about the committer. Or, you can provide an author
parameter, which is an object containing information about the author.
The author
section is optional and is filled in with the committer
information if omitted. If the committer
information is omitted, the authenticated user’s information is used.
You must provide values for both name
and email
, whether you choose to use author
or committer
. Otherwise, you’ll receive a 422
status code.
§Content
Sourcepub async fn repos_list_contributors(
&self,
owner: &str,
repo: &str,
anon: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_contributors( &self, owner: &str, repo: &str, anon: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repository contributors
Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API v3 caches contributor data to improve performance.
GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information.
Sourcepub async fn dependabot_list_repo_secrets(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn dependabot_list_repo_secrets( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repository secrets
Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the dependabot_secrets
repository permission to use this endpoint.
Sourcepub async fn dependabot_get_repo_public_key(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn dependabot_get_repo_public_key( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get a repository public key
Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the dependabot_secrets
repository permission to use this endpoint.
Sourcepub async fn dependabot_get_repo_secret(
&self,
owner: &str,
repo: &str,
secret_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn dependabot_get_repo_secret( &self, owner: &str, repo: &str, secret_name: &str, ) -> Result<Response<Body>, ApiError>
Get a repository secret
Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the dependabot_secrets
repository permission to use this endpoint.
Sourcepub async fn dependabot_create_or_update_repo_secret<Content>(
&self,
owner: &str,
repo: &str,
secret_name: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn dependabot_create_or_update_repo_secret<Content>( &self, owner: &str, repo: &str, secret_name: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create or update a repository secret
Creates or updates a repository secret with an encrypted value. Encrypt your secret using
LibSodium. You must authenticate using an access
token with the repo
scope to use this endpoint. GitHub Apps must have the dependabot_secrets
repository
permission to use this endpoint.
§Example encrypting a secret using Node.js
Encrypt your secret using the tweetsodium library.
const sodium = require('tweetsodium');
const key = "base64-encoded-public-key";
const value = "plain-text-secret";
// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
console.log(encrypted);
§Example encrypting a secret using Python
Encrypt your secret using pynacl with Python 3.
from base64 import b64encode
from nacl import encoding, public
def encrypt(public_key: str, secret_value: str) -> str:
"""Encrypt a Unicode string using the public key."""
public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
sealed_box = public.SealedBox(public_key)
encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
return b64encode(encrypted).decode("utf-8")
§Example encrypting a secret using C#
Encrypt your secret using the Sodium.Core package.
var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));
§Example encrypting a secret using Ruby
Encrypt your secret using the rbnacl gem.
require "rbnacl"
require "base64"
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")
# Print the base64 encoded secret
puts Base64.strict_encode64(encrypted_secret)
§Content
Sourcepub async fn dependabot_delete_repo_secret(
&self,
owner: &str,
repo: &str,
secret_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn dependabot_delete_repo_secret( &self, owner: &str, repo: &str, secret_name: &str, ) -> Result<Response<Body>, ApiError>
Delete a repository secret
Deletes a secret in a repository using the secret name. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the dependabot_secrets
repository permission to use this endpoint.
Sourcepub async fn dependency_graph_diff_range(
&self,
owner: &str,
repo: &str,
basehead: &str,
name: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn dependency_graph_diff_range( &self, owner: &str, repo: &str, basehead: &str, name: Option<&str>, ) -> Result<Response<Body>, ApiError>
Get a diff of the dependencies between commits
Gets the diff of the dependency changes between two commits of a repository, based on the changes to the dependency manifests made in those commits.
Sourcepub async fn repos_list_deployments(
&self,
owner: &str,
repo: &str,
sha: Option<&str>,
ref: Option<&str>,
task: Option<&str>,
environment: Option<Option<&str>>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_deployments( &self, owner: &str, repo: &str, sha: Option<&str>, ref: Option<&str>, task: Option<&str>, environment: Option<Option<&str>>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List deployments
Simple filtering of deployments is available via query parameters:
Sourcepub async fn repos_create_deployment<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_deployment<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a deployment
Deployments offer a few configurable parameters with certain defaults.
The ref
parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them
before we merge a pull request.
The environment
parameter allows deployments to be issued to different runtime environments. Teams often have
multiple environments for verifying their applications, such as production
, staging
, and qa
. This parameter
makes it easier to track which environments have requested deployments. The default environment is production
.
The auto_merge
parameter is used to ensure that the requested ref is not behind the repository’s default branch. If
the ref is behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,
the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will
return a failure response.
By default, commit statuses for every submitted context must be in a success
state. The required_contexts
parameter allows you to specify a subset of contexts that must be success
, or to
specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do
not require any contexts or create any commit statuses, the deployment will always succeed.
The payload
parameter is available for any extra information that a deployment system might need. It is a JSON text
field that will be passed on when a deployment event is dispatched.
The task
parameter is used by the deployment system to allow different execution paths. In the web world this might
be deploy:migrations
to run schema changes on the system. In the compiled world this could be a flag to compile an
application with debugging enabled.
Users with repo
or repo_deployment
scopes can create a deployment for a given ref.
§Merged branch response
You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating a deployment. This auto-merge happens when:
- Auto-merge option is enabled in the repository
- Topic branch does not include the latest changes on the base branch, which is
master
in the response example - There are no merge conflicts
If there are no new commits in the base branch, a new request to create a deployment should give a successful response.
§Merge conflict response
This error happens when the auto_merge
option is enabled and when the default branch (in this case master
), can’t
be merged into the branch that’s being deployed (in this case topic-branch
), due to merge conflicts.
§Failed commit status checks
This error happens when the required_contexts
parameter indicates that one or more contexts need to have a success
status for the commit to be deployed, but one or more of the required contexts do not have a state of success
.
§Content
Sourcepub async fn repos_get_deployment(
&self,
owner: &str,
repo: &str,
deployment_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_deployment( &self, owner: &str, repo: &str, deployment_id: i64, ) -> Result<Response<Body>, ApiError>
Get a deployment
Sourcepub async fn repos_delete_deployment(
&self,
owner: &str,
repo: &str,
deployment_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_deployment( &self, owner: &str, repo: &str, deployment_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a deployment
If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with repo
or repo_deployment
scopes can delete a deployment.
To set a deployment as inactive, you must:
- Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
- Mark the active deployment as inactive by adding any non-successful deployment status.
For more information, see “Create a deployment” and “Create a deployment status.”
Sourcepub async fn repos_list_deployment_statuses(
&self,
owner: &str,
repo: &str,
deployment_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_deployment_statuses( &self, owner: &str, repo: &str, deployment_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List deployment statuses
Users with pull access can view deployment statuses for a deployment:
Sourcepub async fn repos_create_deployment_status<Content>(
&self,
owner: &str,
repo: &str,
deployment_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_deployment_status<Content>( &self, owner: &str, repo: &str, deployment_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a deployment status
Users with push
access can create deployment statuses for a given deployment.
GitHub Apps require read & write
access to “Deployments” and read-only
access to “Repo contents” (for private repos). OAuth Apps require the repo_deployment
scope.
§Content
Sourcepub async fn repos_get_deployment_status(
&self,
owner: &str,
repo: &str,
deployment_id: i64,
status_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_deployment_status( &self, owner: &str, repo: &str, deployment_id: i64, status_id: i64, ) -> Result<Response<Body>, ApiError>
Get a deployment status
Users with pull access can view a deployment status for a deployment:
Sourcepub async fn repos_create_dispatch_event<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_dispatch_event<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a repository dispatch event
You can use this endpoint to trigger a webhook event called repository_dispatch
when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the repository_dispatch
event occurs. For an example repository_dispatch
webhook payload, see “RepositoryDispatchEvent.”
The client_payload
parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the client_payload
can include a message that a user would like to send using a GitHub Actions workflow. Or the client_payload
can be used as a test to debug your workflow.
This endpoint requires write access to the repository by providing either:
- Personal access tokens with
repo
scope. For more information, see “Creating a personal access token for the command line” in the GitHub Help documentation. - GitHub Apps with both
metadata:read
andcontents:read&write
permissions.
This input example shows how you can use the client_payload
as a test to debug your workflow.
§Content
Sourcepub async fn repos_get_all_environments(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_all_environments( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Get all environments
Get all environments for a repository.
Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn repos_get_environment(
&self,
owner: &str,
repo: &str,
environment_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_environment( &self, owner: &str, repo: &str, environment_name: &str, ) -> Result<Response<Body>, ApiError>
Get an environment
Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo
scope. GitHub Apps must have the actions:read
permission to use this endpoint.
Sourcepub async fn repos_create_or_update_environment<Content>(
&self,
owner: &str,
repo: &str,
environment_name: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_or_update_environment<Content>( &self, owner: &str, repo: &str, environment_name: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create or update an environment
Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see “Environments.”
Note: Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see “Environments.”
Note: To create or update secrets for an environment, see “Secrets.”
You must authenticate using an access token with the repo scope to use this endpoint.
§Content
Sourcepub async fn repos_delete_an_environment(
&self,
owner: &str,
repo: &str,
environment_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_an_environment( &self, owner: &str, repo: &str, environment_name: &str, ) -> Result<Response<Body>, ApiError>
Delete an environment
You must authenticate using an access token with the repo scope to use this endpoint.
Sourcepub async fn activity_list_repo_events(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_repo_events( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repository events
Sourcepub async fn repos_list_forks(
&self,
owner: &str,
repo: &str,
sort: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_forks( &self, owner: &str, repo: &str, sort: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List forks
Sourcepub async fn repos_create_fork<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_fork<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a fork
Create a fork for the authenticated user.
Note: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact GitHub Support.
§Content
Sourcepub async fn git_create_blob<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn git_create_blob<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn git_get_blob(
&self,
owner: &str,
repo: &str,
file_sha: &str,
) -> Result<Response<Body>, ApiError>
pub async fn git_get_blob( &self, owner: &str, repo: &str, file_sha: &str, ) -> Result<Response<Body>, ApiError>
Get a blob
The content
in the response will always be Base64 encoded.
Note: This API supports blobs up to 100 megabytes in size.
Sourcepub async fn git_create_commit<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn git_create_commit<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a commit
Creates a new Git commit object.
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in the table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user’s account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
§Content
Sourcepub async fn git_get_commit(
&self,
owner: &str,
repo: &str,
commit_sha: &str,
) -> Result<Response<Body>, ApiError>
pub async fn git_get_commit( &self, owner: &str, repo: &str, commit_sha: &str, ) -> Result<Response<Body>, ApiError>
Get a commit
Gets a Git commit object.
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in the table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user’s account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
Sourcepub async fn git_list_matching_refs(
&self,
owner: &str,
repo: &str,
ref: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn git_list_matching_refs( &self, owner: &str, repo: &str, ref: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List matching references
Returns an array of references from your Git database that match the supplied name. The :ref
in the URL must be formatted as heads/<branch name>
for branches and tags/<tag name>
for tags. If the :ref
doesn’t exist in the repository, but existing refs start with :ref
, they will be returned as an array.
When you use this endpoint without providing a :ref
, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just heads
and tags
.
Note: You need to explicitly request a pull request to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see “Checking mergeability of pull requests”.
If you request matching references for a branch named feature
but the branch feature
doesn’t exist, the response can still include other matching head refs that start with the word feature
, such as featureA
and featureB
.
Sourcepub async fn git_get_ref(
&self,
owner: &str,
repo: &str,
ref: &str,
) -> Result<Response<Body>, ApiError>
pub async fn git_get_ref( &self, owner: &str, repo: &str, ref: &str, ) -> Result<Response<Body>, ApiError>
Get a reference
Returns a single reference from your Git database. The :ref
in the URL must be formatted as heads/<branch name>
for branches and tags/<tag name>
for tags. If the :ref
doesn’t match an existing ref, a 404
is returned.
Note: You need to explicitly request a pull request to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see “Checking mergeability of pull requests”.
Sourcepub async fn git_create_ref<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn git_create_ref<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a reference
Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches.
§Content
Sourcepub async fn git_delete_ref(
&self,
owner: &str,
repo: &str,
ref: &str,
) -> Result<Response<Body>, ApiError>
pub async fn git_delete_ref( &self, owner: &str, repo: &str, ref: &str, ) -> Result<Response<Body>, ApiError>
Delete a reference
Sourcepub async fn git_update_ref<Content>(
&self,
owner: &str,
repo: &str,
ref: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn git_update_ref<Content>( &self, owner: &str, repo: &str, ref: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn git_create_tag<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn git_create_tag<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a tag object
Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then create the refs/tags/[tag]
reference. If you want to create a lightweight tag, you only have to create the tag reference - this call would be unnecessary.
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user’s account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
§Content
Sourcepub async fn git_get_tag(
&self,
owner: &str,
repo: &str,
tag_sha: &str,
) -> Result<Response<Body>, ApiError>
pub async fn git_get_tag( &self, owner: &str, repo: &str, tag_sha: &str, ) -> Result<Response<Body>, ApiError>
Get a tag
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user’s account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
Sourcepub async fn git_create_tree<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn git_create_tree<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a tree
The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure.
If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see “Create a commit” and “Update a reference.”
§Content
Sourcepub async fn git_get_tree(
&self,
owner: &str,
repo: &str,
tree_sha: &str,
recursive: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn git_get_tree( &self, owner: &str, repo: &str, tree_sha: &str, recursive: Option<&str>, ) -> Result<Response<Body>, ApiError>
Get a tree
Returns a single tree using the SHA1 value for that tree.
If truncated
is true
in the response then the number of items in the tree
array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.
Sourcepub async fn repos_list_webhooks(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_webhooks( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repository webhooks
Sourcepub async fn repos_create_webhook<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_webhook<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a repository webhook
Repositories can have multiple webhooks installed. Each webhook should have a unique config
. Multiple webhooks can
share the same config
as long as those webhooks do not have any events
that overlap.
§Content
Sourcepub async fn repos_get_webhook(
&self,
owner: &str,
repo: &str,
hook_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_webhook( &self, owner: &str, repo: &str, hook_id: i64, ) -> Result<Response<Body>, ApiError>
Get a repository webhook
Returns a webhook configured in a repository. To get only the webhook config
properties, see “Get a webhook configuration for a repository.”
Sourcepub async fn repos_delete_webhook(
&self,
owner: &str,
repo: &str,
hook_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_webhook( &self, owner: &str, repo: &str, hook_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a repository webhook
Sourcepub async fn repos_update_webhook<Content>(
&self,
owner: &str,
repo: &str,
hook_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_update_webhook<Content>( &self, owner: &str, repo: &str, hook_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a repository webhook
Updates a webhook configured in a repository. If you previously had a secret
set, you must provide the same secret
or set a new secret
or the secret will be removed. If you are only updating individual webhook config
properties, use “Update a webhook configuration for a repository.”
§Content
Sourcepub async fn repos_get_webhook_config_for_repo(
&self,
owner: &str,
repo: &str,
hook_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_webhook_config_for_repo( &self, owner: &str, repo: &str, hook_id: i64, ) -> Result<Response<Body>, ApiError>
Get a webhook configuration for a repository
Returns the webhook configuration for a repository. To get more information about the webhook, including the active
state and events
, use “Get a repository webhook.”
Access tokens must have the read:repo_hook
or repo
scope, and GitHub Apps must have the repository_hooks:read
permission.
Sourcepub async fn repos_update_webhook_config_for_repo<Content>(
&self,
owner: &str,
repo: &str,
hook_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_update_webhook_config_for_repo<Content>( &self, owner: &str, repo: &str, hook_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a webhook configuration for a repository
Updates the webhook configuration for a repository. To update more information about the webhook, including the active
state and events
, use “Update a repository webhook.”
Access tokens must have the write:repo_hook
or repo
scope, and GitHub Apps must have the repository_hooks:write
permission.
§Content
Sourcepub async fn repos_list_webhook_deliveries(
&self,
owner: &str,
repo: &str,
hook_id: i64,
per_page: Option<i64>,
cursor: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_webhook_deliveries( &self, owner: &str, repo: &str, hook_id: i64, per_page: Option<i64>, cursor: Option<&str>, ) -> Result<Response<Body>, ApiError>
List deliveries for a repository webhook
Returns a list of webhook deliveries for a webhook configured in a repository.
Sourcepub async fn repos_get_webhook_delivery(
&self,
owner: &str,
repo: &str,
hook_id: i64,
delivery_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_webhook_delivery( &self, owner: &str, repo: &str, hook_id: i64, delivery_id: i64, ) -> Result<Response<Body>, ApiError>
Get a delivery for a repository webhook
Returns a delivery for a webhook configured in a repository.
Sourcepub async fn repos_redeliver_webhook_delivery(
&self,
owner: &str,
repo: &str,
hook_id: i64,
delivery_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_redeliver_webhook_delivery( &self, owner: &str, repo: &str, hook_id: i64, delivery_id: i64, ) -> Result<Response<Body>, ApiError>
Redeliver a delivery for a repository webhook
Redeliver a webhook delivery for a webhook configured in a repository.
Sourcepub async fn repos_ping_webhook(
&self,
owner: &str,
repo: &str,
hook_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_ping_webhook( &self, owner: &str, repo: &str, hook_id: i64, ) -> Result<Response<Body>, ApiError>
Ping a repository webhook
This will trigger a ping event to be sent to the hook.
Sourcepub async fn repos_test_push_webhook(
&self,
owner: &str,
repo: &str,
hook_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_test_push_webhook( &self, owner: &str, repo: &str, hook_id: i64, ) -> Result<Response<Body>, ApiError>
Test the push repository webhook
This will trigger the hook with the latest push to the current repository if the hook is subscribed to push
events. If the hook is not subscribed to push
events, the server will respond with 204 but no test POST will be generated.
Note: Previously /repos/:owner/:repo/hooks/:hook_id/test
Sourcepub async fn migrations_get_import_status(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_get_import_status( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get an import status
View the progress of an import.
Import status
This section includes details about the possible values of the status
field of the Import Progress response.
An import that does not have errors will progress through these steps:
detecting
- the “detection” step of the import is in progress because the request did not include avcs
parameter. The import is identifying the type of source control present at the URL.importing
- the “raw” step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will includecommit_count
(the total number of raw commits that will be imported) andpercent
(0 - 100, the current progress through the import).mapping
- the “rewrite” step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information.pushing
- the “push” step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will includepush_percent
, which is the percent value reported bygit push
when it is “Writing objects”.complete
- the import is complete, and the repository is ready on GitHub.
If there are problems, you will see one of these in the status
field:
auth_failed
- the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the Update an import section.error
- the import encountered an error. The import progress response will include thefailed_step
and an error message. Contact GitHub Support for more information.detection_needs_auth
- the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the Update an import section.detection_found_nothing
- the importer didn’t recognize any source control at the URL. To resolve, Cancel the import and retry with the correct URL.detection_found_multiple
- the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include aproject_choices
field with the possible project choices as values. To update project choice, please see the Update an import section.
The project_choices field
When multiple projects are found at the provided URL, the response hash will include a project_choices
field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type.
Git LFS related fields
This section includes details about Git LFS related fields that may be present in the Import Progress response.
use_lfs
- describes whether the import has been opted in or out of using Git LFS. The value can beopt_in
,opt_out
, orundecided
if no action has been taken.has_large_files
- the boolean value describing whether files larger than 100MB were found during theimporting
step.large_files_size
- the total size in gigabytes of files larger than 100MB found in the originating repository.large_files_count
- the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a “Get Large Files” request.
Sourcepub async fn migrations_start_import<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_start_import<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn migrations_cancel_import(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_cancel_import( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn migrations_update_import<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_update_import<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update an import
An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API request. If no parameters are provided, the import will be restarted.
Some servers (e.g. TFS servers) can have several projects at a single URL. In those cases the import progress will
have the status detection_found_multiple
and the Import Progress response will include a project_choices
array.
You can select the project to import by providing one of the objects in the project_choices
array in the update request.
§Content
Get commit authors
Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username hubot
into something like hubot <hubot@12341234-abab-fefe-8787-fedcba987654>
.
This endpoint and the Map a commit author endpoint allow you to provide correct Git author information.
Map a commit author
Update an author’s identity for the import. Your application can continue updating authors any time before you push new commits to the repository.
§Content
Sourcepub async fn migrations_get_large_files(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_get_large_files( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn migrations_set_lfs_preference<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_set_lfs_preference<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update Git LFS preference
You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability is powered by Git LFS. You can learn more about our LFS feature and working with large files on our help site.
§Content
Sourcepub async fn apps_get_repo_installation(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn apps_get_repo_installation( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get a repository installation for the authenticated app
Enables an authenticated GitHub App to find the repository’s installation information. The installation’s account type will be either an organization or a user account, depending which account the repository belongs to.
You must use a JWT to access this endpoint.
Sourcepub async fn interactions_get_restrictions_for_repo(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn interactions_get_restrictions_for_repo( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get interaction restrictions for a repository
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.
Sourcepub async fn interactions_set_restrictions_for_repo<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn interactions_set_restrictions_for_repo<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set interaction restrictions for a repository
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.
§Content
Sourcepub async fn interactions_remove_restrictions_for_repo(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn interactions_remove_restrictions_for_repo( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Remove interaction restrictions for a repository
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.
Sourcepub async fn repos_list_invitations(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_invitations( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repository invitations
When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations.
Sourcepub async fn repos_delete_invitation(
&self,
owner: &str,
repo: &str,
invitation_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_invitation( &self, owner: &str, repo: &str, invitation_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a repository invitation
Sourcepub async fn repos_update_invitation<Content>(
&self,
owner: &str,
repo: &str,
invitation_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_update_invitation<Content>( &self, owner: &str, repo: &str, invitation_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a repository invitation
§Content
Sourcepub async fn issues_list_for_repo(
&self,
owner: &str,
repo: &str,
milestone: Option<&str>,
state: Option<&str>,
assignee: Option<&str>,
creator: Option<&str>,
mentioned: Option<&str>,
labels: Option<&str>,
sort: &Sort<'_>,
since: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn issues_list_for_repo( &self, owner: &str, repo: &str, milestone: Option<&str>, state: Option<&str>, assignee: Option<&str>, creator: Option<&str>, mentioned: Option<&str>, labels: Option<&str>, sort: &Sort<'_>, since: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repository issues
List issues in a repository.
Note: GitHub’s REST API v3 considers every pull request an issue, but not every issue is a pull request. For this
reason, “Issues” endpoints may return both issues and pull requests in the response. You can identify pull requests by
the pull_request
key. Be aware that the id
of a pull request returned from “Issues” endpoints will be an issue id. To find out the pull
request id, use the “List pull requests” endpoint.
Sourcepub async fn issues_create<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn issues_create<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create an issue
Any user with pull access to a repository can create an issue. If issues are disabled in the repository, the API returns a 410 Gone
status.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
§Content
Sourcepub async fn issues_list_comments_for_repo(
&self,
owner: &str,
repo: &str,
sort: &Sort<'_>,
since: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn issues_list_comments_for_repo( &self, owner: &str, repo: &str, sort: &Sort<'_>, since: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List issue comments for a repository
By default, Issue Comments are ordered by ascending ID.
Sourcepub async fn issues_get_comment(
&self,
owner: &str,
repo: &str,
comment_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn issues_get_comment( &self, owner: &str, repo: &str, comment_id: i64, ) -> Result<Response<Body>, ApiError>
Get an issue comment
Sourcepub async fn issues_delete_comment(
&self,
owner: &str,
repo: &str,
comment_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn issues_delete_comment( &self, owner: &str, repo: &str, comment_id: i64, ) -> Result<Response<Body>, ApiError>
Delete an issue comment
Sourcepub async fn issues_update_comment<Content>(
&self,
owner: &str,
repo: &str,
comment_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn issues_update_comment<Content>( &self, owner: &str, repo: &str, comment_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update an issue comment
§Content
Sourcepub async fn reactions_list_for_issue_comment(
&self,
owner: &str,
repo: &str,
comment_id: i64,
content: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_list_for_issue_comment( &self, owner: &str, repo: &str, comment_id: i64, content: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List reactions for an issue comment
List the reactions to an issue comment.
Sourcepub async fn reactions_create_for_issue_comment<Content>(
&self,
owner: &str,
repo: &str,
comment_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_create_for_issue_comment<Content>( &self, owner: &str, repo: &str, comment_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create reaction for an issue comment
Create a reaction to an issue comment. A response with an HTTP 200
status means that you already added the reaction type to this issue comment.
§Content
Sourcepub async fn reactions_delete_for_issue_comment(
&self,
owner: &str,
repo: &str,
comment_id: i64,
reaction_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_delete_for_issue_comment( &self, owner: &str, repo: &str, comment_id: i64, reaction_id: i64, ) -> Result<Response<Body>, ApiError>
Delete an issue comment reaction
Note: You can also specify a repository by repository_id
using the route DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id
.
Delete a reaction to an issue comment.
Sourcepub async fn issues_list_events_for_repo(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn issues_list_events_for_repo( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List issue events for a repository
Sourcepub async fn issues_get_event(
&self,
owner: &str,
repo: &str,
event_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn issues_get_event( &self, owner: &str, repo: &str, event_id: i64, ) -> Result<Response<Body>, ApiError>
Get an issue event
Sourcepub async fn issues_get(
&self,
owner: &str,
repo: &str,
issue_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn issues_get( &self, owner: &str, repo: &str, issue_number: i64, ) -> Result<Response<Body>, ApiError>
Get an issue
The API returns a 301 Moved Permanently
status if the issue was
transferred to another repository. If
the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API
returns a 404 Not Found
status. If the issue was deleted from a repository where the authenticated user has read
access, the API returns a 410 Gone
status. To receive webhook events for transferred and deleted issues, subscribe
to the issues
webhook.
Note: GitHub’s REST API v3 considers every pull request an issue, but not every issue is a pull request. For this
reason, “Issues” endpoints may return both issues and pull requests in the response. You can identify pull requests by
the pull_request
key. Be aware that the id
of a pull request returned from “Issues” endpoints will be an issue id. To find out the pull
request id, use the “List pull requests” endpoint.
Sourcepub async fn issues_update<Content>(
&self,
owner: &str,
repo: &str,
issue_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn issues_update<Content>( &self, owner: &str, repo: &str, issue_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn issues_add_assignees<Content>(
&self,
owner: &str,
repo: &str,
issue_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn issues_add_assignees<Content>( &self, owner: &str, repo: &str, issue_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add assignees to an issue
Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced.
§Content
Sourcepub async fn issues_remove_assignees<Content>(
&self,
owner: &str,
repo: &str,
issue_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn issues_remove_assignees<Content>( &self, owner: &str, repo: &str, issue_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn issues_list_comments(
&self,
owner: &str,
repo: &str,
issue_number: i64,
since: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn issues_list_comments( &self, owner: &str, repo: &str, issue_number: i64, since: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn issues_create_comment<Content>(
&self,
owner: &str,
repo: &str,
issue_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn issues_create_comment<Content>( &self, owner: &str, repo: &str, issue_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create an issue comment
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
§Content
Sourcepub async fn issues_list_events(
&self,
owner: &str,
repo: &str,
issue_number: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn issues_list_events( &self, owner: &str, repo: &str, issue_number: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List issue events
Sourcepub async fn issues_list_labels_on_issue(
&self,
owner: &str,
repo: &str,
issue_number: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn issues_list_labels_on_issue( &self, owner: &str, repo: &str, issue_number: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List labels for an issue
Sourcepub async fn issues_set_labels<Content>(
&self,
owner: &str,
repo: &str,
issue_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn issues_set_labels<Content>( &self, owner: &str, repo: &str, issue_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn issues_add_labels<Content>(
&self,
owner: &str,
repo: &str,
issue_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn issues_add_labels<Content>( &self, owner: &str, repo: &str, issue_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn issues_remove_all_labels(
&self,
owner: &str,
repo: &str,
issue_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn issues_remove_all_labels( &self, owner: &str, repo: &str, issue_number: i64, ) -> Result<Response<Body>, ApiError>
Remove all labels from an issue
Sourcepub async fn issues_remove_label(
&self,
owner: &str,
repo: &str,
issue_number: i64,
name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn issues_remove_label( &self, owner: &str, repo: &str, issue_number: i64, name: &str, ) -> Result<Response<Body>, ApiError>
Remove a label from an issue
Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a 404 Not Found
status if the label does not exist.
Sourcepub async fn issues_lock<Content>(
&self,
owner: &str,
repo: &str,
issue_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn issues_lock<Content>( &self, owner: &str, repo: &str, issue_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Lock an issue
Users with push access can lock an issue or pull request’s conversation.
Note that, if you choose not to pass any parameters, you’ll need to set Content-Length
to zero when calling out to this endpoint. For more information, see “HTTP verbs.”
§Content
Sourcepub async fn issues_unlock(
&self,
owner: &str,
repo: &str,
issue_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn issues_unlock( &self, owner: &str, repo: &str, issue_number: i64, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn reactions_list_for_issue(
&self,
owner: &str,
repo: &str,
issue_number: i64,
content: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_list_for_issue( &self, owner: &str, repo: &str, issue_number: i64, content: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn reactions_create_for_issue<Content>(
&self,
owner: &str,
repo: &str,
issue_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_create_for_issue<Content>( &self, owner: &str, repo: &str, issue_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn reactions_delete_for_issue(
&self,
owner: &str,
repo: &str,
issue_number: i64,
reaction_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_delete_for_issue( &self, owner: &str, repo: &str, issue_number: i64, reaction_id: i64, ) -> Result<Response<Body>, ApiError>
Delete an issue reaction
Note: You can also specify a repository by repository_id
using the route DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id
.
Delete a reaction to an issue.
Sourcepub async fn issues_list_events_for_timeline(
&self,
owner: &str,
repo: &str,
issue_number: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn issues_list_events_for_timeline( &self, owner: &str, repo: &str, issue_number: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List timeline events for an issue
Sourcepub async fn repos_list_deploy_keys(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_deploy_keys( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List deploy keys
Sourcepub async fn repos_create_deploy_key<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_deploy_key<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn repos_get_deploy_key(
&self,
owner: &str,
repo: &str,
key_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_deploy_key( &self, owner: &str, repo: &str, key_id: i64, ) -> Result<Response<Body>, ApiError>
Get a deploy key
Sourcepub async fn repos_delete_deploy_key(
&self,
owner: &str,
repo: &str,
key_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_deploy_key( &self, owner: &str, repo: &str, key_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a deploy key
Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.
Sourcepub async fn issues_list_labels_for_repo(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn issues_list_labels_for_repo( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List labels for a repository
Sourcepub async fn issues_create_label<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn issues_create_label<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn issues_get_label(
&self,
owner: &str,
repo: &str,
name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn issues_get_label( &self, owner: &str, repo: &str, name: &str, ) -> Result<Response<Body>, ApiError>
Get a label
Sourcepub async fn issues_delete_label(
&self,
owner: &str,
repo: &str,
name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn issues_delete_label( &self, owner: &str, repo: &str, name: &str, ) -> Result<Response<Body>, ApiError>
Delete a label
Sourcepub async fn issues_update_label<Content>(
&self,
owner: &str,
repo: &str,
name: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn issues_update_label<Content>( &self, owner: &str, repo: &str, name: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn repos_list_languages(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_languages( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
List repository languages
Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language.
Sourcepub async fn repos_enable_lfs_for_repo(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_enable_lfs_for_repo( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Enable Git LFS for a repository
Sourcepub async fn repos_disable_lfs_for_repo(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_disable_lfs_for_repo( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Disable Git LFS for a repository
Sourcepub async fn licenses_get_for_repo(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn licenses_get_for_repo( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get the license for a repository
This method returns the contents of the repository’s license file, if one is detected.
Similar to Get repository content, this method also supports custom media types for retrieving the raw license content or rendered license HTML.
Sourcepub async fn repos_merge_upstream<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_merge_upstream<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sync a fork branch with the upstream repository
Sync a branch of a forked repository to keep it up-to-date with the upstream repository.
§Content
Sourcepub async fn repos_merge<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_merge<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn issues_list_milestones(
&self,
owner: &str,
repo: &str,
state: Option<&str>,
sort: &Sort<'_>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn issues_list_milestones( &self, owner: &str, repo: &str, state: Option<&str>, sort: &Sort<'_>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List milestones
Sourcepub async fn issues_create_milestone<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn issues_create_milestone<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a milestone
§Content
Sourcepub async fn issues_get_milestone(
&self,
owner: &str,
repo: &str,
milestone_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn issues_get_milestone( &self, owner: &str, repo: &str, milestone_number: i64, ) -> Result<Response<Body>, ApiError>
Get a milestone
Sourcepub async fn issues_delete_milestone(
&self,
owner: &str,
repo: &str,
milestone_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn issues_delete_milestone( &self, owner: &str, repo: &str, milestone_number: i64, ) -> Result<Response<Body>, ApiError>
Delete a milestone
Sourcepub async fn issues_update_milestone<Content>(
&self,
owner: &str,
repo: &str,
milestone_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn issues_update_milestone<Content>( &self, owner: &str, repo: &str, milestone_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a milestone
§Content
Sourcepub async fn issues_list_labels_for_milestone(
&self,
owner: &str,
repo: &str,
milestone_number: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn issues_list_labels_for_milestone( &self, owner: &str, repo: &str, milestone_number: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List labels for issues in a milestone
Sourcepub async fn activity_list_repo_notifications_for_authenticated_user(
&self,
owner: &str,
repo: &str,
all: Option<bool>,
participating: Option<bool>,
since: Option<&str>,
before: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_repo_notifications_for_authenticated_user( &self, owner: &str, repo: &str, all: Option<bool>, participating: Option<bool>, since: Option<&str>, before: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repository notifications for the authenticated user
List all notifications for the current user.
Sourcepub async fn activity_mark_repo_notifications_as_read<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn activity_mark_repo_notifications_as_read<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Mark repository notifications as read
Marks all notifications in a repository as “read” removes them from the default view on GitHub. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted
status and GitHub will run an asynchronous process to mark notifications as “read.” To check whether any “unread” notifications remain, you can use the List repository notifications for the authenticated user endpoint and pass the query parameter all=false
.
§Content
Sourcepub async fn repos_get_pages(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_pages( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get a GitHub Pages site
Sourcepub async fn repos_update_information_about_pages_site<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_update_information_about_pages_site<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update information about a GitHub Pages site
Updates information for a GitHub Pages site. For more information, see “About GitHub Pages.
§Content
Sourcepub async fn repos_create_pages_site<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_pages_site<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a GitHub Pages site
Configures a GitHub Pages site. For more information, see “About GitHub Pages.”
§Content
Sourcepub async fn repos_delete_pages_site(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_pages_site( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Delete a GitHub Pages site
Sourcepub async fn repos_list_pages_builds(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_pages_builds( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List GitHub Pages builds
Sourcepub async fn repos_request_pages_build(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_request_pages_build( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Request a GitHub Pages build
You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.
Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes.
Sourcepub async fn repos_get_latest_pages_build(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_latest_pages_build( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get latest Pages build
Sourcepub async fn repos_get_pages_build(
&self,
owner: &str,
repo: &str,
build_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_pages_build( &self, owner: &str, repo: &str, build_id: i64, ) -> Result<Response<Body>, ApiError>
Get GitHub Pages build
Sourcepub async fn repos_get_pages_health_check(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_pages_health_check( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get a DNS health check for GitHub Pages
Gets a health check of the DNS settings for the CNAME
record configured for a repository’s GitHub Pages.
The first request to this endpoint returns a 202 Accepted
status and starts an asynchronous background task to get the results for the domain. After the background task completes, subsequent requests to this endpoint return a 200 OK
status with the health check results in the response.
Users must have admin or owner permissions. GitHub Apps must have the pages:write
and administration:write
permission to use this endpoint.
Sourcepub async fn projects_list_for_repo(
&self,
owner: &str,
repo: &str,
state: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn projects_list_for_repo( &self, owner: &str, repo: &str, state: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repository projects
Lists the projects in a repository. Returns a 404 Not Found
status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a 401 Unauthorized
or 410 Gone
status is returned.
Sourcepub async fn projects_create_for_repo<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn projects_create_for_repo<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a repository project
Creates a repository project board. Returns a 404 Not Found
status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a 401 Unauthorized
or 410 Gone
status is returned.
§Content
Sourcepub async fn pulls_list(
&self,
owner: &str,
repo: &str,
state: Option<&str>,
head: Option<&str>,
base: Option<&str>,
sort: &Sort<'_>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_list( &self, owner: &str, repo: &str, state: Option<&str>, head: Option<&str>, base: Option<&str>, sort: &Sort<'_>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List pull requests
Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
Sourcepub async fn pulls_create<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_create<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a pull request
Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.
You can create a new pull request.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
§Content
Sourcepub async fn pulls_list_review_comments_for_repo(
&self,
owner: &str,
repo: &str,
sort: &Sort<'_>,
since: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_list_review_comments_for_repo( &self, owner: &str, repo: &str, sort: &Sort<'_>, since: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List review comments in a repository
Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID.
Sourcepub async fn pulls_get_review_comment(
&self,
owner: &str,
repo: &str,
comment_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_get_review_comment( &self, owner: &str, repo: &str, comment_id: i64, ) -> Result<Response<Body>, ApiError>
Get a review comment for a pull request
Provides details for a review comment.
Sourcepub async fn pulls_delete_review_comment(
&self,
owner: &str,
repo: &str,
comment_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_delete_review_comment( &self, owner: &str, repo: &str, comment_id: i64, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn pulls_update_review_comment<Content>(
&self,
owner: &str,
repo: &str,
comment_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_update_review_comment<Content>( &self, owner: &str, repo: &str, comment_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn reactions_list_for_pull_request_review_comment(
&self,
owner: &str,
repo: &str,
comment_id: i64,
content: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_list_for_pull_request_review_comment( &self, owner: &str, repo: &str, comment_id: i64, content: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List reactions for a pull request review comment
List the reactions to a pull request review comment.
Sourcepub async fn reactions_create_for_pull_request_review_comment<Content>(
&self,
owner: &str,
repo: &str,
comment_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_create_for_pull_request_review_comment<Content>( &self, owner: &str, repo: &str, comment_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create reaction for a pull request review comment
Create a reaction to a pull request review comment. A response with an HTTP 200
status means that you already added the reaction type to this pull request review comment.
§Content
Sourcepub async fn reactions_delete_for_pull_request_comment(
&self,
owner: &str,
repo: &str,
comment_id: i64,
reaction_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_delete_for_pull_request_comment( &self, owner: &str, repo: &str, comment_id: i64, reaction_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a pull request comment reaction
Note: You can also specify a repository by repository_id
using the route DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.
Delete a reaction to a pull request review comment.
Sourcepub async fn pulls_get(
&self,
owner: &str,
repo: &str,
pull_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_get( &self, owner: &str, repo: &str, pull_number: i64, ) -> Result<Response<Body>, ApiError>
Get a pull request
Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
Lists details of a pull request by providing its number.
When you get, create, or edit a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the mergeable
key. For more information, see “Checking mergeability of pull requests”.
The value of the mergeable
attribute can be true
, false
, or null
. If the value is null
, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-null
value for the mergeable
attribute in the response. If mergeable
is true
, then merge_commit_sha
will be the SHA of the test merge commit.
The value of the merge_commit_sha
attribute changes depending on the state of the pull request. Before merging a pull request, the merge_commit_sha
attribute holds the SHA of the test merge commit. After merging a pull request, the merge_commit_sha
attribute changes depending on how you merged the pull request:
- If merged as a merge commit,
merge_commit_sha
represents the SHA of the merge commit. - If merged via a squash,
merge_commit_sha
represents the SHA of the squashed commit on the base branch. - If rebased,
merge_commit_sha
represents the commit that the base branch was updated to.
Pass the appropriate media type to fetch diff and patch formats.
Sourcepub async fn pulls_update<Content>(
&self,
owner: &str,
repo: &str,
pull_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_update<Content>( &self, owner: &str, repo: &str, pull_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a pull request
Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.
§Content
Sourcepub async fn codespaces_create_with_pr_for_authenticated_user<Content>(
&self,
owner: &str,
repo: &str,
pull_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_create_with_pr_for_authenticated_user<Content>( &self, owner: &str, repo: &str, pull_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a codespace from a pull request
Creates a codespace owned by the authenticated user for the specified pull request.
You must authenticate using an access token with the codespace
scope to use this endpoint.
GitHub Apps must have write access to the codespaces
repository permission to use this endpoint.
§Content
Sourcepub async fn pulls_list_review_comments(
&self,
owner: &str,
repo: &str,
pull_number: i64,
sort: &Sort<'_>,
since: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_list_review_comments( &self, owner: &str, repo: &str, pull_number: i64, sort: &Sort<'_>, since: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List review comments on a pull request
Lists all review comments for a pull request. By default, review comments are in ascending order by ID.
Sourcepub async fn pulls_create_review_comment<Content>(
&self,
owner: &str,
repo: &str,
pull_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_create_review_comment<Content>( &self, owner: &str, repo: &str, pull_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a review comment for a pull request
Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see “Create an issue comment.” We recommend creating a review comment using line
, side
, and optionally start_line
and start_side
if your comment applies to more than one line in the pull request diff.
The position
parameter is deprecated. If you use position
, the line
, side
, start_line
, and start_side
parameters are not required.
Note: The position value equals the number of lines down from the first “@@” hunk header in the file you want to add a comment. The line just below the “@@” line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
§Content
Sourcepub async fn pulls_create_reply_for_review_comment<Content>(
&self,
owner: &str,
repo: &str,
pull_number: i64,
comment_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_create_reply_for_review_comment<Content>( &self, owner: &str, repo: &str, pull_number: i64, comment_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a reply for a review comment
Creates a reply to a review comment for a pull request. For the comment_id
, provide the ID of the review comment you are replying to. This must be the ID of a top-level review comment, not a reply to that comment. Replies to replies are not supported.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
§Content
Sourcepub async fn pulls_list_commits(
&self,
owner: &str,
repo: &str,
pull_number: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_list_commits( &self, owner: &str, repo: &str, pull_number: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List commits on a pull request
Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the List commits endpoint.
Sourcepub async fn pulls_list_files(
&self,
owner: &str,
repo: &str,
pull_number: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_list_files( &self, owner: &str, repo: &str, pull_number: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List pull requests files
Note: Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default.
Sourcepub async fn pulls_check_if_merged(
&self,
owner: &str,
repo: &str,
pull_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_check_if_merged( &self, owner: &str, repo: &str, pull_number: i64, ) -> Result<Response<Body>, ApiError>
Check if a pull request has been merged
Sourcepub async fn pulls_merge<Content>(
&self,
owner: &str,
repo: &str,
pull_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_merge<Content>( &self, owner: &str, repo: &str, pull_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Merge a pull request
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
§Content
Sourcepub async fn pulls_list_requested_reviewers(
&self,
owner: &str,
repo: &str,
pull_number: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_list_requested_reviewers( &self, owner: &str, repo: &str, pull_number: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List requested reviewers for a pull request
Sourcepub async fn pulls_request_reviewers<Content>(
&self,
owner: &str,
repo: &str,
pull_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_request_reviewers<Content>( &self, owner: &str, repo: &str, pull_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Request reviewers for a pull request
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
§Content
Sourcepub async fn pulls_remove_requested_reviewers<Content>(
&self,
owner: &str,
repo: &str,
pull_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_remove_requested_reviewers<Content>( &self, owner: &str, repo: &str, pull_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Remove requested reviewers from a pull request
§Content
Sourcepub async fn pulls_list_reviews(
&self,
owner: &str,
repo: &str,
pull_number: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_list_reviews( &self, owner: &str, repo: &str, pull_number: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List reviews for a pull request
The list of reviews returns in chronological order.
Sourcepub async fn pulls_create_review<Content>(
&self,
owner: &str,
repo: &str,
pull_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_create_review<Content>( &self, owner: &str, repo: &str, pull_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a review for a pull request
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
Pull request reviews created in the PENDING
state do not include the submitted_at
property in the response.
Note: To comment on a specific line in a file, you need to first determine the position of that line in the diff. The GitHub REST API v3 offers the application/vnd.github.v3.diff
media type. To see a pull request diff, add this media type to the Accept
header of a call to the single pull request endpoint.
The position
value equals the number of lines down from the first “@@” hunk header in the file you want to add a comment. The line just below the “@@” line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.
§Content
Sourcepub async fn pulls_get_review(
&self,
owner: &str,
repo: &str,
pull_number: i64,
review_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_get_review( &self, owner: &str, repo: &str, pull_number: i64, review_id: i64, ) -> Result<Response<Body>, ApiError>
Get a review for a pull request
Sourcepub async fn pulls_update_review<Content>(
&self,
owner: &str,
repo: &str,
pull_number: i64,
review_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_update_review<Content>( &self, owner: &str, repo: &str, pull_number: i64, review_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn pulls_delete_pending_review(
&self,
owner: &str,
repo: &str,
pull_number: i64,
review_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_delete_pending_review( &self, owner: &str, repo: &str, pull_number: i64, review_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a pending review for a pull request
Sourcepub async fn pulls_list_comments_for_review(
&self,
owner: &str,
repo: &str,
pull_number: i64,
review_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_list_comments_for_review( &self, owner: &str, repo: &str, pull_number: i64, review_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List comments for a pull request review
List comments for a specific pull request review.
Sourcepub async fn pulls_dismiss_review<Content>(
&self,
owner: &str,
repo: &str,
pull_number: i64,
review_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_dismiss_review<Content>( &self, owner: &str, repo: &str, pull_number: i64, review_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Dismiss a review for a pull request
Note: To dismiss a pull request review on a protected branch, you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews.
§Content
Sourcepub async fn pulls_submit_review<Content>(
&self,
owner: &str,
repo: &str,
pull_number: i64,
review_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_submit_review<Content>( &self, owner: &str, repo: &str, pull_number: i64, review_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Submit a review for a pull request
§Content
Sourcepub async fn pulls_update_branch<Content>(
&self,
owner: &str,
repo: &str,
pull_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn pulls_update_branch<Content>( &self, owner: &str, repo: &str, pull_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a pull request branch
Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch.
§Content
Sourcepub async fn repos_get_readme(
&self,
owner: &str,
repo: &str,
ref: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_readme( &self, owner: &str, repo: &str, ref: Option<&str>, ) -> Result<Response<Body>, ApiError>
Get a repository README
Gets the preferred README for a repository.
READMEs support custom media types for retrieving the raw content or rendered HTML.
Sourcepub async fn repos_get_readme_in_directory(
&self,
owner: &str,
repo: &str,
dir: &str,
ref: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_readme_in_directory( &self, owner: &str, repo: &str, dir: &str, ref: Option<&str>, ) -> Result<Response<Body>, ApiError>
Get a repository README for a directory
Gets the README from a repository directory.
READMEs support custom media types for retrieving the raw content or rendered HTML.
Sourcepub async fn repos_list_releases(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_releases( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List releases
This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the Repository Tags API.
Information about published releases are available to everyone. Only users with push access will receive listings for draft releases.
Sourcepub async fn repos_create_release<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_release<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a release
Users with push access to the repository can create a release.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
§Content
Sourcepub async fn repos_get_release_asset(
&self,
owner: &str,
repo: &str,
asset_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_release_asset( &self, owner: &str, repo: &str, asset_id: i64, ) -> Result<Response<Body>, ApiError>
Get a release asset
To download the asset’s binary content, set the Accept
header of the request to application/octet-stream
. The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a 200
or 302
response.
Sourcepub async fn repos_delete_release_asset(
&self,
owner: &str,
repo: &str,
asset_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_release_asset( &self, owner: &str, repo: &str, asset_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a release asset
Sourcepub async fn repos_update_release_asset<Content>(
&self,
owner: &str,
repo: &str,
asset_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_update_release_asset<Content>( &self, owner: &str, repo: &str, asset_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn repos_generate_release_notes<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_generate_release_notes<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Generate release notes content for a release
Generate a name and body describing a release. The body content will be markdown formatted and contain information like the changes since last release and users who contributed. The generated release notes are not saved anywhere. They are intended to be generated and used when creating a new release.
§Content
Sourcepub async fn repos_get_latest_release(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_latest_release( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get the latest release
View the latest published full release for the repository.
The latest release is the most recent non-prerelease, non-draft release, sorted by the created_at
attribute. The created_at
attribute is the date of the commit used for the release, and not the date when the release was drafted or published.
Sourcepub async fn repos_get_release_by_tag(
&self,
owner: &str,
repo: &str,
tag: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_release_by_tag( &self, owner: &str, repo: &str, tag: &str, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn repos_get_release(
&self,
owner: &str,
repo: &str,
release_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_release( &self, owner: &str, repo: &str, release_id: i64, ) -> Result<Response<Body>, ApiError>
Get a release
Note: This returns an upload_url
key corresponding to the endpoint for uploading release assets. This key is a hypermedia resource.
Sourcepub async fn repos_delete_release(
&self,
owner: &str,
repo: &str,
release_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_release( &self, owner: &str, repo: &str, release_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a release
Users with push access to the repository can delete a release.
Sourcepub async fn repos_update_release<Content>(
&self,
owner: &str,
repo: &str,
release_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_update_release<Content>( &self, owner: &str, repo: &str, release_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn repos_list_release_assets(
&self,
owner: &str,
repo: &str,
release_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_release_assets( &self, owner: &str, repo: &str, release_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List release assets
Sourcepub async fn repos_upload_release_asset<Content>(
&self,
owner: &str,
repo: &str,
release_id: i64,
name: &str,
label: Option<&str>,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_upload_release_asset<Content>( &self, owner: &str, repo: &str, release_id: i64, name: &str, label: Option<&str>, theContent: Content, ) -> Result<Response<Body>, ApiError>
Upload a release asset
This endpoint makes use of a Hypermedia relation to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the upload_url
returned in
the response of the Create a release endpoint to upload a release asset.
You need to use an HTTP client which supports SNI to make calls to this endpoint.
Most libraries will set the required Content-Length
header automatically. Use the required Content-Type
header to provide the media type of the asset. For a list of media types, see Media Types. For example:
application/zip
GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, you’ll still need to pass your authentication to be able to upload an asset.
When an upstream failure occurs, you will receive a 502 Bad Gateway
status. This may leave an empty asset with a state of starter
. It can be safely deleted.
Notes:
- GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The “List assets for a release” endpoint lists the renamed filenames. For more information and help, contact GitHub Support.
- If you upload an asset with the same filename as another uploaded asset, you’ll receive an error and must delete the old file before you can re-upload the new asset.
Sourcepub async fn reactions_list_for_release(
&self,
owner: &str,
repo: &str,
release_id: i64,
content: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_list_for_release( &self, owner: &str, repo: &str, release_id: i64, content: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn reactions_create_for_release<Content>(
&self,
owner: &str,
repo: &str,
release_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_create_for_release<Content>( &self, owner: &str, repo: &str, release_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn reactions_delete_for_release(
&self,
owner: &str,
repo: &str,
release_id: i64,
reaction_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_delete_for_release( &self, owner: &str, repo: &str, release_id: i64, reaction_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a release reaction
Note: You can also specify a repository by repository_id
using the route DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id
.
Delete a reaction to a release.
Sourcepub async fn secret_scanning_list_alerts_for_repo(
&self,
owner: &str,
repo: &str,
state: Option<&str>,
secret_type: Option<&str>,
resolution: Option<&str>,
page: Option<i64>,
per_page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn secret_scanning_list_alerts_for_repo( &self, owner: &str, repo: &str, state: Option<&str>, secret_type: Option<&str>, resolution: Option<&str>, page: Option<i64>, per_page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List secret scanning alerts for a repository
Lists secret scanning alerts for an eligible repository, from newest to oldest.
To use this endpoint, you must be an administrator for the repository or for the organization that owns the repository, and you must use a personal access token with the repo
scope or security_events
scope.
For public repositories, you may instead use the public_repo
scope.
GitHub Apps must have the secret_scanning_alerts
read permission to use this endpoint.
Sourcepub async fn secret_scanning_get_alert(
&self,
owner: &str,
repo: &str,
alert_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn secret_scanning_get_alert( &self, owner: &str, repo: &str, alert_number: i64, ) -> Result<Response<Body>, ApiError>
Get a secret scanning alert
Gets a single secret scanning alert detected in an eligible repository.
To use this endpoint, you must be an administrator for the repository or for the organization that owns the repository, and you must use a personal access token with the repo
scope or security_events
scope.
For public repositories, you may instead use the public_repo
scope.
GitHub Apps must have the secret_scanning_alerts
read permission to use this endpoint.
Sourcepub async fn secret_scanning_update_alert<Content>(
&self,
owner: &str,
repo: &str,
alert_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn secret_scanning_update_alert<Content>( &self, owner: &str, repo: &str, alert_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a secret scanning alert
Updates the status of a secret scanning alert in an eligible repository.
To use this endpoint, you must be an administrator for the repository or for the organization that owns the repository, and you must use a personal access token with the repo
scope or security_events
scope.
For public repositories, you may instead use the public_repo
scope.
GitHub Apps must have the secret_scanning_alerts
write permission to use this endpoint.
§Content
Sourcepub async fn secret_scanning_list_locations_for_alert(
&self,
owner: &str,
repo: &str,
alert_number: i64,
page: Option<i64>,
per_page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn secret_scanning_list_locations_for_alert( &self, owner: &str, repo: &str, alert_number: i64, page: Option<i64>, per_page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List locations for a secret scanning alert
Lists all locations for a given secret scanning alert for an eligible repository.
To use this endpoint, you must be an administrator for the repository or for the organization that owns the repository, and you must use a personal access token with the repo
scope or security_events
scope.
For public repositories, you may instead use the public_repo
scope.
GitHub Apps must have the secret_scanning_alerts
read permission to use this endpoint.
Sourcepub async fn activity_list_stargazers_for_repo(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_stargazers_for_repo( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List stargazers
Lists the people that have starred the repository.
You can also find out when stars were created by passing the following custom media type via the Accept
header:
Sourcepub async fn repos_get_code_frequency_stats(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_code_frequency_stats( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get the weekly commit activity
Returns a weekly aggregate of the number of additions and deletions pushed to a repository.
Sourcepub async fn repos_get_commit_activity_stats(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_commit_activity_stats( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get the last year of commit activity
Returns the last year of commit activity grouped by week. The days
array is a group of commits per day, starting on Sunday
.
Sourcepub async fn repos_get_contributors_stats(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_contributors_stats( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get all contributor commit activity
Returns the total
number of commits authored by the contributor. In addition, the response includes a Weekly Hash (weeks
array) with the following information:
w
- Start of the week, given as a Unix timestamp.a
- Number of additionsd
- Number of deletionsc
- Number of commits
Sourcepub async fn repos_get_participation_stats(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_participation_stats( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get the weekly commit count
Returns the total commit counts for the owner
and total commit counts in all
. all
is everyone combined, including the owner
in the last 52 weeks. If you’d like to get the commit counts for non-owners, you can subtract owner
from all
.
The array order is oldest week (index 0) to most recent week.
Sourcepub async fn repos_get_punch_card_stats(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_punch_card_stats( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get the hourly commit count for each day
Each array contains the day number, hour number, and number of commits:
0-6
: Sunday - Saturday0-23
: Hour of day- Number of commits
For example, [2, 14, 25]
indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits.
Sourcepub async fn repos_create_commit_status<Content>(
&self,
owner: &str,
repo: &str,
sha: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_commit_status<Content>( &self, owner: &str, repo: &str, sha: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a commit status
Users with push access in a repository can create commit statuses for a given SHA.
Note: there is a limit of 1000 statuses per sha
and context
within a repository. Attempts to create more than 1000 statuses will result in a validation error.
§Content
Sourcepub async fn activity_list_watchers_for_repo(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_watchers_for_repo( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn activity_get_repo_subscription(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn activity_get_repo_subscription( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get a repository subscription
Sourcepub async fn activity_set_repo_subscription<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn activity_set_repo_subscription<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set a repository subscription
If you would like to watch a repository, set subscribed
to true
. If you would like to ignore notifications made within a repository, set ignored
to true
. If you would like to stop watching a repository, delete the repository’s subscription completely.
§Content
Sourcepub async fn activity_delete_repo_subscription(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn activity_delete_repo_subscription( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Delete a repository subscription
This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, set the repository’s subscription manually.
List repository tags
Sourcepub async fn repos_list_tag_protection(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_tag_protection( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
List tag protection states for a repository
This returns the tag protection states of a repository.
This information is only available to repository administrators.
Sourcepub async fn repos_create_tag_protection<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_tag_protection<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a tag protection state for a repository
This creates a tag protection state for a repository. This endpoint is only available to repository administrators.
§Content
Sourcepub async fn repos_delete_tag_protection(
&self,
owner: &str,
repo: &str,
tag_protection_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_delete_tag_protection( &self, owner: &str, repo: &str, tag_protection_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a tag protection state for a repository
This deletes a tag protection state for a repository. This endpoint is only available to repository administrators.
Sourcepub async fn repos_download_tarball_archive(
&self,
owner: &str,
repo: &str,
ref: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_download_tarball_archive( &self, owner: &str, repo: &str, ref: &str, ) -> Result<Response<Body>, ApiError>
Download a repository archive (tar)
Gets a redirect URL to download a tar archive for a repository. If you omit :ref
, the repository’s default branch (usually
master
) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use
the Location
header to make a second GET
request.
Note: For private repositories, these links are temporary and expire after five minutes.
Sourcepub async fn repos_list_teams(
&self,
owner: &str,
repo: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_teams( &self, owner: &str, repo: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repository teams
Sourcepub async fn repos_get_all_topics(
&self,
owner: &str,
repo: &str,
page: Option<i64>,
per_page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_all_topics( &self, owner: &str, repo: &str, page: Option<i64>, per_page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Get all repository topics
Sourcepub async fn repos_replace_all_topics<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_replace_all_topics<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Replace all repository topics
§Content
Sourcepub async fn repos_get_clones(
&self,
owner: &str,
repo: &str,
per: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_clones( &self, owner: &str, repo: &str, per: Option<&str>, ) -> Result<Response<Body>, ApiError>
Get repository clones
Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday.
Sourcepub async fn repos_get_top_paths(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_top_paths( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Get top referral paths
Get the top 10 popular contents over the last 14 days.
Sourcepub async fn repos_get_top_referrers(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_top_referrers( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn repos_get_views(
&self,
owner: &str,
repo: &str,
per: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_get_views( &self, owner: &str, repo: &str, per: Option<&str>, ) -> Result<Response<Body>, ApiError>
Get page views
Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday.
Sourcepub async fn repos_transfer<Content>(
&self,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_transfer<Content>( &self, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Transfer a repository
A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original owner
, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see about repository transfers.
§Content
Sourcepub async fn repos_check_vulnerability_alerts(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_check_vulnerability_alerts( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Check if vulnerability alerts are enabled for a repository
Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see “About security alerts for vulnerable dependencies”.
Sourcepub async fn repos_enable_vulnerability_alerts(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_enable_vulnerability_alerts( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Enable vulnerability alerts
Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see “About security alerts for vulnerable dependencies”.
Sourcepub async fn repos_disable_vulnerability_alerts(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_disable_vulnerability_alerts( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Disable vulnerability alerts
Disables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see “About security alerts for vulnerable dependencies”.
Sourcepub async fn repos_download_zipball_archive(
&self,
owner: &str,
repo: &str,
ref: &str,
) -> Result<Response<Body>, ApiError>
pub async fn repos_download_zipball_archive( &self, owner: &str, repo: &str, ref: &str, ) -> Result<Response<Body>, ApiError>
Download a repository archive (zip)
Gets a redirect URL to download a zip archive for a repository. If you omit :ref
, the repository’s default branch (usually
master
) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use
the Location
header to make a second GET
request.
Note: For private repositories, these links are temporary and expire after five minutes.
Sourcepub async fn repos_create_using_template<Content>(
&self,
template_owner: &str,
template_repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_using_template<Content>( &self, template_owner: &str, template_repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a repository using a template
Creates a new repository using a repository template. Use the template_owner
and template_repo
route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository’s information using the Get a repository endpoint and check that the is_template
key is true
.
OAuth scope requirements
When using OAuth, authorizations must include:
public_repo
scope orrepo
scope to create a public repository. Note: For GitHub AE, userepo
scope to create an internal repository.repo
scope to create a private repository
§Content
Sourcepub async fn repos_list_public(
&self,
since: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_public( &self, since: Option<i64>, ) -> Result<Response<Body>, ApiError>
List public repositories
Lists all public repositories in the order that they were created.
Note:
- For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise.
- Pagination is powered exclusively by the
since
parameter. Use the Link header to get the URL for the next page of repositories.
Sourcepub async fn actions_list_environment_secrets(
&self,
repository_id: i64,
environment_name: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn actions_list_environment_secrets( &self, repository_id: i64, environment_name: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List environment secrets
Lists all secrets available in an environment without revealing their encrypted values. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the secrets
repository permission to use this endpoint.
Sourcepub async fn actions_get_environment_public_key(
&self,
repository_id: i64,
environment_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_environment_public_key( &self, repository_id: i64, environment_name: &str, ) -> Result<Response<Body>, ApiError>
Get an environment public key
Get the public key for an environment, which you need to encrypt environment secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo
scope. GitHub Apps must have the secrets
repository permission to use this endpoint.
Sourcepub async fn actions_get_environment_secret(
&self,
repository_id: i64,
environment_name: &str,
secret_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_get_environment_secret( &self, repository_id: i64, environment_name: &str, secret_name: &str, ) -> Result<Response<Body>, ApiError>
Get an environment secret
Gets a single environment secret without revealing its encrypted value. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the secrets
repository permission to use this endpoint.
Sourcepub async fn actions_create_or_update_environment_secret<Content>(
&self,
repository_id: i64,
environment_name: &str,
secret_name: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn actions_create_or_update_environment_secret<Content>( &self, repository_id: i64, environment_name: &str, secret_name: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create or update an environment secret
Creates or updates an environment secret with an encrypted value. Encrypt your secret using
LibSodium. You must authenticate using an access
token with the repo
scope to use this endpoint. GitHub Apps must have the secrets
repository permission to use
this endpoint.
§Example encrypting a secret using Node.js
Encrypt your secret using the tweetsodium library.
const sodium = require('tweetsodium');
const key = "base64-encoded-public-key";
const value = "plain-text-secret";
// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
console.log(encrypted);
§Example encrypting a secret using Python
Encrypt your secret using pynacl with Python 3.
from base64 import b64encode
from nacl import encoding, public
def encrypt(public_key: str, secret_value: str) -> str:
"""Encrypt a Unicode string using the public key."""
public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
sealed_box = public.SealedBox(public_key)
encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
return b64encode(encrypted).decode("utf-8")
§Example encrypting a secret using C#
Encrypt your secret using the Sodium.Core package.
var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));
§Example encrypting a secret using Ruby
Encrypt your secret using the rbnacl gem.
require "rbnacl"
require "base64"
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")
# Print the base64 encoded secret
puts Base64.strict_encode64(encrypted_secret)
§Content
Sourcepub async fn actions_delete_environment_secret(
&self,
repository_id: i64,
environment_name: &str,
secret_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn actions_delete_environment_secret( &self, repository_id: i64, environment_name: &str, secret_name: &str, ) -> Result<Response<Body>, ApiError>
Delete an environment secret
Deletes a secret in an environment using the secret name. You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the secrets
repository permission to use this endpoint.
Sourcepub async fn enterprise_admin_list_provisioned_groups_enterprise(
&self,
enterprise: &str,
start_index: Option<i64>,
count: Option<i64>,
filter: Option<&str>,
excluded_attributes: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_list_provisioned_groups_enterprise( &self, enterprise: &str, start_index: Option<i64>, count: Option<i64>, filter: Option<&str>, excluded_attributes: Option<&str>, ) -> Result<Response<Body>, ApiError>
List provisioned SCIM groups for an enterprise
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
Sourcepub async fn enterprise_admin_provision_and_invite_enterprise_group<Content>(
&self,
enterprise: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_provision_and_invite_enterprise_group<Content>( &self, enterprise: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Provision a SCIM enterprise group and invite users
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
Provision an enterprise group, and invite users to the group. This sends invitation emails to the email address of the invited users to join the GitHub organization that the SCIM group corresponds to.
§Content
Sourcepub async fn enterprise_admin_get_provisioning_information_for_enterprise_group(
&self,
enterprise: &str,
scim_group_id: &str,
excluded_attributes: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_get_provisioning_information_for_enterprise_group( &self, enterprise: &str, scim_group_id: &str, excluded_attributes: Option<&str>, ) -> Result<Response<Body>, ApiError>
Get SCIM provisioning information for an enterprise group
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
Sourcepub async fn enterprise_admin_set_information_for_provisioned_enterprise_group<Content>(
&self,
enterprise: &str,
scim_group_id: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_set_information_for_provisioned_enterprise_group<Content>( &self, enterprise: &str, scim_group_id: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set SCIM information for a provisioned enterprise group
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
Replaces an existing provisioned group’s information. You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don’t provide will be removed, including group membership. If you want to only update a specific attribute, use the Update an attribute for a SCIM enterprise group endpoint instead.
§Content
Sourcepub async fn enterprise_admin_delete_scim_group_from_enterprise(
&self,
enterprise: &str,
scim_group_id: &str,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_delete_scim_group_from_enterprise( &self, enterprise: &str, scim_group_id: &str, ) -> Result<Response<Body>, ApiError>
Delete a SCIM group from an enterprise
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
Sourcepub async fn enterprise_admin_update_attribute_for_enterprise_group<Content>(
&self,
enterprise: &str,
scim_group_id: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_update_attribute_for_enterprise_group<Content>( &self, enterprise: &str, scim_group_id: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update an attribute for a SCIM enterprise group
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
Allows you to change a provisioned group’s individual attributes. To change a group’s values, you must provide a specific Operations JSON format that contains at least one of the add, remove, or replace operations. For examples and more information on the SCIM operations format, see the SCIM specification.
§Content
Sourcepub async fn enterprise_admin_list_provisioned_identities_enterprise(
&self,
enterprise: &str,
start_index: Option<i64>,
count: Option<i64>,
filter: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_list_provisioned_identities_enterprise( &self, enterprise: &str, start_index: Option<i64>, count: Option<i64>, filter: Option<&str>, ) -> Result<Response<Body>, ApiError>
List SCIM provisioned identities for an enterprise
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
Retrieves a paginated list of all provisioned enterprise members, including pending invitations.
When a user with a SAML-provisioned external identity leaves (or is removed from) an enterprise, the account’s metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member:
- When a user with a SCIM-provisioned external identity is removed from an enterprise, the account’s metadata is preserved to allow the user to re-join the organization in the future.
- When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted).
- When a user is invited over SCIM, an external identity is created that matches with the invitee’s email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO.
The returned list of external identities can include an entry for a null
user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO:
-
The user is granted access by the IdP and is not a member of the GitHub enterprise.
-
The user attempts to access the GitHub enterprise and initiates the SAML SSO process, and is not currently signed in to their GitHub account.
-
After successfully authenticating with the SAML SSO IdP, the
null
external identity entry is created and the user is prompted to sign in to their GitHub account:- If the user signs in, their GitHub account is linked to this entry.
- If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub enterprise, and the external identity
null
entry remains in place.
Sourcepub async fn enterprise_admin_provision_and_invite_enterprise_user<Content>(
&self,
enterprise: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_provision_and_invite_enterprise_user<Content>( &self, enterprise: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Provision and invite a SCIM enterprise user
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
Provision enterprise membership for a user, and send organization invitation emails to the email address.
You can optionally include the groups a user will be invited to join. If you do not provide a list of groups
, the user is provisioned for the enterprise, but no organization invitation emails will be sent.
§Content
Sourcepub async fn enterprise_admin_get_provisioning_information_for_enterprise_user(
&self,
enterprise: &str,
scim_user_id: &str,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_get_provisioning_information_for_enterprise_user( &self, enterprise: &str, scim_user_id: &str, ) -> Result<Response<Body>, ApiError>
Get SCIM provisioning information for an enterprise user
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
Sourcepub async fn enterprise_admin_set_information_for_provisioned_enterprise_user<Content>(
&self,
enterprise: &str,
scim_user_id: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_set_information_for_provisioned_enterprise_user<Content>( &self, enterprise: &str, scim_user_id: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set SCIM information for a provisioned enterprise user
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
Replaces an existing provisioned user’s information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don’t provide will be removed. If you want to only update a specific attribute, use the Update an attribute for a SCIM user endpoint instead.
You must at least provide the required values for the user: userName
, name
, and emails
.
Warning: Setting active: false
removes the user from the enterprise, deletes the external identity, and deletes the associated {scim_user_id}
.
§Content
Sourcepub async fn enterprise_admin_delete_user_from_enterprise(
&self,
enterprise: &str,
scim_user_id: &str,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_delete_user_from_enterprise( &self, enterprise: &str, scim_user_id: &str, ) -> Result<Response<Body>, ApiError>
Delete a SCIM user from an enterprise
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
Sourcepub async fn enterprise_admin_update_attribute_for_enterprise_user<Content>(
&self,
enterprise: &str,
scim_user_id: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn enterprise_admin_update_attribute_for_enterprise_user<Content>( &self, enterprise: &str, scim_user_id: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update an attribute for a SCIM enterprise user
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
Allows you to change a provisioned user’s individual attributes. To change a user’s values, you must provide a specific Operations
JSON format that contains at least one of the add
, remove
, or replace
operations. For examples and more information on the SCIM operations format, see the SCIM specification.
Note: Complicated SCIM path
selectors that include filters are not supported. For example, a path
selector defined as "path": "emails[type eq \"work\"]"
will not work.
Warning: If you set active:false
using the replace
operation (as shown in the JSON example below), it removes the user from the enterprise, deletes the external identity, and deletes the associated :scim_user_id
.
{
"Operations":[{
"op":"replace",
"value":{
"active":false
}
}]
}
§Content
Sourcepub async fn scim_list_provisioned_identities(
&self,
org: &str,
start_index: Option<i64>,
count: Option<i64>,
filter: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn scim_list_provisioned_identities( &self, org: &str, start_index: Option<i64>, count: Option<i64>, filter: Option<&str>, ) -> Result<Response<Body>, ApiError>
List SCIM provisioned identities
Retrieves a paginated list of all provisioned organization members, including pending invitations. If you provide the filter
parameter, the resources for all matching provisions members are returned.
When a user with a SAML-provisioned external identity leaves (or is removed from) an organization, the account’s metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member:
- When a user with a SCIM-provisioned external identity is removed from an organization, the account’s metadata is preserved to allow the user to re-join the organization in the future.
- When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted).
- When a user is invited over SCIM, an external identity is created that matches with the invitee’s email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO.
The returned list of external identities can include an entry for a null
user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO:
-
The user is granted access by the IdP and is not a member of the GitHub organization.
-
The user attempts to access the GitHub organization and initiates the SAML SSO process, and is not currently signed in to their GitHub account.
-
After successfully authenticating with the SAML SSO IdP, the
null
external identity entry is created and the user is prompted to sign in to their GitHub account:- If the user signs in, their GitHub account is linked to this entry.
- If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub organization, and the external identity
null
entry remains in place.
Sourcepub async fn scim_provision_and_invite_user<Content>(
&self,
org: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn scim_provision_and_invite_user<Content>( &self, org: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Provision and invite a SCIM user
Provision organization membership for a user, and send an activation email to the email address.
§Content
Sourcepub async fn scim_get_provisioning_information_for_user(
&self,
org: &str,
scim_user_id: &str,
) -> Result<Response<Body>, ApiError>
pub async fn scim_get_provisioning_information_for_user( &self, org: &str, scim_user_id: &str, ) -> Result<Response<Body>, ApiError>
Get SCIM provisioning information for a user
Sourcepub async fn scim_set_information_for_provisioned_user<Content>(
&self,
org: &str,
scim_user_id: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn scim_set_information_for_provisioned_user<Content>( &self, org: &str, scim_user_id: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a provisioned organization membership
Replaces an existing provisioned user’s information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don’t provide will be removed. If you want to only update a specific attribute, use the Update an attribute for a SCIM user endpoint instead.
You must at least provide the required values for the user: userName
, name
, and emails
.
Warning: Setting active: false
removes the user from the organization, deletes the external identity, and deletes the associated {scim_user_id}
.
§Content
Sourcepub async fn scim_delete_user_from_org(
&self,
org: &str,
scim_user_id: &str,
) -> Result<Response<Body>, ApiError>
pub async fn scim_delete_user_from_org( &self, org: &str, scim_user_id: &str, ) -> Result<Response<Body>, ApiError>
Delete a SCIM user from an organization
Sourcepub async fn scim_update_attribute_for_user<Content>(
&self,
org: &str,
scim_user_id: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn scim_update_attribute_for_user<Content>( &self, org: &str, scim_user_id: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update an attribute for a SCIM user
Allows you to change a provisioned user’s individual attributes. To change a user’s values, you must provide a specific Operations
JSON format that contains at least one of the add
, remove
, or replace
operations. For examples and more information on the SCIM operations format, see the SCIM specification.
Note: Complicated SCIM path
selectors that include filters are not supported. For example, a path
selector defined as "path": "emails[type eq \"work\"]"
will not work.
Warning: If you set active:false
using the replace
operation (as shown in the JSON example below), it removes the user from the organization, deletes the external identity, and deletes the associated :scim_user_id
.
{
"Operations":[{
"op":"replace",
"value":{
"active":false
}
}]
}
§Content
Sourcepub async fn search_code(
&self,
q: &str,
sort: Option<&str>,
order: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn search_code( &self, q: &str, sort: Option<&str>, order: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Search code
Searches for query terms inside of a file. This method returns up to 100 results per page.
When searching for code, you can get text match metadata for the file content and file path fields when you pass the text-match
media type. For more details about how to receive highlighted search results, see Text match metadata.
For example, if you want to find the definition of the addClass
function inside jQuery repository, your query would look something like this:
q=addClass+in:file+language:js+repo:jquery/jquery
This query searches for the keyword addClass
within a file’s contents. The query limits the search to files where the language is JavaScript in the jquery/jquery
repository.
§Considerations for code search
Due to the complexity of searching code, there are a few restrictions on how searches are performed:
- Only the default branch is considered. In most cases, this will be the
master
branch. - Only files smaller than 384 KB are searchable.
- You must always include at least one search term when searching source code. For example, searching for
language:go
is not valid, whileamazing language:go
is.
Sourcepub async fn search_commits(
&self,
q: &str,
sort: Option<&str>,
order: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn search_commits( &self, q: &str, sort: Option<&str>, order: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Search commits
Find commits via various criteria on the default branch (usually master
). This method returns up to 100 results per page.
When searching for commits, you can get text match metadata for the message field when you provide the text-match
media type. For more details about how to receive highlighted search results, see Text match
metadata.
For example, if you want to find commits related to CSS in the octocat/Spoon-Knife repository. Your query would look something like this:
q=repo:octocat/Spoon-Knife+css
Sourcepub async fn search_issues_and_pull_requests(
&self,
q: &str,
sort: Option<&str>,
order: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn search_issues_and_pull_requests( &self, q: &str, sort: Option<&str>, order: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Search issues and pull requests
Find issues by state and keyword. This method returns up to 100 results per page.
When searching for issues, you can get text match metadata for the issue title, issue body, and issue comment body fields when you pass the text-match
media type. For more details about how to receive highlighted
search results, see Text match metadata.
For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this.
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, which means the oldest issues appear first in the search results.
Note: For user-to-server 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.”
Sourcepub async fn search_labels(
&self,
repository_id: i64,
q: &str,
sort: Option<&str>,
order: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn search_labels( &self, repository_id: i64, q: &str, sort: Option<&str>, order: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Search labels
Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results per page.
When searching for labels, you can get text match metadata for the label name and description fields when you pass the text-match
media type. For more details about how to receive highlighted search results, see Text match metadata.
For example, if you want to find labels in the linguist
repository that match bug
, defect
, or enhancement
. Your query might look like this:
q=bug+defect+enhancement&repository_id=64778136
The labels that best match the query appear first in the search results.
Sourcepub async fn search_repos(
&self,
q: &str,
sort: Option<&str>,
order: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn search_repos( &self, q: &str, sort: Option<&str>, order: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Search repositories
Find repositories via various criteria. This method returns up to 100 results per page.
When searching for repositories, you can get text match metadata for the name and description fields when you pass the text-match
media type. For more details about how to receive highlighted search results, see Text match metadata.
For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this:
q=tetris+language:assembly&sort=stars&order=desc
This query searches for repositories with the word tetris
in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results.
Sourcepub async fn search_topics(
&self,
q: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn search_topics( &self, q: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Search topics
Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results per page. See “Searching topics” for a detailed list of qualifiers.
When searching for topics, you can get text match metadata for the topic’s short_description, description, name, or display_name field when you pass the text-match
media type. For more details about how to receive highlighted search results, see Text match metadata.
For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics your query might look like this:
q=ruby+is:featured
This query searches for topics with the keyword ruby
and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results.
Sourcepub async fn search_users(
&self,
q: &str,
sort: Option<&str>,
order: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn search_users( &self, q: &str, sort: Option<&str>, order: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Search users
Find users via various criteria. This method returns up to 100 results per page.
When searching for users, you can get text match metadata for the issue login, email, and name fields when you pass the text-match
media type. For more details about highlighting search results, see Text match metadata. For more details about how to receive highlighted search results, see Text match metadata.
For example, if you’re looking for a list of popular users, you might try this query:
q=tom+repos:%3E42+followers:%3E1000
This query searches for users with the name tom
. The results are restricted to users with more than 42 repositories and over 1,000 followers.
Sourcepub async fn teams_get_legacy(
&self,
team_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_get_legacy( &self, team_id: i64, ) -> Result<Response<Body>, ApiError>
Get a team (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the Get a team by name endpoint.
Sourcepub async fn teams_delete_legacy(
&self,
team_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_delete_legacy( &self, team_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a team (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Delete a team endpoint.
To delete a team, the authenticated user must be an organization owner or team maintainer.
If you are an organization owner, deleting a parent team will delete all of its child teams as well.
Sourcepub async fn teams_update_legacy<Content>(
&self,
team_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_update_legacy<Content>( &self, team_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a team (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Update a team endpoint.
To edit a team, the authenticated user must either be an organization owner or a team maintainer.
Note: With nested teams, the privacy
for parent teams cannot be secret
.
§Content
Sourcepub async fn teams_list_discussions_legacy(
&self,
team_id: i64,
direction: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_discussions_legacy( &self, team_id: i64, direction: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List discussions (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List discussions
endpoint.
List all discussions on a team’s page. OAuth access tokens require the read:discussion
scope.
Sourcepub async fn teams_create_discussion_legacy<Content>(
&self,
team_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_create_discussion_legacy<Content>( &self, team_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a discussion (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create a discussion
endpoint.
Creates a new discussion post on a team’s page. OAuth access tokens require the write:discussion
scope.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
§Content
Sourcepub async fn teams_get_discussion_legacy(
&self,
team_id: i64,
discussion_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_get_discussion_legacy( &self, team_id: i64, discussion_number: i64, ) -> Result<Response<Body>, ApiError>
Get a discussion (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Get a discussion endpoint.
Get a specific discussion on a team’s page. OAuth access tokens require the read:discussion
scope.
Sourcepub async fn teams_delete_discussion_legacy(
&self,
team_id: i64,
discussion_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_delete_discussion_legacy( &self, team_id: i64, discussion_number: i64, ) -> Result<Response<Body>, ApiError>
Delete a discussion (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Delete a discussion
endpoint.
Delete a discussion from a team’s page. OAuth access tokens require the write:discussion
scope.
Sourcepub async fn teams_update_discussion_legacy<Content>(
&self,
team_id: i64,
discussion_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_update_discussion_legacy<Content>( &self, team_id: i64, discussion_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a discussion (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Update a discussion endpoint.
Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the write:discussion
scope.
§Content
Sourcepub async fn teams_list_discussion_comments_legacy(
&self,
team_id: i64,
discussion_number: i64,
direction: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_discussion_comments_legacy( &self, team_id: i64, discussion_number: i64, direction: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List discussion comments (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List discussion comments endpoint.
List all comments on a team discussion. OAuth access tokens require the read:discussion
scope.
Sourcepub async fn teams_create_discussion_comment_legacy<Content>(
&self,
team_id: i64,
discussion_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_create_discussion_comment_legacy<Content>( &self, team_id: i64, discussion_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a discussion comment (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create a discussion comment endpoint.
Creates a new comment on a team discussion. OAuth access tokens require the write:discussion
scope.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
§Content
Sourcepub async fn teams_get_discussion_comment_legacy(
&self,
team_id: i64,
discussion_number: i64,
comment_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_get_discussion_comment_legacy( &self, team_id: i64, discussion_number: i64, comment_number: i64, ) -> Result<Response<Body>, ApiError>
Get a discussion comment (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Get a discussion comment endpoint.
Get a specific comment on a team discussion. OAuth access tokens require the read:discussion
scope.
Sourcepub async fn teams_delete_discussion_comment_legacy(
&self,
team_id: i64,
discussion_number: i64,
comment_number: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_delete_discussion_comment_legacy( &self, team_id: i64, discussion_number: i64, comment_number: i64, ) -> Result<Response<Body>, ApiError>
Delete a discussion comment (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Delete a discussion comment endpoint.
Deletes a comment on a team discussion. OAuth access tokens require the write:discussion
scope.
Sourcepub async fn teams_update_discussion_comment_legacy<Content>(
&self,
team_id: i64,
discussion_number: i64,
comment_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_update_discussion_comment_legacy<Content>( &self, team_id: i64, discussion_number: i64, comment_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a discussion comment (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Update a discussion comment endpoint.
Edits the body text of a discussion comment. OAuth access tokens require the write:discussion
scope.
§Content
Sourcepub async fn reactions_list_for_team_discussion_comment_legacy(
&self,
team_id: i64,
discussion_number: i64,
comment_number: i64,
content: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_list_for_team_discussion_comment_legacy( &self, team_id: i64, discussion_number: i64, comment_number: i64, content: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List reactions for a team discussion comment (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List reactions for a team discussion comment
endpoint.
List the reactions to a team discussion comment. OAuth access tokens require the read:discussion
scope.
Sourcepub async fn reactions_create_for_team_discussion_comment_legacy<Content>(
&self,
team_id: i64,
discussion_number: i64,
comment_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_create_for_team_discussion_comment_legacy<Content>( &self, team_id: i64, discussion_number: i64, comment_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create reaction for a team discussion comment (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new “Create reaction for a team discussion comment” endpoint.
Create a reaction to a team discussion comment. OAuth access tokens require the write:discussion
scope. A response with an HTTP 200
status means that you already added the reaction type to this team discussion comment.
§Content
Sourcepub async fn reactions_list_for_team_discussion_legacy(
&self,
team_id: i64,
discussion_number: i64,
content: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_list_for_team_discussion_legacy( &self, team_id: i64, discussion_number: i64, content: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List reactions for a team discussion (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List reactions for a team discussion
endpoint.
List the reactions to a team discussion. OAuth access tokens require the read:discussion
scope.
Sourcepub async fn reactions_create_for_team_discussion_legacy<Content>(
&self,
team_id: i64,
discussion_number: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn reactions_create_for_team_discussion_legacy<Content>( &self, team_id: i64, discussion_number: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create reaction for a team discussion (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create reaction for a team discussion
endpoint.
Create a reaction to a team discussion. OAuth access tokens require the write:discussion
scope. A response with an HTTP 200
status means that you already added the reaction type to this team discussion.
§Content
Sourcepub async fn teams_list_pending_invitations_legacy(
&self,
team_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_pending_invitations_legacy( &self, team_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List pending team invitations (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List pending team invitations
endpoint.
The return hash contains a role
field which refers to the Organization Invitation role and will be one of the following values: direct_member
, admin
, billing_manager
, hiring_manager
, or reinstate
. If the invitee is not a GitHub member, the login
field in the return hash will be null
.
Sourcepub async fn teams_list_members_legacy(
&self,
team_id: i64,
role: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_members_legacy( &self, team_id: i64, role: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List team members (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List team members
endpoint.
Team members will include the members of child teams.
Sourcepub async fn teams_get_member_legacy(
&self,
team_id: i64,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_get_member_legacy( &self, team_id: i64, username: &str, ) -> Result<Response<Body>, ApiError>
Get team member (Legacy)
The “Get team member” endpoint (described below) is deprecated.
We recommend using the Get team membership for a user endpoint instead. It allows you to get both active and pending memberships.
To list members in a team, the team must be visible to the authenticated user.
Sourcepub async fn teams_add_member_legacy(
&self,
team_id: i64,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_add_member_legacy( &self, team_id: i64, username: &str, ) -> Result<Response<Body>, ApiError>
Add team member (Legacy)
The “Add team member” endpoint (described below) is deprecated.
We recommend using the Add or update team membership for a user endpoint instead. It allows you to invite new organization members to your teams.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they’re changing. The person being added to the team must be a member of the team’s organization.
Note: When you have team synchronization set up for a team with your organization’s identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team’s membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see “Synchronizing teams between your identity provider and GitHub.”
Note that you’ll need to set Content-Length
to zero when calling out to this endpoint. For more information, see “HTTP verbs.”
Sourcepub async fn teams_remove_member_legacy(
&self,
team_id: i64,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_remove_member_legacy( &self, team_id: i64, username: &str, ) -> Result<Response<Body>, ApiError>
Remove team member (Legacy)
The “Remove team member” endpoint (described below) is deprecated.
We recommend using the Remove team membership for a user endpoint instead. It allows you to remove both active and pending memberships.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
To remove a team member, the authenticated user must have ‘admin’ permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team.
Note: When you have team synchronization set up for a team with your organization’s identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team’s membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see “Synchronizing teams between your identity provider and GitHub.”
Sourcepub async fn teams_get_membership_for_user_legacy(
&self,
team_id: i64,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_get_membership_for_user_legacy( &self, team_id: i64, username: &str, ) -> Result<Response<Body>, ApiError>
Get team membership for a user (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Get team membership for a user endpoint.
Team members will include the members of child teams.
To get a user’s membership with a team, the team must be visible to the authenticated user.
Note:
The response contains the state
of the membership and the member’s role
.
The role
for organization owners is set to maintainer
. For more information about maintainer
roles, see Create a team.
Sourcepub async fn teams_add_or_update_membership_for_user_legacy<Content>(
&self,
team_id: i64,
username: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_add_or_update_membership_for_user_legacy<Content>( &self, team_id: i64, username: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add or update team membership for a user (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Add or update team membership for a user endpoint.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
If the user is already a member of the team’s organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer.
Note: When you have team synchronization set up for a team with your organization’s identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team’s membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see “Synchronizing teams between your identity provider and GitHub.”
If the user is unaffiliated with the team’s organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the “pending” state until the user accepts the invitation, at which point the membership will transition to the “active” state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner.
If the user is already a member of the team, this endpoint will update the role of the team member’s role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.
§Content
Sourcepub async fn teams_remove_membership_for_user_legacy(
&self,
team_id: i64,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_remove_membership_for_user_legacy( &self, team_id: i64, username: &str, ) -> Result<Response<Body>, ApiError>
Remove team membership for a user (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Remove team membership for a user endpoint.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
To remove a membership between a user and a team, the authenticated user must have ‘admin’ permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.
Note: When you have team synchronization set up for a team with your organization’s identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team’s membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see “Synchronizing teams between your identity provider and GitHub.”
Sourcepub async fn teams_list_projects_legacy(
&self,
team_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_projects_legacy( &self, team_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List team projects (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List team projects
endpoint.
Lists the organization projects for a team.
Sourcepub async fn teams_check_permissions_for_project_legacy(
&self,
team_id: i64,
project_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_check_permissions_for_project_legacy( &self, team_id: i64, project_id: i64, ) -> Result<Response<Body>, ApiError>
Check team permissions for a project (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Check team permissions for a project endpoint.
Checks whether a team has read
, write
, or admin
permissions for an organization project. The response includes projects inherited from a parent team.
Sourcepub async fn teams_add_or_update_project_permissions_legacy<Content>(
&self,
team_id: i64,
project_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_add_or_update_project_permissions_legacy<Content>( &self, team_id: i64, project_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add or update team project permissions (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Add or update team project permissions endpoint.
Adds an organization project to a team. To add a project to a team or update the team’s permission on a project, the authenticated user must have admin
permissions for the project. The project and team must be part of the same organization.
§Content
Sourcepub async fn teams_remove_project_legacy(
&self,
team_id: i64,
project_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_remove_project_legacy( &self, team_id: i64, project_id: i64, ) -> Result<Response<Body>, ApiError>
Remove a project from a team (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Remove a project from a team endpoint.
Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have read
access to both the team and project, or admin
access to the team or project. Note: This endpoint removes the project from the team, but does not delete it.
Sourcepub async fn teams_list_repos_legacy(
&self,
team_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_repos_legacy( &self, team_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List team repositories (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List team repositories endpoint.
Sourcepub async fn teams_check_permissions_for_repo_legacy(
&self,
team_id: i64,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_check_permissions_for_repo_legacy( &self, team_id: i64, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Check team permissions for a repository (Legacy)
Note: Repositories inherited through a parent team will also be checked.
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Check team permissions for a repository endpoint.
You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom media type via the Accept
header:
Sourcepub async fn teams_add_or_update_repo_permissions_legacy<Content>(
&self,
team_id: i64,
owner: &str,
repo: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_add_or_update_repo_permissions_legacy<Content>( &self, team_id: i64, owner: &str, repo: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add or update team repository permissions (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new “Add or update team repository permissions” endpoint.
To add a repository to a team or update the team’s permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a 422 Unprocessable Entity
status if you attempt to add a repository to a team that is not owned by the organization.
Note that, if you choose not to pass any parameters, you’ll need to set Content-Length
to zero when calling out to this endpoint. For more information, see “HTTP verbs.”
§Content
Sourcepub async fn teams_remove_repo_legacy(
&self,
team_id: i64,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn teams_remove_repo_legacy( &self, team_id: i64, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Remove a repository from a team (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Remove a repository from a team endpoint.
If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team.
Sourcepub async fn teams_list_idp_groups_for_legacy(
&self,
team_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_idp_groups_for_legacy( &self, team_id: i64, ) -> Result<Response<Body>, ApiError>
List IdP groups for a team (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List IdP groups for a team
endpoint.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
List IdP groups connected to a team on GitHub.
Sourcepub async fn teams_create_or_update_idp_group_connections_legacy<Content>(
&self,
team_id: i64,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn teams_create_or_update_idp_group_connections_legacy<Content>( &self, team_id: i64, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create or update IdP group connections (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Create or update IdP group connections
endpoint.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty groups
array will remove all connections for a team.
§Content
Sourcepub async fn teams_list_child_legacy(
&self,
team_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_child_legacy( &self, team_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List child teams (Legacy)
Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List child teams
endpoint.
Sourcepub async fn users_get_authenticated(&self) -> Result<Response<Body>, ApiError>
pub async fn users_get_authenticated(&self) -> Result<Response<Body>, ApiError>
Get the authenticated user
If the authenticated user is authenticated through basic authentication or OAuth with the user
scope, then the response lists public and private profile information.
If the authenticated user is authenticated through OAuth without the user
scope, then the response lists only public profile information.
Sourcepub async fn users_update_authenticated<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn users_update_authenticated<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update the authenticated user
Note: If your email is set to private and you send an email
parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API.
§Content
Sourcepub async fn users_list_blocked_by_authenticated_user(
&self,
) -> Result<Response<Body>, ApiError>
pub async fn users_list_blocked_by_authenticated_user( &self, ) -> Result<Response<Body>, ApiError>
List users blocked by the authenticated user
List the users you’ve blocked on your personal account.
Sourcepub async fn users_check_blocked(
&self,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn users_check_blocked( &self, username: &str, ) -> Result<Response<Body>, ApiError>
Check if a user is blocked by the authenticated user
Sourcepub async fn users_block(
&self,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn users_block( &self, username: &str, ) -> Result<Response<Body>, ApiError>
Block a user
Sourcepub async fn users_unblock(
&self,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn users_unblock( &self, username: &str, ) -> Result<Response<Body>, ApiError>
Unblock a user
Sourcepub async fn codespaces_list_for_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
repository_id: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_list_for_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, repository_id: Option<i64>, ) -> Result<Response<Body>, ApiError>
List codespaces for the authenticated user
Lists the authenticated user’s codespaces.
You must authenticate using an access token with the codespace
scope to use this endpoint.
GitHub Apps must have read access to the codespaces
repository permission to use this endpoint.
Sourcepub async fn codespaces_create_for_authenticated_user<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_create_for_authenticated_user<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a codespace for the authenticated user
Creates a new codespace, owned by the authenticated user.
This endpoint requires either a repository_id
OR a pull_request
but not both.
You must authenticate using an access token with the codespace
scope to use this endpoint.
GitHub Apps must have write access to the codespaces
repository permission to use this endpoint.
§Content
Sourcepub async fn codespaces_list_secrets_for_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_list_secrets_for_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List secrets for the authenticated user
Lists all secrets available for a user’s Codespaces without revealing their encrypted values.
You must authenticate using an access token with the codespace
or codespace:secrets
scope to use this endpoint. User must have Codespaces access to use this endpoint.
GitHub Apps must have read access to the codespaces_user_secrets
user permission to use this endpoint.
Sourcepub async fn codespaces_get_public_key_for_authenticated_user(
&self,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_get_public_key_for_authenticated_user( &self, ) -> Result<Response<Body>, ApiError>
Get public key for the authenticated user
Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets.
You must authenticate using an access token with the codespace
or codespace:secrets
scope to use this endpoint. User must have Codespaces access to use this endpoint.
GitHub Apps must have read access to the codespaces_user_secrets
user permission to use this endpoint.
Sourcepub async fn codespaces_get_secret_for_authenticated_user(
&self,
secret_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_get_secret_for_authenticated_user( &self, secret_name: &str, ) -> Result<Response<Body>, ApiError>
Get a secret for the authenticated user
Gets a secret available to a user’s codespaces without revealing its encrypted value.
You must authenticate using an access token with the codespace
or codespace:secrets
scope to use this endpoint. User must have Codespaces access to use this endpoint.
GitHub Apps must have read access to the codespaces_user_secrets
user permission to use this endpoint.
Sourcepub async fn codespaces_create_or_update_secret_for_authenticated_user<Content>(
&self,
secret_name: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_create_or_update_secret_for_authenticated_user<Content>( &self, secret_name: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create or update a secret for the authenticated user
Creates or updates a secret for a user’s codespace with an encrypted value. Encrypt your secret using LibSodium.
You must authenticate using an access token with the codespace
or codespace:secrets
scope to use this endpoint. User must also have Codespaces access to use this endpoint.
GitHub Apps must have read access to the codespaces_user_secrets
user permission and codespaces_secrets
repository permission on all referenced repositories to use this endpoint.
§Example encrypting a secret using Node.js
Encrypt your secret using the tweetsodium library.
const sodium = require('tweetsodium');
const key = "base64-encoded-public-key";
const value = "plain-text-secret";
// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
console.log(encrypted);
§Example encrypting a secret using Python
Encrypt your secret using pynacl with Python 3.
from base64 import b64encode
from nacl import encoding, public
def encrypt(public_key: str, secret_value: str) -> str:
"""Encrypt a Unicode string using the public key."""
public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
sealed_box = public.SealedBox(public_key)
encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
return b64encode(encrypted).decode("utf-8")
§Example encrypting a secret using C#
Encrypt your secret using the Sodium.Core package.
var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));
§Example encrypting a secret using Ruby
Encrypt your secret using the rbnacl gem.
require "rbnacl"
require "base64"
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")
# Print the base64 encoded secret
puts Base64.strict_encode64(encrypted_secret)
§Content
Sourcepub async fn codespaces_delete_secret_for_authenticated_user(
&self,
secret_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_delete_secret_for_authenticated_user( &self, secret_name: &str, ) -> Result<Response<Body>, ApiError>
Delete a secret for the authenticated user
Deletes a secret from a user’s codespaces using the secret name. Deleting the secret will remove access from all codespaces that were allowed to access the secret.
You must authenticate using an access token with the codespace
or codespace:secrets
scope to use this endpoint. User must have Codespaces access to use this endpoint.
GitHub Apps must have write access to the codespaces_user_secrets
user permission to use this endpoint.
Sourcepub async fn codespaces_list_repositories_for_secret_for_authenticated_user(
&self,
secret_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_list_repositories_for_secret_for_authenticated_user( &self, secret_name: &str, ) -> Result<Response<Body>, ApiError>
List selected repositories for a user secret
List the repositories that have been granted the ability to use a user’s codespace secret.
You must authenticate using an access token with the codespace
or codespace:secrets
scope to use this endpoint. User must have Codespaces access to use this endpoint.
GitHub Apps must have read access to the codespaces_user_secrets
user permission and write access to the codespaces_secrets
repository permission on all referenced repositories to use this endpoint.
Sourcepub async fn codespaces_set_repositories_for_secret_for_authenticated_user<Content>(
&self,
secret_name: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_set_repositories_for_secret_for_authenticated_user<Content>( &self, secret_name: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set selected repositories for a user secret
Select the repositories that will use a user’s codespace secret.
You must authenticate using an access token with the codespace
or codespace:secrets
scope to use this endpoint. User must have Codespaces access to use this endpoint.
GitHub Apps must have write access to the codespaces_user_secrets
user permission and write access to the codespaces_secrets
repository permission on all referenced repositories to use this endpoint.
§Content
Sourcepub async fn codespaces_add_repository_for_secret_for_authenticated_user(
&self,
secret_name: &str,
repository_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_add_repository_for_secret_for_authenticated_user( &self, secret_name: &str, repository_id: i64, ) -> Result<Response<Body>, ApiError>
Add a selected repository to a user secret
Adds a repository to the selected repositories for a user’s codespace secret.
You must authenticate using an access token with the codespace
or codespace:secrets
scope to use this endpoint. User must have Codespaces access to use this endpoint.
GitHub Apps must have write access to the codespaces_user_secrets
user permission and write access to the codespaces_secrets
repository permission on the referenced repository to use this endpoint.
Sourcepub async fn codespaces_remove_repository_for_secret_for_authenticated_user(
&self,
secret_name: &str,
repository_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_remove_repository_for_secret_for_authenticated_user( &self, secret_name: &str, repository_id: i64, ) -> Result<Response<Body>, ApiError>
Remove a selected repository from a user secret
Removes a repository from the selected repositories for a user’s codespace secret.
You must authenticate using an access token with the codespace
or codespace:secrets
scope to use this endpoint. User must have Codespaces access to use this endpoint.
GitHub Apps must have write access to the codespaces_user_secrets
user permission to use this endpoint.
Sourcepub async fn codespaces_get_for_authenticated_user(
&self,
codespace_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_get_for_authenticated_user( &self, codespace_name: &str, ) -> Result<Response<Body>, ApiError>
Get a codespace for the authenticated user
Gets information about a user’s codespace.
You must authenticate using an access token with the codespace
scope to use this endpoint.
GitHub Apps must have read access to the codespaces
repository permission to use this endpoint.
Sourcepub async fn codespaces_delete_for_authenticated_user(
&self,
codespace_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_delete_for_authenticated_user( &self, codespace_name: &str, ) -> Result<Response<Body>, ApiError>
Delete a codespace for the authenticated user
Deletes a user’s codespace.
You must authenticate using an access token with the codespace
scope to use this endpoint.
GitHub Apps must have write access to the codespaces
repository permission to use this endpoint.
Sourcepub async fn codespaces_update_for_authenticated_user<Content>(
&self,
codespace_name: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_update_for_authenticated_user<Content>( &self, codespace_name: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update a codespace for the authenticated user
Updates a codespace owned by the authenticated user. Currently only the codespace’s machine type and recent folders can be modified using this endpoint.
If you specify a new machine type it will be applied the next time your codespace is started.
You must authenticate using an access token with the codespace
scope to use this endpoint.
GitHub Apps must have write access to the codespaces
repository permission to use this endpoint.
§Content
Sourcepub async fn codespaces_export_for_authenticated_user(
&self,
codespace_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_export_for_authenticated_user( &self, codespace_name: &str, ) -> Result<Response<Body>, ApiError>
Export a codespace for the authenticated user
Triggers an export of the specified codespace and returns a URL and ID where the status of the export can be monitored.
You must authenticate using a personal access token with the codespace
scope to use this endpoint.
GitHub Apps must have write access to the codespaces_lifecycle_admin
repository permission to use this endpoint.
Sourcepub async fn codespaces_get_export_details_for_authenticated_user(
&self,
codespace_name: &str,
export_id: &str,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_get_export_details_for_authenticated_user( &self, codespace_name: &str, export_id: &str, ) -> Result<Response<Body>, ApiError>
Get details about a codespace export
Gets information about an export of a codespace.
You must authenticate using a personal access token with the codespace
scope to use this endpoint.
GitHub Apps must have read access to the codespaces_lifecycle_admin
repository permission to use this endpoint.
Sourcepub async fn codespaces_codespace_machines_for_authenticated_user(
&self,
codespace_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_codespace_machines_for_authenticated_user( &self, codespace_name: &str, ) -> Result<Response<Body>, ApiError>
List machine types for a codespace
List the machine types a codespace can transition to use.
You must authenticate using an access token with the codespace
scope to use this endpoint.
GitHub Apps must have read access to the codespaces_metadata
repository permission to use this endpoint.
Sourcepub async fn codespaces_start_for_authenticated_user(
&self,
codespace_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_start_for_authenticated_user( &self, codespace_name: &str, ) -> Result<Response<Body>, ApiError>
Start a codespace for the authenticated user
Starts a user’s codespace.
You must authenticate using an access token with the codespace
scope to use this endpoint.
GitHub Apps must have write access to the codespaces_lifecycle_admin
repository permission to use this endpoint.
Sourcepub async fn codespaces_stop_for_authenticated_user(
&self,
codespace_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn codespaces_stop_for_authenticated_user( &self, codespace_name: &str, ) -> Result<Response<Body>, ApiError>
Stop a codespace for the authenticated user
Stops a user’s codespace.
You must authenticate using an access token with the codespace
scope to use this endpoint.
GitHub Apps must have write access to the codespaces_lifecycle_admin
repository permission to use this endpoint.
Sourcepub async fn users_set_primary_email_visibility_for_authenticated_user<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn users_set_primary_email_visibility_for_authenticated_user<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set primary email visibility for the authenticated user
Sets the visibility for your primary email addresses.
§Content
Sourcepub async fn users_list_emails_for_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn users_list_emails_for_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List email addresses for the authenticated user
Lists all of your email addresses, and specifies which one is visible to the public. This endpoint is accessible with the user:email
scope.
Sourcepub async fn users_add_email_for_authenticated_user<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn users_add_email_for_authenticated_user<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Add an email address for the authenticated user
This endpoint is accessible with the user
scope.
§Content
Sourcepub async fn users_delete_email_for_authenticated_user<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn users_delete_email_for_authenticated_user<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Delete an email address for the authenticated user
This endpoint is accessible with the user
scope.
§Content
Sourcepub async fn users_list_followers_for_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn users_list_followers_for_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List followers of the authenticated user
Lists the people following the authenticated user.
Sourcepub async fn users_list_followed_by_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn users_list_followed_by_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List the people the authenticated user follows
Lists the people who the authenticated user follows.
Sourcepub async fn users_check_person_is_followed_by_authenticated(
&self,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn users_check_person_is_followed_by_authenticated( &self, username: &str, ) -> Result<Response<Body>, ApiError>
Check if a person is followed by the authenticated user
Sourcepub async fn users_follow(
&self,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn users_follow( &self, username: &str, ) -> Result<Response<Body>, ApiError>
Follow a user
Note that you’ll need to set Content-Length
to zero when calling out to this endpoint. For more information, see “HTTP verbs.”
Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the user:follow
scope.
Sourcepub async fn users_unfollow(
&self,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn users_unfollow( &self, username: &str, ) -> Result<Response<Body>, ApiError>
Unfollow a user
Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the user:follow
scope.
Sourcepub async fn users_list_gpg_keys_for_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn users_list_gpg_keys_for_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List GPG keys for the authenticated user
Lists the current user’s GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least read:gpg_key
scope.
Sourcepub async fn users_create_gpg_key_for_authenticated_user<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn users_create_gpg_key_for_authenticated_user<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn users_get_gpg_key_for_authenticated_user(
&self,
gpg_key_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn users_get_gpg_key_for_authenticated_user( &self, gpg_key_id: i64, ) -> Result<Response<Body>, ApiError>
Get a GPG key for the authenticated user
View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least read:gpg_key
scope.
Sourcepub async fn users_delete_gpg_key_for_authenticated_user(
&self,
gpg_key_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn users_delete_gpg_key_for_authenticated_user( &self, gpg_key_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a GPG key for the authenticated user
Removes a GPG key from the authenticated user’s GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least admin:gpg_key
scope.
Sourcepub async fn apps_list_installations_for_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn apps_list_installations_for_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List app installations accessible to the user access token
Lists installations of your GitHub App that the authenticated user has explicit permission (:read
, :write
, or :admin
) to access.
You must use a user-to-server OAuth access token, created for a user who has authorized your GitHub App, to access this endpoint.
The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.
You can find the permissions for the installation under the permissions
key.
Sourcepub async fn apps_list_installation_repos_for_authenticated_user(
&self,
installation_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn apps_list_installation_repos_for_authenticated_user( &self, installation_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repositories accessible to the user access token
List repositories that the authenticated user has explicit permission (:read
, :write
, or :admin
) to access for an installation.
The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.
You must use a user-to-server OAuth access token, created for a user who has authorized your GitHub App, to access this endpoint.
The access the user has to each repository is included in the hash under the permissions
key.
Sourcepub async fn apps_add_repo_to_installation_for_authenticated_user(
&self,
installation_id: i64,
repository_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn apps_add_repo_to_installation_for_authenticated_user( &self, installation_id: i64, repository_id: i64, ) -> Result<Response<Body>, ApiError>
Add a repository to an app installation
Add a single repository to an installation. The authenticated user must have admin access to the repository.
You must use a personal access token (which you can create via the command line or Basic Authentication) to access this endpoint.
Sourcepub async fn apps_remove_repo_from_installation_for_authenticated_user(
&self,
installation_id: i64,
repository_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn apps_remove_repo_from_installation_for_authenticated_user( &self, installation_id: i64, repository_id: i64, ) -> Result<Response<Body>, ApiError>
Remove a repository from an app installation
Remove a single repository from an installation. The authenticated user must have admin access to the repository.
You must use a personal access token (which you can create via the command line or Basic Authentication) to access this endpoint.
Sourcepub async fn interactions_get_restrictions_for_authenticated_user(
&self,
) -> Result<Response<Body>, ApiError>
pub async fn interactions_get_restrictions_for_authenticated_user( &self, ) -> Result<Response<Body>, ApiError>
Get interaction restrictions for your public repositories
Shows which type of GitHub user can interact with your public repositories and when the restriction expires.
Sourcepub async fn interactions_set_restrictions_for_authenticated_user<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn interactions_set_restrictions_for_authenticated_user<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Set interaction restrictions for your public repositories
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.
§Content
Sourcepub async fn interactions_remove_restrictions_for_authenticated_user(
&self,
) -> Result<Response<Body>, ApiError>
pub async fn interactions_remove_restrictions_for_authenticated_user( &self, ) -> Result<Response<Body>, ApiError>
Remove interaction restrictions from your public repositories
Removes any interaction restrictions from your public repositories.
Sourcepub async fn issues_list_for_authenticated_user(
&self,
filter: &IssueFilter<'_>,
sort: &Sort<'_>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn issues_list_for_authenticated_user( &self, filter: &IssueFilter<'_>, sort: &Sort<'_>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List user account issues assigned to the authenticated user
List issues across owned and member repositories assigned to the authenticated user.
Note: GitHub’s REST API v3 considers every pull request an issue, but not every issue is a pull request. For this
reason, “Issues” endpoints may return both issues and pull requests in the response. You can identify pull requests by
the pull_request
key. Be aware that the id
of a pull request returned from “Issues” endpoints will be an issue id. To find out the pull
request id, use the “List pull requests” endpoint.
Sourcepub async fn users_list_public_ssh_keys_for_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn users_list_public_ssh_keys_for_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List public SSH keys for the authenticated user
Lists the public SSH keys for the authenticated user’s GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least read:public_key
scope.
Sourcepub async fn users_create_public_ssh_key_for_authenticated_user<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn users_create_public_ssh_key_for_authenticated_user<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn users_get_public_ssh_key_for_authenticated_user(
&self,
key_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn users_get_public_ssh_key_for_authenticated_user( &self, key_id: i64, ) -> Result<Response<Body>, ApiError>
Get a public SSH key for the authenticated user
View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least read:public_key
scope.
Sourcepub async fn users_delete_public_ssh_key_for_authenticated_user(
&self,
key_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn users_delete_public_ssh_key_for_authenticated_user( &self, key_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a public SSH key for the authenticated user
Removes a public SSH key from the authenticated user’s GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least admin:public_key
scope.
Sourcepub async fn apps_list_subscriptions_for_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn apps_list_subscriptions_for_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List subscriptions for the authenticated user
Lists the active subscriptions for the authenticated user. You must use a user-to-server OAuth access token, created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an OAuth token.
Sourcepub async fn apps_list_subscriptions_for_authenticated_user_stubbed(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn apps_list_subscriptions_for_authenticated_user_stubbed( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List subscriptions for the authenticated user (stubbed)
Lists the active subscriptions for the authenticated user. You must use a user-to-server OAuth access token, created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an OAuth token.
Sourcepub async fn orgs_list_memberships_for_authenticated_user(
&self,
state: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_list_memberships_for_authenticated_user( &self, state: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List organization memberships for the authenticated user
Sourcepub async fn orgs_get_membership_for_authenticated_user(
&self,
org: &str,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_get_membership_for_authenticated_user( &self, org: &str, ) -> Result<Response<Body>, ApiError>
Get an organization membership for the authenticated user
Sourcepub async fn orgs_update_membership_for_authenticated_user<Content>(
&self,
org: &str,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_update_membership_for_authenticated_user<Content>( &self, org: &str, theContent: Content, ) -> Result<Response<Body>, ApiError>
Update an organization membership for the authenticated user
§Content
Sourcepub async fn migrations_list_for_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_list_for_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn migrations_start_for_authenticated_user<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_start_for_authenticated_user<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn migrations_get_status_for_authenticated_user(
&self,
migration_id: i64,
exclude: Option<&[Cow<'_, str>]>,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_get_status_for_authenticated_user( &self, migration_id: i64, exclude: Option<&[Cow<'_, str>]>, ) -> Result<Response<Body>, ApiError>
Get a user migration status
Fetches a single user migration. The response includes the state
of the migration, which can be one of the following values:
pending
- the migration hasn’t started yet.exporting
- the migration is in progress.exported
- the migration finished successfully.failed
- the migration failed.
Once the migration has been exported
you can download the migration archive.
Sourcepub async fn migrations_get_archive_for_authenticated_user(
&self,
migration_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_get_archive_for_authenticated_user( &self, migration_id: i64, ) -> Result<Response<Body>, ApiError>
Download a user migration archive
Fetches the URL to download the migration archive as a tar.gz
file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects:
- attachments
- bases
- commit_comments
- issue_comments
- issue_events
- issues
- milestones
- organizations
- projects
- protected_branches
- pull_request_reviews
- pull_requests
- releases
- repositories
- review_comments
- schema
- users
The archive will also contain an attachments
directory that includes all attachment files uploaded to GitHub.com and a repositories
directory that contains the repository’s Git data.
Sourcepub async fn migrations_delete_archive_for_authenticated_user(
&self,
migration_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_delete_archive_for_authenticated_user( &self, migration_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a user migration archive
Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the List user migrations and Get a user migration status endpoints, will continue to be available even after an archive is deleted.
Sourcepub async fn migrations_unlock_repo_for_authenticated_user(
&self,
migration_id: i64,
repo_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_unlock_repo_for_authenticated_user( &self, migration_id: i64, repo_name: &str, ) -> Result<Response<Body>, ApiError>
Unlock a user repository
Unlocks a repository. You can lock repositories when you start a user migration. Once the migration is complete you can unlock each repository to begin using it again or delete the repository if you no longer need the source data. Returns a status of 404 Not Found
if the repository is not locked.
Sourcepub async fn migrations_list_repos_for_authenticated_user(
&self,
migration_id: i64,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn migrations_list_repos_for_authenticated_user( &self, migration_id: i64, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repositories for a user migration
Lists all the repositories for this user migration.
Sourcepub async fn orgs_list_for_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_list_for_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List organizations for the authenticated user
List organizations for the authenticated user.
OAuth scope requirements
This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org
scope, you can publicize your organization membership with user
scope, etc.). Therefore, this API requires at least user
or read:org
scope. OAuth requests with insufficient scope receive a 403 Forbidden
response.
Sourcepub async fn packages_list_packages_for_authenticated_user(
&self,
package_type: &str,
visibility: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn packages_list_packages_for_authenticated_user( &self, package_type: &str, visibility: Option<&str>, ) -> Result<Response<Body>, ApiError>
List packages for the authenticated user’s namespace
Lists packages owned by the authenticated user within the user’s namespace.
To use this endpoint, you must authenticate using an access token with the packages:read
scope.
If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn packages_get_package_for_authenticated_user(
&self,
package_type: &str,
package_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn packages_get_package_for_authenticated_user( &self, package_type: &str, package_name: &str, ) -> Result<Response<Body>, ApiError>
Get a package for the authenticated user
Gets a specific package for a package owned by the authenticated user.
To use this endpoint, you must authenticate using an access token with the packages:read
scope.
If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn packages_delete_package_for_authenticated_user(
&self,
package_type: &str,
package_name: &str,
) -> Result<Response<Body>, ApiError>
pub async fn packages_delete_package_for_authenticated_user( &self, package_type: &str, package_name: &str, ) -> Result<Response<Body>, ApiError>
Delete a package for the authenticated user
Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.
To use this endpoint, you must authenticate using an access token with the packages:read
and packages:delete
scopes.
If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn packages_restore_package_for_authenticated_user(
&self,
package_type: &str,
package_name: &str,
token: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn packages_restore_package_for_authenticated_user( &self, package_type: &str, package_name: &str, token: Option<&str>, ) -> Result<Response<Body>, ApiError>
Restore a package for the authenticated user
Restores a package owned by the authenticated user.
You can restore a deleted package under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package’s namespace first.
To use this endpoint, you must authenticate using an access token with the packages:read
and packages:write
scopes. If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn packages_get_all_package_versions_for_package_owned_by_authenticated_user(
&self,
package_type: &str,
package_name: &str,
page: Option<i64>,
per_page: Option<i64>,
state: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn packages_get_all_package_versions_for_package_owned_by_authenticated_user( &self, package_type: &str, package_name: &str, page: Option<i64>, per_page: Option<i64>, state: Option<&str>, ) -> Result<Response<Body>, ApiError>
Get all package versions for a package owned by the authenticated user
Returns all package versions for a package owned by the authenticated user.
To use this endpoint, you must authenticate using an access token with the packages:read
scope.
If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn packages_get_package_version_for_authenticated_user(
&self,
package_type: &str,
package_name: &str,
package_version_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn packages_get_package_version_for_authenticated_user( &self, package_type: &str, package_name: &str, package_version_id: i64, ) -> Result<Response<Body>, ApiError>
Get a package version for the authenticated user
Gets a specific package version for a package owned by the authenticated user.
To use this endpoint, you must authenticate using an access token with the packages:read
scope.
If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn packages_delete_package_version_for_authenticated_user(
&self,
package_type: &str,
package_name: &str,
package_version_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn packages_delete_package_version_for_authenticated_user( &self, package_type: &str, package_name: &str, package_version_id: i64, ) -> Result<Response<Body>, ApiError>
Delete a package version for the authenticated user
Deletes a specific package version for a package owned by the authenticated user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.
To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the packages:read
and packages:delete
scopes.
If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn packages_restore_package_version_for_authenticated_user(
&self,
package_type: &str,
package_name: &str,
package_version_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn packages_restore_package_version_for_authenticated_user( &self, package_type: &str, package_name: &str, package_version_id: i64, ) -> Result<Response<Body>, ApiError>
Restore a package version for the authenticated user
Restores a package version owned by the authenticated user.
You can restore a deleted package version under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package’s namespace first.
To use this endpoint, you must authenticate using an access token with the packages:read
and packages:write
scopes. If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn projects_create_for_authenticated_user<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn projects_create_for_authenticated_user<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a user project
§Content
Sourcepub async fn users_list_public_emails_for_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn users_list_public_emails_for_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List public email addresses for the authenticated user
Lists your publicly visible email address, which you can set with the Set primary email visibility for the authenticated user endpoint. This endpoint is accessible with the user:email
scope.
Sourcepub async fn repos_list_for_authenticated_user(
&self,
visibility: Option<&str>,
affiliation: Option<&str>,
type: Option<&str>,
sort: &Sort<'_>,
per_page: Option<i64>,
page: Option<i64>,
since: Option<&str>,
before: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_for_authenticated_user( &self, visibility: Option<&str>, affiliation: Option<&str>, type: Option<&str>, sort: &Sort<'_>, per_page: Option<i64>, page: Option<i64>, since: Option<&str>, before: Option<&str>, ) -> Result<Response<Body>, ApiError>
List repositories for the authenticated user
Lists repositories that the authenticated user has explicit permission (:read
, :write
, or :admin
) to access.
The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.
Sourcepub async fn repos_create_for_authenticated_user<Content>(
&self,
theContent: Content,
) -> Result<Response<Body>, ApiError>
pub async fn repos_create_for_authenticated_user<Content>( &self, theContent: Content, ) -> Result<Response<Body>, ApiError>
Create a repository for the authenticated user
Creates a new repository for the authenticated user.
OAuth scope requirements
When using OAuth, authorizations must include:
public_repo
scope orrepo
scope to create a public repository. Note: For GitHub AE, userepo
scope to create an internal repository.repo
scope to create a private repository.
§Content
Sourcepub async fn repos_list_invitations_for_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_invitations_for_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repository invitations for the authenticated user
When authenticating as a user, this endpoint will list all currently open repository invitations for that user.
Sourcepub async fn repos_decline_invitation_for_authenticated_user(
&self,
invitation_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_decline_invitation_for_authenticated_user( &self, invitation_id: i64, ) -> Result<Response<Body>, ApiError>
Decline a repository invitation
Sourcepub async fn repos_accept_invitation_for_authenticated_user(
&self,
invitation_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn repos_accept_invitation_for_authenticated_user( &self, invitation_id: i64, ) -> Result<Response<Body>, ApiError>
Accept a repository invitation
Sourcepub async fn activity_list_repos_starred_by_authenticated_user(
&self,
sort: &Sort<'_>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_repos_starred_by_authenticated_user( &self, sort: &Sort<'_>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repositories starred by the authenticated user
Lists repositories the authenticated user has starred.
You can also find out when stars were created by passing the following custom media type via the Accept
header:
Sourcepub async fn activity_check_repo_is_starred_by_authenticated_user(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn activity_check_repo_is_starred_by_authenticated_user( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Check if a repository is starred by the authenticated user
Sourcepub async fn activity_star_repo_for_authenticated_user(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn activity_star_repo_for_authenticated_user( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Star a repository for the authenticated user
Note that you’ll need to set Content-Length
to zero when calling out to this endpoint. For more information, see “HTTP verbs.”
Sourcepub async fn activity_unstar_repo_for_authenticated_user(
&self,
owner: &str,
repo: &str,
) -> Result<Response<Body>, ApiError>
pub async fn activity_unstar_repo_for_authenticated_user( &self, owner: &str, repo: &str, ) -> Result<Response<Body>, ApiError>
Unstar a repository for the authenticated user
Sourcepub async fn activity_list_watched_repos_for_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_watched_repos_for_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repositories watched by the authenticated user
Lists repositories the authenticated user is watching.
Sourcepub async fn teams_list_for_authenticated_user(
&self,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn teams_list_for_authenticated_user( &self, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn users_list(
&self,
since: Option<i64>,
per_page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn users_list( &self, since: Option<i64>, per_page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List users
Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts.
Note: Pagination is powered exclusively by the since
parameter. Use the Link header to get the URL for the next page of users.
Sourcepub async fn users_get_by_username(
&self,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn users_get_by_username( &self, username: &str, ) -> Result<Response<Body>, ApiError>
Get a user
Provides publicly available information about someone with a GitHub account.
GitHub Apps with the Plan
user permission can use this endpoint to retrieve information about a user’s GitHub plan. The GitHub App must be authenticated as a user. See “Identifying and authorizing users for GitHub Apps” for details about authentication. For an example response, see ‘Response with GitHub plan information’ below“
The email
key in the following response is the publicly visible email address from your GitHub profile page. When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for email
, then it will have a value of null
. You only see publicly visible email addresses when authenticated with GitHub. For more information, see Authentication.
The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see “Emails API”.
Sourcepub async fn activity_list_events_for_authenticated_user(
&self,
username: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_events_for_authenticated_user( &self, username: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List events for the authenticated user
If you are authenticated as the given user, you will see your private events. Otherwise, you’ll only see public events.
Sourcepub async fn activity_list_org_events_for_authenticated_user(
&self,
username: &str,
org: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_org_events_for_authenticated_user( &self, username: &str, org: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List organization events for the authenticated user
This is the user’s organization dashboard. You must be authenticated as the user to view this.
Sourcepub async fn activity_list_public_events_for_user(
&self,
username: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_public_events_for_user( &self, username: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List public events for a user
Sourcepub async fn users_list_followers_for_user(
&self,
username: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn users_list_followers_for_user( &self, username: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn users_list_following_for_user(
&self,
username: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn users_list_following_for_user( &self, username: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List the people a user follows
Lists the people who the specified user follows.
Sourcepub async fn users_check_following_for_user(
&self,
username: &str,
target_user: &str,
) -> Result<Response<Body>, ApiError>
pub async fn users_check_following_for_user( &self, username: &str, target_user: &str, ) -> Result<Response<Body>, ApiError>
Check if a user follows another user
Sourcepub async fn gists_list_for_user(
&self,
username: &str,
since: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn gists_list_for_user( &self, username: &str, since: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
Sourcepub async fn users_list_gpg_keys_for_user(
&self,
username: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn users_list_gpg_keys_for_user( &self, username: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List GPG keys for a user
Lists the GPG keys for a user. This information is accessible by anyone.
Sourcepub async fn users_get_context_for_user(
&self,
username: &str,
subject_type: Option<&str>,
subject_id: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn users_get_context_for_user( &self, username: &str, subject_type: Option<&str>, subject_id: Option<&str>, ) -> Result<Response<Body>, ApiError>
Get contextual information for a user
Provides hovercard information when authenticated through basic auth or OAuth with the repo
scope. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations.
The subject_type
and subject_id
parameters provide context for the person’s hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about octocat
who owns the Spoon-Knife
repository via cURL, it would look like this:
curl -u username:token
https://api.github.com/users/octocat/hovercard?subject_type=repository&subject_id=1300192
Sourcepub async fn apps_get_user_installation(
&self,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn apps_get_user_installation( &self, username: &str, ) -> Result<Response<Body>, ApiError>
Get a user installation for the authenticated app
Enables an authenticated GitHub App to find the user’s installation information.
You must use a JWT to access this endpoint.
Sourcepub async fn users_list_public_keys_for_user(
&self,
username: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn users_list_public_keys_for_user( &self, username: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List public keys for a user
Lists the verified public SSH keys for a user. This is accessible by anyone.
Sourcepub async fn orgs_list_for_user(
&self,
username: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn orgs_list_for_user( &self, username: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List organizations for a user
List public organization memberships for the specified user.
This method only lists public memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the List organizations for the authenticated user API instead.
Sourcepub async fn packages_list_packages_for_user(
&self,
package_type: &str,
visibility: Option<&str>,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn packages_list_packages_for_user( &self, package_type: &str, visibility: Option<&str>, username: &str, ) -> Result<Response<Body>, ApiError>
List packages for a user
Lists all packages in a user’s namespace for which the requesting user has access.
To use this endpoint, you must authenticate using an access token with the packages:read
scope.
If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn packages_get_package_for_user(
&self,
package_type: &str,
package_name: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn packages_get_package_for_user( &self, package_type: &str, package_name: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Get a package for a user
Gets a specific package metadata for a public package owned by a user.
To use this endpoint, you must authenticate using an access token with the packages:read
scope.
If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn packages_delete_package_for_user(
&self,
package_type: &str,
package_name: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn packages_delete_package_for_user( &self, package_type: &str, package_name: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Delete a package for a user
Deletes an entire package for a user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.
To use this endpoint, you must authenticate using an access token with the packages:read
and packages:delete
scopes. In addition:
- If
package_type
is notcontainer
, your token must also include therepo
scope. - If
package_type
iscontainer
, you must also have admin permissions to the container you want to delete.
Sourcepub async fn packages_restore_package_for_user(
&self,
package_type: &str,
package_name: &str,
username: &str,
token: Option<&str>,
) -> Result<Response<Body>, ApiError>
pub async fn packages_restore_package_for_user( &self, package_type: &str, package_name: &str, username: &str, token: Option<&str>, ) -> Result<Response<Body>, ApiError>
Restore a package for a user
Restores an entire package for a user.
You can restore a deleted package under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package’s namespace first.
To use this endpoint, you must authenticate using an access token with the packages:read
and packages:write
scopes. In addition:
- If
package_type
is notcontainer
, your token must also include therepo
scope. - If
package_type
iscontainer
, you must also have admin permissions to the container that you want to restore.
Sourcepub async fn packages_get_all_package_versions_for_package_owned_by_user(
&self,
package_type: &str,
package_name: &str,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn packages_get_all_package_versions_for_package_owned_by_user( &self, package_type: &str, package_name: &str, username: &str, ) -> Result<Response<Body>, ApiError>
Get all package versions for a package owned by a user
Returns all package versions for a public package owned by a specified user.
To use this endpoint, you must authenticate using an access token with the packages:read
scope.
If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn packages_get_package_version_for_user(
&self,
package_type: &str,
package_name: &str,
package_version_id: i64,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn packages_get_package_version_for_user( &self, package_type: &str, package_name: &str, package_version_id: i64, username: &str, ) -> Result<Response<Body>, ApiError>
Get a package version for a user
Gets a specific package version for a public package owned by a specified user.
At this time, to use this endpoint, you must authenticate using an access token with the packages:read
scope.
If package_type
is not container
, your token must also include the repo
scope.
Sourcepub async fn packages_delete_package_version_for_user(
&self,
package_type: &str,
package_name: &str,
username: &str,
package_version_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn packages_delete_package_version_for_user( &self, package_type: &str, package_name: &str, username: &str, package_version_id: i64, ) -> Result<Response<Body>, ApiError>
Delete package version for a user
Deletes a specific package version for a user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.
To use this endpoint, you must authenticate using an access token with the packages:read
and packages:delete
scopes. In addition:
- If
package_type
is notcontainer
, your token must also include therepo
scope. - If
package_type
iscontainer
, you must also have admin permissions to the container you want to delete.
Sourcepub async fn packages_restore_package_version_for_user(
&self,
package_type: &str,
package_name: &str,
username: &str,
package_version_id: i64,
) -> Result<Response<Body>, ApiError>
pub async fn packages_restore_package_version_for_user( &self, package_type: &str, package_name: &str, username: &str, package_version_id: i64, ) -> Result<Response<Body>, ApiError>
Restore package version for a user
Restores a specific package version for a user.
You can restore a deleted package under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package’s namespace first.
To use this endpoint, you must authenticate using an access token with the packages:read
and packages:write
scopes. In addition:
- If
package_type
is notcontainer
, your token must also include therepo
scope. - If
package_type
iscontainer
, you must also have admin permissions to the container that you want to restore.
Sourcepub async fn projects_list_for_user(
&self,
username: &str,
state: Option<&str>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn projects_list_for_user( &self, username: &str, state: Option<&str>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List user projects
Sourcepub async fn activity_list_received_events_for_user(
&self,
username: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_received_events_for_user( &self, username: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List events received by the authenticated user
These are events that you’ve received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you’ll only see public events.
Sourcepub async fn activity_list_received_public_events_for_user(
&self,
username: &str,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_received_public_events_for_user( &self, username: &str, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List public events received by a user
Sourcepub async fn repos_list_for_user(
&self,
username: &str,
type: Option<&str>,
sort: &Sort<'_>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn repos_list_for_user( &self, username: &str, type: Option<&str>, sort: &Sort<'_>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repositories for a user
Lists public repositories for the specified user. Note: For GitHub AE, this endpoint will list internal repositories for the specified user.
Sourcepub async fn billing_get_github_actions_billing_user(
&self,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn billing_get_github_actions_billing_user( &self, username: &str, ) -> Result<Response<Body>, ApiError>
Get GitHub Actions billing for a user
Gets the summary of the free and paid GitHub Actions minutes used.
Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see “Managing billing for GitHub Actions”.
Access tokens must have the user
scope.
Sourcepub async fn billing_get_github_packages_billing_user(
&self,
username: &str,
) -> Result<Response<Body>, ApiError>
pub async fn billing_get_github_packages_billing_user( &self, username: &str, ) -> Result<Response<Body>, ApiError>
Get GitHub Packages billing for a user
Gets the free and paid storage used for GitHub Packages in gigabytes.
Paid minutes only apply to packages stored for private repositories. For more information, see “Managing billing for GitHub Packages.”
Access tokens must have the user
scope.
Get shared storage billing for a user
Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages.
Paid minutes only apply to packages stored for private repositories. For more information, see “Managing billing for GitHub Packages.”
Access tokens must have the user
scope.
Sourcepub async fn activity_list_repos_starred_by_user(
&self,
username: &str,
sort: &Sort<'_>,
per_page: Option<i64>,
page: Option<i64>,
) -> Result<Response<Body>, ApiError>
pub async fn activity_list_repos_starred_by_user( &self, username: &str, sort: &Sort<'_>, per_page: Option<i64>, page: Option<i64>, ) -> Result<Response<Body>, ApiError>
List repositories starred by a user
Lists repositories a user has starred.
You can also find out when stars were created by passing the following custom media type via the Accept
header: