Skip to content

Commit

Permalink
Add comment detailing that the package name is automatically escaped
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Nater authored and bn4t committed Dec 1, 2023
1 parent 5ecb48f commit 8cc816b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions github/orgs_packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ func (s *OrganizationsService) ListPackages(ctx context.Context, org string, opt
//
// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization
//
// Note that packageName is escaped for the URL path so that you don't need to.
//
//meta:operation GET /orgs/{org}/packages/{package_type}/{package_name}
func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, packageName string) (*Package, *Response, error) {
u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, packageName)
Expand All @@ -62,6 +64,8 @@ func (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType,
//
// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization
//
// Note that packageName is escaped for the URL path so that you don't need to.
//
//meta:operation DELETE /orgs/{org}/packages/{package_type}/{package_name}
func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) {
u := fmt.Sprintf("orgs/%v/packages/%v/%v", org, packageType, url.PathEscape(packageName))
Expand All @@ -77,6 +81,8 @@ func (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageTy
//
// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization
//
// Note that packageName is escaped for the URL path so that you don't need to.
//
//meta:operation POST /orgs/{org}/packages/{package_type}/{package_name}/restore
func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) {
u := fmt.Sprintf("orgs/%v/packages/%v/%v/restore", org, packageType, url.PathEscape(packageName))
Expand All @@ -92,6 +98,8 @@ func (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageT
//
// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization
//
// Note that packageName is escaped for the URL path so that you don't need to.
//
//meta:operation GET /orgs/{org}/packages/{package_type}/{package_name}/versions
func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) {
u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions", org, packageType, url.PathEscape(packageName))
Expand All @@ -118,6 +126,8 @@ func (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, p
//
// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization
//
// Note that packageName is escaped for the URL path so that you don't need to.
//
//meta:operation GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}
func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) {
u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, url.PathEscape(packageName), packageVersionID)
Expand All @@ -139,6 +149,8 @@ func (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packa
//
// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization
//
// Note that packageName is escaped for the URL path so that you don't need to.
//
//meta:operation DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}
func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) {
u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v", org, packageType, url.PathEscape(packageName), packageVersionID)
Expand All @@ -154,6 +166,8 @@ func (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, pa
//
// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization
//
// Note that packageName is escaped for the URL path so that you don't need to.
//
//meta:operation POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore
func (s *OrganizationsService) PackageRestoreVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) {
u := fmt.Sprintf("orgs/%v/packages/%v/%v/versions/%v/restore", org, packageType, url.PathEscape(packageName), packageVersionID)
Expand Down

0 comments on commit 8cc816b

Please sign in to comment.