Apps

Struct Apps 

Source
pub struct Apps<'api, C: Client>
where AdapterError: From<<C as Client>::Err>,
{ /* private fields */ }

Implementations§

Source§

impl<'api, C: Client> Apps<'api, C>
where AdapterError: From<<C as Client>::Err>,

Source

pub async fn add_repo_to_installation_for_authenticated_user_async( &self, installation_id: i32, repository_id: i32, ) -> Result<(), AdapterError>


§Add a repository to an app installation

Add a single repository to an installation. The authenticated user must have admin access to the repository.

This endpoint only works for PATs (classic) with the repo scope.

GitHub API docs for add_repo_to_installation_for_authenticated_user


Source

pub fn add_repo_to_installation_for_authenticated_user( &self, installation_id: i32, repository_id: i32, ) -> Result<(), AdapterError>


§Add a repository to an app installation

Add a single repository to an installation. The authenticated user must have admin access to the repository.

This endpoint only works for PATs (classic) with the repo scope.

GitHub API docs for add_repo_to_installation_for_authenticated_user


Source

pub async fn check_token_async( &self, client_id: &str, body: PostAppsCheckToken, ) -> Result<Authorization, AdapterError>


§Check a token

OAuth applications and GitHub applications with OAuth authorizations can use this API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. Invalid tokens will return 404 NOT FOUND.

GitHub API docs for check_token


Source

pub fn check_token( &self, client_id: &str, body: PostAppsCheckToken, ) -> Result<Authorization, AdapterError>


§Check a token

OAuth applications and GitHub applications with OAuth authorizations can use this API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. Invalid tokens will return 404 NOT FOUND.

GitHub API docs for check_token


Source

pub async fn create_from_manifest_async( &self, code: &str, ) -> Result<PostAppsCreateFromManifestResponse201, AdapterError>


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

GitHub API docs for create_from_manifest


Source

pub fn create_from_manifest( &self, code: &str, ) -> Result<PostAppsCreateFromManifestResponse201, AdapterError>


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

GitHub API docs for create_from_manifest


Source

pub async fn create_installation_access_token_async( &self, installation_id: i32, body: PostAppsCreateInstallationAccessToken, ) -> Result<InstallationToken, AdapterError>


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

Optionally, you can use the repositories or repository_ids body parameters to specify individual repositories that the installation access token can access. If you don’t use repositories or repository_ids to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. Up to 500 repositories can be listed in this manner.

Optionally, use the permissions body parameter to specify the permissions that the installation access token should have. If permissions is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted.

You must use a JWT to access this endpoint.

GitHub API docs for create_installation_access_token


Source

pub fn create_installation_access_token( &self, installation_id: i32, body: PostAppsCreateInstallationAccessToken, ) -> Result<InstallationToken, AdapterError>


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

Optionally, you can use the repositories or repository_ids body parameters to specify individual repositories that the installation access token can access. If you don’t use repositories or repository_ids to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. Up to 500 repositories can be listed in this manner.

Optionally, use the permissions body parameter to specify the permissions that the installation access token should have. If permissions is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted.

You must use a JWT to access this endpoint.

GitHub API docs for create_installation_access_token


Source

pub async fn delete_authorization_async( &self, client_id: &str, body: DeleteAppsDeleteAuthorization, ) -> Result<(), AdapterError>


§Delete an app authorization

OAuth and GitHub application owners can revoke a grant for their application and a specific user. You must provide a valid OAuth access_token as an input parameter and the grant for the token’s owner will be deleted. Deleting an 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.

GitHub API docs for delete_authorization


Source

pub fn delete_authorization( &self, client_id: &str, body: DeleteAppsDeleteAuthorization, ) -> Result<(), AdapterError>


§Delete an app authorization

OAuth and GitHub application owners can revoke a grant for their application and a specific user. You must provide a valid OAuth access_token as an input parameter and the grant for the token’s owner will be deleted. Deleting an 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.

GitHub API docs for delete_authorization


Source

pub async fn delete_installation_async( &self, installation_id: i32, ) -> Result<(), AdapterError>


§Delete an installation for the authenticated app

Uninstalls a GitHub App on a user, organization, or enterprise 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.

GitHub API docs for delete_installation


Source

pub fn delete_installation( &self, installation_id: i32, ) -> Result<(), AdapterError>


§Delete an installation for the authenticated app

Uninstalls a GitHub App on a user, organization, or enterprise 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.

GitHub API docs for delete_installation


Source

pub async fn delete_token_async( &self, client_id: &str, body: DeleteAppsDeleteToken, ) -> Result<(), AdapterError>


§Delete an app token

OAuth or GitHub application owners can revoke a single token for an OAuth application or a GitHub application with an OAuth authorization.

GitHub API docs for delete_token


Source

pub fn delete_token( &self, client_id: &str, body: DeleteAppsDeleteToken, ) -> Result<(), AdapterError>


§Delete an app token

OAuth or GitHub application owners can revoke a single token for an OAuth application or a GitHub application with an OAuth authorization.

GitHub API docs for delete_token


Source

pub async fn get_authenticated_async(&self) -> Result<Integration, AdapterError>


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

GitHub API docs for get_authenticated


Source

pub fn get_authenticated(&self) -> Result<Integration, AdapterError>


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

GitHub API docs for get_authenticated


Source

pub async fn get_by_slug_async( &self, app_slug: &str, ) -> Result<Integration, AdapterError>


§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).

GitHub API docs for get_by_slug


Source

pub fn get_by_slug(&self, app_slug: &str) -> Result<Integration, AdapterError>


§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).

GitHub API docs for get_by_slug


Source

pub async fn get_installation_async( &self, installation_id: i32, ) -> Result<Installation, AdapterError>


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

GitHub API docs for get_installation


Source

pub fn get_installation( &self, installation_id: i32, ) -> Result<Installation, AdapterError>


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

GitHub API docs for get_installation


Source

pub async fn get_org_installation_async( &self, org: &str, ) -> Result<Installation, AdapterError>


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

GitHub API docs for get_org_installation


Source

pub fn get_org_installation( &self, org: &str, ) -> Result<Installation, AdapterError>


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

GitHub API docs for get_org_installation


Source

pub async fn get_repo_installation_async( &self, owner: &str, repo: &str, ) -> Result<Installation, AdapterError>


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

GitHub API docs for get_repo_installation


Source

pub fn get_repo_installation( &self, owner: &str, repo: &str, ) -> Result<Installation, AdapterError>


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

GitHub API docs for get_repo_installation


Source

pub async fn get_subscription_plan_for_account_async( &self, account_id: i32, ) -> Result<MarketplacePurchase, AdapterError>


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

GitHub API docs for get_subscription_plan_for_account


Source

pub fn get_subscription_plan_for_account( &self, account_id: i32, ) -> Result<MarketplacePurchase, AdapterError>


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

GitHub API docs for get_subscription_plan_for_account


Source

pub async fn get_subscription_plan_for_account_stubbed_async( &self, account_id: i32, ) -> Result<MarketplacePurchase, AdapterError>


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

GitHub API docs for get_subscription_plan_for_account_stubbed


Source

pub fn get_subscription_plan_for_account_stubbed( &self, account_id: i32, ) -> Result<MarketplacePurchase, AdapterError>


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

GitHub API docs for get_subscription_plan_for_account_stubbed


Source

pub async fn get_user_installation_async( &self, username: &str, ) -> Result<Installation, AdapterError>


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

GitHub API docs for get_user_installation


Source

pub fn get_user_installation( &self, username: &str, ) -> Result<Installation, AdapterError>


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

GitHub API docs for get_user_installation


Source

pub async fn get_webhook_config_for_app_async( &self, ) -> Result<WebhookConfig, AdapterError>


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

GitHub API docs for get_webhook_config_for_app


Source

pub fn get_webhook_config_for_app(&self) -> Result<WebhookConfig, AdapterError>


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

GitHub API docs for get_webhook_config_for_app


Source

pub async fn get_webhook_delivery_async( &self, delivery_id: i32, ) -> Result<HookDelivery, AdapterError>


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

GitHub API docs for get_webhook_delivery


Source

pub fn get_webhook_delivery( &self, delivery_id: i32, ) -> Result<HookDelivery, AdapterError>


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

GitHub API docs for get_webhook_delivery


Source

pub async fn list_accounts_for_plan_async( &self, plan_id: i32, query_params: Option<impl Into<AppsListAccountsForPlanParams<'api>>>, ) -> Result<Vec<MarketplacePurchase>, AdapterError>


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

GitHub API docs for list_accounts_for_plan


Source

pub fn list_accounts_for_plan( &self, plan_id: i32, query_params: Option<impl Into<AppsListAccountsForPlanParams<'api>>>, ) -> Result<Vec<MarketplacePurchase>, AdapterError>


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

GitHub API docs for list_accounts_for_plan


Source

pub async fn list_accounts_for_plan_stubbed_async( &self, plan_id: i32, query_params: Option<impl Into<AppsListAccountsForPlanStubbedParams<'api>>>, ) -> Result<Vec<MarketplacePurchase>, AdapterError>


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

GitHub API docs for list_accounts_for_plan_stubbed


Source

pub fn list_accounts_for_plan_stubbed( &self, plan_id: i32, query_params: Option<impl Into<AppsListAccountsForPlanStubbedParams<'api>>>, ) -> Result<Vec<MarketplacePurchase>, AdapterError>


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

GitHub API docs for list_accounts_for_plan_stubbed


Source

pub async fn list_installation_repos_for_authenticated_user_async( &self, installation_id: i32, query_params: Option<impl Into<AppsListInstallationReposForAuthenticatedUserParams>>, ) -> Result<GetAppsListInstallationReposForAuthenticatedUserResponse200, AdapterError>


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

The access the user has to each repository is included in the hash under the permissions key.

GitHub API docs for list_installation_repos_for_authenticated_user


Source

pub fn list_installation_repos_for_authenticated_user( &self, installation_id: i32, query_params: Option<impl Into<AppsListInstallationReposForAuthenticatedUserParams>>, ) -> Result<GetAppsListInstallationReposForAuthenticatedUserResponse200, AdapterError>


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

The access the user has to each repository is included in the hash under the permissions key.

GitHub API docs for list_installation_repos_for_authenticated_user


Source

pub async fn list_installation_requests_for_authenticated_app_async( &self, query_params: Option<impl Into<AppsListInstallationRequestsForAuthenticatedAppParams>>, ) -> Result<Vec<IntegrationInstallationRequest>, AdapterError>


§List installation requests for the authenticated app

Lists all the pending installation requests for the authenticated GitHub App.

GitHub API docs for list_installation_requests_for_authenticated_app


Source

pub fn list_installation_requests_for_authenticated_app( &self, query_params: Option<impl Into<AppsListInstallationRequestsForAuthenticatedAppParams>>, ) -> Result<Vec<IntegrationInstallationRequest>, AdapterError>


§List installation requests for the authenticated app

Lists all the pending installation requests for the authenticated GitHub App.

GitHub API docs for list_installation_requests_for_authenticated_app


Source

pub async fn list_installations_async( &self, query_params: Option<impl Into<AppsListInstallationsParams<'api>>>, ) -> Result<Vec<Installation>, AdapterError>


§List installations for the authenticated app

The permissions the installation has are included under the permissions key.

You must use a JWT to access this endpoint.

GitHub API docs for list_installations


Source

pub fn list_installations( &self, query_params: Option<impl Into<AppsListInstallationsParams<'api>>>, ) -> Result<Vec<Installation>, AdapterError>


§List installations for the authenticated app

The permissions the installation has are included under the permissions key.

You must use a JWT to access this endpoint.

GitHub API docs for list_installations


Source

pub async fn list_installations_for_authenticated_user_async( &self, query_params: Option<impl Into<AppsListInstallationsForAuthenticatedUserParams>>, ) -> Result<GetAppsListInstallationsForAuthenticatedUserResponse200, AdapterError>


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

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.

GitHub API docs for list_installations_for_authenticated_user


Source

pub fn list_installations_for_authenticated_user( &self, query_params: Option<impl Into<AppsListInstallationsForAuthenticatedUserParams>>, ) -> Result<GetAppsListInstallationsForAuthenticatedUserResponse200, AdapterError>


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

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.

GitHub API docs for list_installations_for_authenticated_user


Source

pub async fn list_plans_async( &self, query_params: Option<impl Into<AppsListPlansParams>>, ) -> Result<Vec<MarketplaceListingPlan>, AdapterError>


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

GitHub API docs for list_plans


Source

pub fn list_plans( &self, query_params: Option<impl Into<AppsListPlansParams>>, ) -> Result<Vec<MarketplaceListingPlan>, AdapterError>


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

GitHub API docs for list_plans


Source

pub async fn list_plans_stubbed_async( &self, query_params: Option<impl Into<AppsListPlansStubbedParams>>, ) -> Result<Vec<MarketplaceListingPlan>, AdapterError>


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

GitHub API docs for list_plans_stubbed


Source

pub fn list_plans_stubbed( &self, query_params: Option<impl Into<AppsListPlansStubbedParams>>, ) -> Result<Vec<MarketplaceListingPlan>, AdapterError>


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

GitHub API docs for list_plans_stubbed


Source

pub async fn list_repos_accessible_to_installation_async( &self, query_params: Option<impl Into<AppsListReposAccessibleToInstallationParams>>, ) -> Result<GetAppsListReposAccessibleToInstallationResponse200, AdapterError>


§List repositories accessible to the app installation

List repositories that an app installation can access.

GitHub API docs for list_repos_accessible_to_installation


Source

pub fn list_repos_accessible_to_installation( &self, query_params: Option<impl Into<AppsListReposAccessibleToInstallationParams>>, ) -> Result<GetAppsListReposAccessibleToInstallationResponse200, AdapterError>


§List repositories accessible to the app installation

List repositories that an app installation can access.

GitHub API docs for list_repos_accessible_to_installation


Source

pub async fn list_subscriptions_for_authenticated_user_async( &self, query_params: Option<impl Into<AppsListSubscriptionsForAuthenticatedUserParams>>, ) -> Result<Vec<UserMarketplacePurchase>, AdapterError>


§List subscriptions for the authenticated user

Lists the active subscriptions for the authenticated user.

GitHub API docs for list_subscriptions_for_authenticated_user


Source

pub fn list_subscriptions_for_authenticated_user( &self, query_params: Option<impl Into<AppsListSubscriptionsForAuthenticatedUserParams>>, ) -> Result<Vec<UserMarketplacePurchase>, AdapterError>


§List subscriptions for the authenticated user

Lists the active subscriptions for the authenticated user.

GitHub API docs for list_subscriptions_for_authenticated_user


Source

pub async fn list_subscriptions_for_authenticated_user_stubbed_async( &self, query_params: Option<impl Into<AppsListSubscriptionsForAuthenticatedUserStubbedParams>>, ) -> Result<Vec<UserMarketplacePurchase>, AdapterError>


§List subscriptions for the authenticated user (stubbed)

Lists the active subscriptions for the authenticated user.

GitHub API docs for list_subscriptions_for_authenticated_user_stubbed


Source

pub fn list_subscriptions_for_authenticated_user_stubbed( &self, query_params: Option<impl Into<AppsListSubscriptionsForAuthenticatedUserStubbedParams>>, ) -> Result<Vec<UserMarketplacePurchase>, AdapterError>


§List subscriptions for the authenticated user (stubbed)

Lists the active subscriptions for the authenticated user.

GitHub API docs for list_subscriptions_for_authenticated_user_stubbed


Source

pub async fn list_webhook_deliveries_async( &self, query_params: Option<impl Into<AppsListWebhookDeliveriesParams<'api>>>, ) -> Result<Vec<HookDeliveryItem>, AdapterError>


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

GitHub API docs for list_webhook_deliveries


Source

pub fn list_webhook_deliveries( &self, query_params: Option<impl Into<AppsListWebhookDeliveriesParams<'api>>>, ) -> Result<Vec<HookDeliveryItem>, AdapterError>


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

GitHub API docs for list_webhook_deliveries


Source

pub async fn redeliver_webhook_delivery_async( &self, delivery_id: i32, ) -> Result<HashMap<String, Value>, AdapterError>


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

GitHub API docs for redeliver_webhook_delivery


Source

pub fn redeliver_webhook_delivery( &self, delivery_id: i32, ) -> Result<HashMap<String, Value>, AdapterError>


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

GitHub API docs for redeliver_webhook_delivery


Source

pub async fn remove_repo_from_installation_for_authenticated_user_async( &self, installation_id: i32, repository_id: i32, ) -> Result<(), AdapterError>


§Remove a repository from an app installation

Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the repository_selection of selected.

This endpoint only works for PATs (classic) with the repo scope.

GitHub API docs for remove_repo_from_installation_for_authenticated_user


Source

pub fn remove_repo_from_installation_for_authenticated_user( &self, installation_id: i32, repository_id: i32, ) -> Result<(), AdapterError>


§Remove a repository from an app installation

Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the repository_selection of selected.

This endpoint only works for PATs (classic) with the repo scope.

GitHub API docs for remove_repo_from_installation_for_authenticated_user


Source

pub async fn reset_token_async( &self, client_id: &str, body: PatchAppsResetToken, ) -> Result<Authorization, AdapterError>


§Reset a token

OAuth applications and GitHub applications with OAuth authorizations 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. Invalid tokens will return 404 NOT FOUND.

GitHub API docs for reset_token


Source

pub fn reset_token( &self, client_id: &str, body: PatchAppsResetToken, ) -> Result<Authorization, AdapterError>


§Reset a token

OAuth applications and GitHub applications with OAuth authorizations 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. Invalid tokens will return 404 NOT FOUND.

GitHub API docs for reset_token


Source

pub async fn revoke_installation_access_token_async( &self, ) -> Result<(), AdapterError>


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

GitHub API docs for revoke_installation_access_token


Source

pub fn revoke_installation_access_token(&self) -> Result<(), AdapterError>


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

GitHub API docs for revoke_installation_access_token


Source

pub async fn scope_token_async( &self, client_id: &str, body: PostAppsScopeToken, ) -> Result<Authorization, AdapterError>


§Create a scoped access token

Use a non-scoped user access token to create a repository-scoped and/or permission-scoped user access token. You can specify which repositories the token can access and which permissions are granted to the token.

Invalid tokens will return 404 NOT FOUND.

GitHub API docs for scope_token


Source

pub fn scope_token( &self, client_id: &str, body: PostAppsScopeToken, ) -> Result<Authorization, AdapterError>


§Create a scoped access token

Use a non-scoped user access token to create a repository-scoped and/or permission-scoped user access token. You can specify which repositories the token can access and which permissions are granted to the token.

Invalid tokens will return 404 NOT FOUND.

GitHub API docs for scope_token


Source

pub async fn suspend_installation_async( &self, installation_id: i32, ) -> Result<(), AdapterError>


§Suspend an app installation

Suspends a GitHub App on a user, organization, or enterprise 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.

GitHub API docs for suspend_installation


Source

pub fn suspend_installation( &self, installation_id: i32, ) -> Result<(), AdapterError>


§Suspend an app installation

Suspends a GitHub App on a user, organization, or enterprise 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.

GitHub API docs for suspend_installation


Source

pub async fn unsuspend_installation_async( &self, installation_id: i32, ) -> Result<(), AdapterError>


§Unsuspend an app installation

Removes a GitHub App installation suspension.

You must use a JWT to access this endpoint.

GitHub API docs for unsuspend_installation


Source

pub fn unsuspend_installation( &self, installation_id: i32, ) -> Result<(), AdapterError>


§Unsuspend an app installation

Removes a GitHub App installation suspension.

You must use a JWT to access this endpoint.

GitHub API docs for unsuspend_installation


Source

pub async fn update_webhook_config_for_app_async( &self, body: PatchAppsUpdateWebhookConfigForApp, ) -> Result<WebhookConfig, AdapterError>


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

GitHub API docs for update_webhook_config_for_app


Source

pub fn update_webhook_config_for_app( &self, body: PatchAppsUpdateWebhookConfigForApp, ) -> Result<WebhookConfig, AdapterError>


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

GitHub API docs for update_webhook_config_for_app


Auto Trait Implementations§

§

impl<'api, C> Freeze for Apps<'api, C>

§

impl<'api, C> RefUnwindSafe for Apps<'api, C>

§

impl<'api, C> Send for Apps<'api, C>
where AdapterError: Sized, C: Sync,

§

impl<'api, C> Sync for Apps<'api, C>
where AdapterError: Sized, C: Sync,

§

impl<'api, C> Unpin for Apps<'api, C>

§

impl<'api, C> UnwindSafe for Apps<'api, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.