Struct octorust::apps::Apps [−][src]
pub struct Apps { /* fields omitted */ }
Implementations
Get the authenticated app.
This function performs a GET
to the /app
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#get-the-authenticated-app
Create a GitHub App from a manifest.
This function performs a POST
to the /app-manifests/{code}/conversions
endpoint.
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
.
FROM: https://docs.github.com/rest/reference/apps#create-a-github-app-from-a-manifest
Parameters:
code: &str
Get a webhook configuration for an app.
This function performs a GET
to the /app/hook/config
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#get-a-webhook-configuration-for-an-app
pub async fn update_webhook_config_for_app(
&self,
body: &AppsUpdateWebhookConfigAppRequest
) -> Result<WebhookConfig>
pub async fn update_webhook_config_for_app(
&self,
body: &AppsUpdateWebhookConfigAppRequest
) -> Result<WebhookConfig>
Update a webhook configuration for an app.
This function performs a PATCH
to the /app/hook/config
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#update-a-webhook-configuration-for-an-app
List installations for the authenticated app.
This function performs a GET
to the /app/installations
endpoint.
You must use a JWT to access this endpoint.
The permissions the installation has are included under the permissions
key.
FROM: https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app
Parameters:
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.since: chrono::DateTime<chrono::Utc>
– Only show notifications updated after the given time. This is a timestamp in ISO 8601 format:YYYY-MM-DDTHH:MM:SSZ
.outdated: &str
pub async fn list_all_installations(
&self,
since: Option<DateTime<Utc>>,
outdated: &str
) -> Result<Vec<Installation>>
pub async fn list_all_installations(
&self,
since: Option<DateTime<Utc>>,
outdated: &str
) -> Result<Vec<Installation>>
List installations for the authenticated app.
This function performs a GET
to the /app/installations
endpoint.
As opposed to list_installations
, this function returns all the pages of the request at once.
You must use a JWT to access this endpoint.
The permissions the installation has are included under the permissions
key.
FROM: https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app
Get an installation for the authenticated app.
This function performs a GET
to the /app/installations/{installation_id}
endpoint.
Enables an authenticated GitHub App to find an installation’s information using the installation id. The installation’s account type (target_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.
FROM: https://docs.github.com/rest/reference/apps#get-an-installation-for-the-authenticated-app
Parameters:
installation_id: i64
– installation_id parameter.
Delete an installation for the authenticated app.
This function performs a DELETE
to the /app/installations/{installation_id}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#delete-an-installation-for-the-authenticated-app
Parameters:
installation_id: i64
– installation_id parameter.
pub fn create_installation_access_token<'life0, 'life_self, 'async_recursion>(
&'life_self self,
installation_id: i64,
body: &'life0 AppsCreateInstallationAccessTokenRequest
) -> Pin<Box<dyn Future<Output = Result<InstallationToken>> + Send + 'async_recursion>> where
'life0: 'async_recursion,
'life_self: 'async_recursion,
pub fn create_installation_access_token<'life0, 'life_self, 'async_recursion>(
&'life_self self,
installation_id: i64,
body: &'life0 AppsCreateInstallationAccessTokenRequest
) -> Pin<Box<dyn Future<Output = Result<InstallationToken>> + Send + 'async_recursion>> where
'life0: 'async_recursion,
'life_self: 'async_recursion,
Create an installation access token for an app.
This function performs a POST
to the /app/installations/{installation_id}/access_tokens
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps/#create-an-installation-access-token-for-an-app
Parameters:
installation_id: i64
– installation_id parameter.
Suspend an app installation.
This function performs a PUT
to the /app/installations/{installation_id}/suspended
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#suspend-an-app-installation
Parameters:
installation_id: i64
– installation_id parameter.
Unsuspend an app installation.
This function performs a DELETE
to the /app/installations/{installation_id}/suspended
endpoint.
Removes a GitHub App installation suspension.
You must use a JWT to access this endpoint.
FROM: https://docs.github.com/rest/reference/apps#unsuspend-an-app-installation
Parameters:
installation_id: i64
– installation_id parameter.
Delete an app authorization.
This function performs a DELETE
to the /applications/{client_id}/grant
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#delete-an-app-authorization
Parameters:
client_id: &str
– The client ID of your GitHub app.
Revoke a grant for an application.
This function performs a DELETE
to the /applications/{client_id}/grants/{access_token}
endpoint.
Deprecation Notice: GitHub will discontinue OAuth endpoints that contain access_token
in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving access_token
to the request body. For more information, see the blog post.
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 token as :access_token
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 Applications settings page under “Authorized OAuth Apps” on GitHub.
FROM: https://docs.github.com/rest/reference/apps#revoke-a-grant-for-an-application
Parameters:
client_id: &str
– The client ID of your GitHub app.access_token: &str
pub async fn check_token(
&self,
client_id: &str,
body: &AppsCheckTokenRequest
) -> Result<Authorization>
pub async fn check_token(
&self,
client_id: &str,
body: &AppsCheckTokenRequest
) -> Result<Authorization>
Check a token.
This function performs a POST
to the /applications/{client_id}/token
endpoint.
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
.
FROM: https://docs.github.com/rest/reference/apps#check-a-token
Parameters:
client_id: &str
– The client ID of your GitHub app.
pub async fn delete_token(
&self,
client_id: &str,
body: &AppsDeleteTokenRequest
) -> Result<()>
pub async fn delete_token(
&self,
client_id: &str,
body: &AppsDeleteTokenRequest
) -> Result<()>
Delete an app token.
This function performs a DELETE
to the /applications/{client_id}/token
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#delete-an-app-token
Parameters:
client_id: &str
– The client ID of your GitHub app.
pub async fn reset_token(
&self,
client_id: &str,
body: &AppsCheckTokenRequest
) -> Result<Authorization>
pub async fn reset_token(
&self,
client_id: &str,
body: &AppsCheckTokenRequest
) -> Result<Authorization>
Reset a token.
This function performs a PATCH
to the /applications/{client_id}/token
endpoint.
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
.
FROM: https://docs.github.com/rest/reference/apps#reset-a-token
Parameters:
client_id: &str
– The client ID of your GitHub app.
pub async fn scope_token(
&self,
client_id: &str,
body: &AppsScopeTokenRequest
) -> Result<Authorization>
pub async fn scope_token(
&self,
client_id: &str,
body: &AppsScopeTokenRequest
) -> Result<Authorization>
Create a scoped access token.
This function performs a POST
to the /applications/{client_id}/token/scoped
endpoint.
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
.
FROM: https://docs.github.com/rest/reference/apps#create-a-scoped-access-token
Parameters:
client_id: &str
– The client ID of your GitHub app.
Check an authorization.
This function performs a GET
to the /applications/{client_id}/tokens/{access_token}
endpoint.
Deprecation Notice: GitHub will discontinue OAuth endpoints that contain access_token
in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving access_token
to the request body. For more information, see the blog post.
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 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
.
FROM: https://docs.github.com/rest/reference/apps#check-an-authorization
Parameters:
client_id: &str
– The client ID of your GitHub app.access_token: &str
Reset an authorization.
This function performs a POST
to the /applications/{client_id}/tokens/{access_token}
endpoint.
Deprecation Notice: GitHub will discontinue OAuth endpoints that contain access_token
in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving access_token
to the request body. For more information, see the blog post.
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
.
FROM: https://docs.github.com/rest/reference/apps#reset-an-authorization
Parameters:
client_id: &str
– The client ID of your GitHub app.access_token: &str
Revoke an authorization for an application.
This function performs a DELETE
to the /applications/{client_id}/tokens/{access_token}
endpoint.
Deprecation Notice: GitHub will discontinue OAuth endpoints that contain access_token
in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving access_token
to the request body. For more information, see the blog post.
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.
FROM: https://docs.github.com/rest/reference/apps#revoke-an-authorization-for-an-application
Parameters:
client_id: &str
– The client ID of your GitHub app.access_token: &str
Get an app.
This function performs a GET
to the /apps/{app_slug}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps/#get-an-app
Parameters:
app_slug: &str
pub async fn list_repos_accessible_to_installation(
&self,
per_page: i64,
page: i64
) -> Result<AppsListInstallationReposResponse>
pub async fn list_repos_accessible_to_installation(
&self,
per_page: i64,
page: i64
) -> Result<AppsListInstallationReposResponse>
List repositories accessible to the app installation.
This function performs a GET
to the /installation/repositories
endpoint.
List repositories that an app installation can access.
You must use an installation access token to access this endpoint.
FROM: https://docs.github.com/rest/reference/apps#list-repositories-accessible-to-the-app-installation
Parameters:
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
Revoke an installation access token.
This function performs a DELETE
to the /installation/token
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#revoke-an-installation-access-token
pub async fn get_subscription_plan_for_account(
&self,
account_id: i64
) -> Result<MarketplacePurchaseData>
pub async fn get_subscription_plan_for_account(
&self,
account_id: i64
) -> Result<MarketplacePurchaseData>
Get a subscription plan for an account.
This function performs a GET
to the /marketplace_listing/accounts/{account_id}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#get-a-subscription-plan-for-an-account
Parameters:
account_id: i64
– account_id parameter.
pub async fn list_plans(
&self,
per_page: i64,
page: i64
) -> Result<Vec<MarketplaceListingPlan>>
pub async fn list_plans(
&self,
per_page: i64,
page: i64
) -> Result<Vec<MarketplaceListingPlan>>
List plans.
This function performs a GET
to the /marketplace_listing/plans
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#list-plans
Parameters:
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
List plans.
This function performs a GET
to the /marketplace_listing/plans
endpoint.
As opposed to list_plans
, this function returns all the pages of the request at once.
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.
FROM: https://docs.github.com/rest/reference/apps#list-plans
pub async fn list_accounts_for_plan(
&self,
plan_id: i64,
sort: Sort,
direction: Direction,
per_page: i64,
page: i64
) -> Result<Vec<MarketplacePurchaseData>>
pub async fn list_accounts_for_plan(
&self,
plan_id: i64,
sort: Sort,
direction: Direction,
per_page: i64,
page: i64
) -> Result<Vec<MarketplacePurchaseData>>
List accounts for a plan.
This function performs a GET
to the /marketplace_listing/plans/{plan_id}/accounts
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#list-accounts-for-a-plan
Parameters:
plan_id: i64
– plan_id parameter.sort: crate::types::Sort
– One ofcreated
(when the repository was starred) orupdated
(when it was last pushed to).direction: crate::types::Direction
– To return the oldest accounts first, set toasc
. Can be one ofasc
ordesc
. Ignored without thesort
parameter.per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
pub async fn list_all_accounts_for_plan(
&self,
plan_id: i64,
sort: Sort,
direction: Direction
) -> Result<Vec<MarketplacePurchaseData>>
pub async fn list_all_accounts_for_plan(
&self,
plan_id: i64,
sort: Sort,
direction: Direction
) -> Result<Vec<MarketplacePurchaseData>>
List accounts for a plan.
This function performs a GET
to the /marketplace_listing/plans/{plan_id}/accounts
endpoint.
As opposed to list_accounts_for_plan
, this function returns all the pages of the request at once.
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.
FROM: https://docs.github.com/rest/reference/apps#list-accounts-for-a-plan
pub async fn get_subscription_plan_for_account_stubbed(
&self,
account_id: i64
) -> Result<MarketplacePurchaseData>
pub async fn get_subscription_plan_for_account_stubbed(
&self,
account_id: i64
) -> Result<MarketplacePurchaseData>
Get a subscription plan for an account (stubbed).
This function performs a GET
to the /marketplace_listing/stubbed/accounts/{account_id}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#get-a-subscription-plan-for-an-account-stubbed
Parameters:
account_id: i64
– account_id parameter.
pub async fn list_plans_stubbed(
&self,
per_page: i64,
page: i64
) -> Result<Vec<MarketplaceListingPlan>>
pub async fn list_plans_stubbed(
&self,
per_page: i64,
page: i64
) -> Result<Vec<MarketplaceListingPlan>>
List plans (stubbed).
This function performs a GET
to the /marketplace_listing/stubbed/plans
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#list-plans-stubbed
Parameters:
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
List plans (stubbed).
This function performs a GET
to the /marketplace_listing/stubbed/plans
endpoint.
As opposed to list_plans_stubbed
, this function returns all the pages of the request at once.
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.
FROM: https://docs.github.com/rest/reference/apps#list-plans-stubbed
pub async fn list_accounts_for_plan_stubbed(
&self,
plan_id: i64,
sort: Sort,
direction: Direction,
per_page: i64,
page: i64
) -> Result<Vec<MarketplacePurchaseData>>
pub async fn list_accounts_for_plan_stubbed(
&self,
plan_id: i64,
sort: Sort,
direction: Direction,
per_page: i64,
page: i64
) -> Result<Vec<MarketplacePurchaseData>>
List accounts for a plan (stubbed).
This function performs a GET
to the /marketplace_listing/stubbed/plans/{plan_id}/accounts
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#list-accounts-for-a-plan-stubbed
Parameters:
plan_id: i64
– plan_id parameter.sort: crate::types::Sort
– One ofcreated
(when the repository was starred) orupdated
(when it was last pushed to).direction: crate::types::Direction
– To return the oldest accounts first, set toasc
. Can be one ofasc
ordesc
. Ignored without thesort
parameter.per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
pub async fn list_all_accounts_for_plan_stubbed(
&self,
plan_id: i64,
sort: Sort,
direction: Direction
) -> Result<Vec<MarketplacePurchaseData>>
pub async fn list_all_accounts_for_plan_stubbed(
&self,
plan_id: i64,
sort: Sort,
direction: Direction
) -> Result<Vec<MarketplacePurchaseData>>
List accounts for a plan (stubbed).
This function performs a GET
to the /marketplace_listing/stubbed/plans/{plan_id}/accounts
endpoint.
As opposed to list_accounts_for_plan_stubbed
, this function returns all the pages of the request at once.
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.
FROM: https://docs.github.com/rest/reference/apps#list-accounts-for-a-plan-stubbed
Get an organization installation for the authenticated app.
This function performs a GET
to the /orgs/{org}/installation
endpoint.
Enables an authenticated GitHub App to find the organization’s installation information.
You must use a JWT to access this endpoint.
Parameters:
org: &str
pub async fn create_content_attachment(
&self,
owner: &str,
repo: &str,
content_reference_id: i64,
body: &AppsCreateContentAttachmentRequest
) -> Result<ContentReferenceAttachment>
pub async fn create_content_attachment(
&self,
owner: &str,
repo: &str,
content_reference_id: i64,
body: &AppsCreateContentAttachmentRequest
) -> Result<ContentReferenceAttachment>
Create a content attachment.
This function performs a POST
to the /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments
endpoint.
Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id
and repository
full_name
of the content reference from the content_reference
event to create an attachment.
The app must create a content attachment within six hours of the content reference URL being posted. See “Using content attachments” for details about content attachments.
You must use an installation access token to access this endpoint.
FROM: https://docs.github.com/rest/reference/apps#create-a-content-attachment
Parameters:
owner: &str
– The owner of the repository. Determined from therepository
full_name
of thecontent_reference
event.repo: &str
– The name of the repository. Determined from therepository
full_name
of thecontent_reference
event.content_reference_id: i64
– Theid
of thecontent_reference
event.
Get a repository installation for the authenticated app.
This function performs a GET
to the /repos/{owner}/{repo}/installation
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#get-a-repository-installation-for-the-authenticated-app
Parameters:
owner: &str
repo: &str
pub async fn list_installations_for_authenticated_user(
&self,
per_page: i64,
page: i64
) -> Result<AppsListInstallationsResponse>
pub async fn list_installations_for_authenticated_user(
&self,
per_page: i64,
page: i64
) -> Result<AppsListInstallationsResponse>
List app installations accessible to the user access token.
This function performs a GET
to the /user/installations
endpoint.
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.
Parameters:
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
pub async fn list_installation_repos_for_authenticated_user(
&self,
installation_id: i64,
per_page: i64,
page: i64
) -> Result<AppsListInstallationReposResponse>
pub async fn list_installation_repos_for_authenticated_user(
&self,
installation_id: i64,
per_page: i64,
page: i64
) -> Result<AppsListInstallationReposResponse>
List repositories accessible to the user access token.
This function performs a GET
to the /user/installations/{installation_id}/repositories
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#list-repositories-accessible-to-the-user-access-token
Parameters:
installation_id: i64
– installation_id parameter.per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
Add a repository to an app installation.
This function performs a PUT
to the /user/installations/{installation_id}/repositories/{repository_id}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#add-a-repository-to-an-app-installation
Parameters:
installation_id: i64
– installation_id parameter.repository_id: i64
Remove a repository from an app installation.
This function performs a DELETE
to the /user/installations/{installation_id}/repositories/{repository_id}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#remove-a-repository-from-an-app-installation
Parameters:
installation_id: i64
– installation_id parameter.repository_id: i64
pub async fn list_subscriptions_for_authenticated_user(
&self,
per_page: i64,
page: i64
) -> Result<Vec<UserMarketplacePurchase>>
pub async fn list_subscriptions_for_authenticated_user(
&self,
per_page: i64,
page: i64
) -> Result<Vec<UserMarketplacePurchase>>
List subscriptions for the authenticated user.
This function performs a GET
to the /user/marketplace_purchases
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#list-subscriptions-for-the-authenticated-user
Parameters:
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
pub async fn list_all_subscriptions_for_authenticated_user(
&self
) -> Result<Vec<UserMarketplacePurchase>>
pub async fn list_all_subscriptions_for_authenticated_user(
&self
) -> Result<Vec<UserMarketplacePurchase>>
List subscriptions for the authenticated user.
This function performs a GET
to the /user/marketplace_purchases
endpoint.
As opposed to list_subscriptions_for_authenticated_user
, this function returns all the pages of the request at once.
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.
FROM: https://docs.github.com/rest/reference/apps#list-subscriptions-for-the-authenticated-user
pub async fn list_subscriptions_for_authenticated_user_stubbed(
&self,
per_page: i64,
page: i64
) -> Result<Vec<UserMarketplacePurchase>>
pub async fn list_subscriptions_for_authenticated_user_stubbed(
&self,
per_page: i64,
page: i64
) -> Result<Vec<UserMarketplacePurchase>>
List subscriptions for the authenticated user (stubbed).
This function performs a GET
to the /user/marketplace_purchases/stubbed
endpoint.
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.
FROM: https://docs.github.com/rest/reference/apps#list-subscriptions-for-the-authenticated-user-stubbed
Parameters:
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
pub async fn list_all_subscriptions_for_authenticated_user_stubbed(
&self
) -> Result<Vec<UserMarketplacePurchase>>
pub async fn list_all_subscriptions_for_authenticated_user_stubbed(
&self
) -> Result<Vec<UserMarketplacePurchase>>
List subscriptions for the authenticated user (stubbed).
This function performs a GET
to the /user/marketplace_purchases/stubbed
endpoint.
As opposed to list_subscriptions_for_authenticated_user_stubbed
, this function returns all the pages of the request at once.
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.
FROM: https://docs.github.com/rest/reference/apps#list-subscriptions-for-the-authenticated-user-stubbed
Get a user installation for the authenticated app.
This function performs a GET
to the /users/{username}/installation
endpoint.
Enables an authenticated GitHub App to find the user’s installation information.
You must use a JWT to access this endpoint.
FROM: https://docs.github.com/rest/reference/apps#get-a-user-installation-for-the-authenticated-app
Parameters:
username: &str
Auto Trait Implementations
impl !RefUnwindSafe for Apps
impl !UnwindSafe for Apps