Struct octorust::packages::Packages [−][src]
pub struct Packages {
pub client: Client,
}
Fields
client: Client
Implementations
pub async fn get_package_for_organization(
&self,
package_type: PackageType,
package_name: &str,
org: &str
) -> Result<Package>
pub async fn get_package_for_organization(
&self,
package_type: PackageType,
package_name: &str,
org: &str
) -> Result<Package>
Get a package for an organization.
This function performs a GET
to the /orgs/{org}/packages/{package_type}/{package_name}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/packages#get-a-package-for-an-organization
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.org: &str
pub async fn delete_package_for_org(
&self,
package_type: PackageType,
package_name: &str,
org: &str
) -> Result<()>
pub async fn delete_package_for_org(
&self,
package_type: PackageType,
package_name: &str,
org: &str
) -> Result<()>
Delete a package for an organization.
This function performs a DELETE
to the /orgs/{org}/packages/{package_type}/{package_name}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/packages#delete-a-package-for-an-organization
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.org: &str
pub async fn restore_package_for_org(
&self,
package_type: PackageType,
package_name: &str,
org: &str,
token: &str
) -> Result<()>
pub async fn restore_package_for_org(
&self,
package_type: PackageType,
package_name: &str,
org: &str,
token: &str
) -> Result<()>
Restore a package for an organization.
This function performs a POST
to the /orgs/{org}/packages/{package_type}/{package_name}/restore
endpoint.
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.
FROM: https://docs.github.com/rest/reference/packages#restore-a-package-for-an-organization
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.org: &str
token: &str
– package token.
pub async fn get_all_package_versions_for_package_owned_by_org(
&self,
package_type: PackageType,
package_name: &str,
org: &str,
page: i64,
per_page: i64,
state: PackagesGetAllPackageVersionsOwnedByOrgState
) -> Result<Vec<PackageVersion>>
pub async fn get_all_package_versions_for_package_owned_by_org(
&self,
package_type: PackageType,
package_name: &str,
org: &str,
page: i64,
per_page: i64,
state: PackagesGetAllPackageVersionsOwnedByOrgState
) -> Result<Vec<PackageVersion>>
Get all package versions for a package owned by an organization.
This function performs a GET
to the /orgs/{org}/packages/{package_type}/{package_name}/versions
endpoint.
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.
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.org: &str
page: i64
– Page number of the results to fetch.per_page: i64
– Results per page (max 100).state: crate::types::PackagesGetAllPackageVersionsOwnedByOrgState
– The state of the package, either active or deleted.
pub async fn get_all_all_package_versions_for_package_owned_by_org(
&self,
package_type: PackageType,
package_name: &str,
org: &str,
state: PackagesGetAllPackageVersionsOwnedByOrgState
) -> Result<Vec<PackageVersion>>
pub async fn get_all_all_package_versions_for_package_owned_by_org(
&self,
package_type: PackageType,
package_name: &str,
org: &str,
state: PackagesGetAllPackageVersionsOwnedByOrgState
) -> Result<Vec<PackageVersion>>
Get all package versions for a package owned by an organization.
This function performs a GET
to the /orgs/{org}/packages/{package_type}/{package_name}/versions
endpoint.
As opposed to get_all_package_versions_for_package_owned_by_org
, this function returns all the pages of the request at once.
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.
pub async fn get_package_version_for_organization(
&self,
package_type: PackageType,
package_name: &str,
org: &str,
package_version_id: i64
) -> Result<PackageVersion>
pub async fn get_package_version_for_organization(
&self,
package_type: PackageType,
package_name: &str,
org: &str,
package_version_id: i64
) -> Result<PackageVersion>
Get a package version for an organization.
This function performs a GET
to the /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/packages#get-a-package-version-for-an-organization
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.org: &str
package_version_id: i64
– Unique identifier of the package version.
pub async fn delete_package_version_for_org(
&self,
package_type: PackageType,
package_name: &str,
org: &str,
package_version_id: i64
) -> Result<()>
pub async fn delete_package_version_for_org(
&self,
package_type: PackageType,
package_name: &str,
org: &str,
package_version_id: i64
) -> Result<()>
Delete package version for an organization.
This function performs a DELETE
to the /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/packages#delete-a-package-version-for-an-organization
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.org: &str
package_version_id: i64
– Unique identifier of the package version.
pub async fn restore_package_version_for_org(
&self,
package_type: PackageType,
package_name: &str,
org: &str,
package_version_id: i64
) -> Result<()>
pub async fn restore_package_version_for_org(
&self,
package_type: PackageType,
package_name: &str,
org: &str,
package_version_id: i64
) -> Result<()>
Restore package version for an organization.
This function performs a POST
to the /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore
endpoint.
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.
FROM: https://docs.github.com/rest/reference/packages#restore-a-package-version-for-an-organization
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.org: &str
package_version_id: i64
– Unique identifier of the package version.
pub async fn get_package_for_authenticated_user(
&self,
package_type: PackageType,
package_name: &str
) -> Result<Package>
pub async fn get_package_for_authenticated_user(
&self,
package_type: PackageType,
package_name: &str
) -> Result<Package>
Get a package for the authenticated user.
This function performs a GET
to the /user/packages/{package_type}/{package_name}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/packages#get-a-package-for-the-authenticated-user
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.
pub async fn delete_package_for_authenticated_user(
&self,
package_type: PackageType,
package_name: &str
) -> Result<()>
pub async fn delete_package_for_authenticated_user(
&self,
package_type: PackageType,
package_name: &str
) -> Result<()>
Delete a package for the authenticated user.
This function performs a DELETE
to the /user/packages/{package_type}/{package_name}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/packages#delete-a-package-for-the-authenticated-user
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.
pub async fn restore_package_for_authenticated_user(
&self,
package_type: PackageType,
package_name: &str,
token: &str
) -> Result<()>
pub async fn restore_package_for_authenticated_user(
&self,
package_type: PackageType,
package_name: &str,
token: &str
) -> Result<()>
Restore a package for the authenticated user.
This function performs a POST
to the /user/packages/{package_type}/{package_name}/restore
endpoint.
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.
FROM: https://docs.github.com/rest/reference/packages#restore-a-package-for-the-authenticated-user
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.token: &str
– package token.
pub async fn get_all_package_versions_for_package_owned_by_authenticated_user(
&self,
package_type: PackageType,
package_name: &str,
page: i64,
per_page: i64,
state: PackagesGetAllPackageVersionsOwnedByOrgState
) -> Result<Vec<PackageVersion>>
pub async fn get_all_package_versions_for_package_owned_by_authenticated_user(
&self,
package_type: PackageType,
package_name: &str,
page: i64,
per_page: i64,
state: PackagesGetAllPackageVersionsOwnedByOrgState
) -> Result<Vec<PackageVersion>>
Get all package versions for a package owned by the authenticated user.
This function performs a GET
to the /user/packages/{package_type}/{package_name}/versions
endpoint.
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.
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.page: i64
– Page number of the results to fetch.per_page: i64
– Results per page (max 100).state: crate::types::PackagesGetAllPackageVersionsOwnedByOrgState
– The state of the package, either active or deleted.
pub async fn get_all_all_package_versions_for_package_owned_by_authenticated_user(
&self,
package_type: PackageType,
package_name: &str,
state: PackagesGetAllPackageVersionsOwnedByOrgState
) -> Result<Vec<PackageVersion>>
pub async fn get_all_all_package_versions_for_package_owned_by_authenticated_user(
&self,
package_type: PackageType,
package_name: &str,
state: PackagesGetAllPackageVersionsOwnedByOrgState
) -> Result<Vec<PackageVersion>>
Get all package versions for a package owned by the authenticated user.
This function performs a GET
to the /user/packages/{package_type}/{package_name}/versions
endpoint.
As opposed to get_all_package_versions_for_package_owned_by_authenticated_user
, this function returns all the pages of the request at once.
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.
pub async fn get_package_version_for_authenticated_user(
&self,
package_type: PackageType,
package_name: &str,
package_version_id: i64
) -> Result<PackageVersion>
pub async fn get_package_version_for_authenticated_user(
&self,
package_type: PackageType,
package_name: &str,
package_version_id: i64
) -> Result<PackageVersion>
Get a package version for the authenticated user.
This function performs a GET
to the /user/packages/{package_type}/{package_name}/versions/{package_version_id}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/packages#get-a-package-version-for-the-authenticated-user
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.package_version_id: i64
– Unique identifier of the package version.
pub async fn delete_package_version_for_authenticated_user(
&self,
package_type: PackageType,
package_name: &str,
package_version_id: i64
) -> Result<()>
pub async fn delete_package_version_for_authenticated_user(
&self,
package_type: PackageType,
package_name: &str,
package_version_id: i64
) -> Result<()>
Delete a package version for the authenticated user.
This function performs a DELETE
to the /user/packages/{package_type}/{package_name}/versions/{package_version_id}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/packages#delete-a-package-version-for-the-authenticated-user
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.package_version_id: i64
– Unique identifier of the package version.
pub async fn restore_package_version_for_authenticated_user(
&self,
package_type: PackageType,
package_name: &str,
package_version_id: i64
) -> Result<()>
pub async fn restore_package_version_for_authenticated_user(
&self,
package_type: PackageType,
package_name: &str,
package_version_id: i64
) -> Result<()>
Restore a package version for the authenticated user.
This function performs a POST
to the /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore
endpoint.
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.
FROM: https://docs.github.com/rest/reference/packages#restore-a-package-version-for-the-authenticated-user
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.package_version_id: i64
– Unique identifier of the package version.
pub async fn get_package_for_user(
&self,
package_type: PackageType,
package_name: &str,
username: &str
) -> Result<Package>
pub async fn get_package_for_user(
&self,
package_type: PackageType,
package_name: &str,
username: &str
) -> Result<Package>
Get a package for a user.
This function performs a GET
to the /users/{username}/packages/{package_type}/{package_name}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/packages#get-a-package-for-a-user
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.username: &str
pub async fn get_all_package_versions_for_package_owned_by_user(
&self,
package_type: PackageType,
package_name: &str,
username: &str
) -> Result<Vec<PackageVersion>>
pub async fn get_all_package_versions_for_package_owned_by_user(
&self,
package_type: PackageType,
package_name: &str,
username: &str
) -> Result<Vec<PackageVersion>>
Get all package versions for a package owned by a user.
This function performs a GET
to the /users/{username}/packages/{package_type}/{package_name}/versions
endpoint.
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.
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.username: &str
pub async fn get_all_all_package_versions_for_package_owned_by_user(
&self,
package_type: PackageType,
package_name: &str,
username: &str
) -> Result<Vec<PackageVersion>>
pub async fn get_all_all_package_versions_for_package_owned_by_user(
&self,
package_type: PackageType,
package_name: &str,
username: &str
) -> Result<Vec<PackageVersion>>
Get all package versions for a package owned by a user.
This function performs a GET
to the /users/{username}/packages/{package_type}/{package_name}/versions
endpoint.
As opposed to get_all_package_versions_for_package_owned_by_user
, this function returns all the pages of the request at once.
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.
pub async fn get_package_version_for_user(
&self,
package_type: PackageType,
package_name: &str,
package_version_id: i64,
username: &str
) -> Result<PackageVersion>
pub async fn get_package_version_for_user(
&self,
package_type: PackageType,
package_name: &str,
package_version_id: i64,
username: &str
) -> Result<PackageVersion>
Get a package version for a user.
This function performs a GET
to the /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}
endpoint.
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.
FROM: https://docs.github.com/rest/reference/packages#get-a-package-version-for-a-user
Parameters:
package_type: crate::types::PackageType
– The type of supported package. Can be one ofnpm
,maven
,rubygems
,nuget
,docker
, orcontainer
. Packages in GitHub’s Gradle registry have the typemaven
. Docker images pushed to GitHub’s Container registry (ghcr.io
) have the typecontainer
. You can use the typedocker
to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com
), even if these have now been migrated to the Container registry.package_name: &str
– The name of the package.package_version_id: i64
– Unique identifier of the package version.username: &str