Skip to content

Commit

Permalink
feat: added Missing APIOption overload for PackagesClient.GetAll* #2923
Browse files Browse the repository at this point in the history
 (#2934)

feat: added Missing APIOption overload for PackagesClient.GetAll* #2923

added missing APIOption overload for PackagesClient and ObservablePackagesClient
added overload for optional parameter packageVisibility to be a nonbreaking change
extended PackagesClientTests.cs to be conform with RepositoriesClientTests.cs to take ApiOptions into account
  • Loading branch information
lars-zweifel committed Jun 21, 2024
1 parent 1053a20 commit bdc1694
Show file tree
Hide file tree
Showing 5 changed files with 540 additions and 27 deletions.
102 changes: 99 additions & 3 deletions Octokit.Reactive/Clients/IObservablePackagesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ public interface IObservablePackagesClient
{
IObservablePackageVersionsClient PackageVersions { get; }

/// <summary>
/// List all packages for an organisations, readable by the current user
/// </summary>
/// <remarks>
/// See the <a href="https://docs.github.com/rest/packages#list-packages-for-an-organization">API documentation</a> for more details
/// </remarks>
/// <param name="org">Required: Organisation Name</param>
/// <param name="packageType">Required: The type of package</param>
IObservable<Package> GetAllForOrg(string org, PackageType packageType);

/// <summary>
/// List all packages for an organisations, readable by the current user
/// </summary>
/// <remarks>
/// See the <a href="https://docs.github.com/rest/packages#list-packages-for-an-organization">API documentation</a> for more details
/// </remarks>
/// <param name="org">Required: Organisation Name</param>
/// <param name="packageType">Required: The type of package</param>
/// <param name="options">Options for changing the API response</param>
IObservable<Package> GetAllForOrg(string org, PackageType packageType, ApiOptions options);

/// <summary>
/// List all packages for an organisations, readable by the current user
/// </summary>
Expand All @@ -16,7 +37,19 @@ public interface IObservablePackagesClient
/// <param name="org">Required: Organisation Name</param>
/// <param name="packageType">Required: The type of package</param>
/// <param name="packageVisibility">Optional: The visibility of the package</param>
IObservable<Package> GetAllForOrg(string org, PackageType packageType, PackageVisibility? packageVisibility = null);
IObservable<Package> GetAllForOrg(string org, PackageType packageType, PackageVisibility? packageVisibility);

/// <summary>
/// List all packages for an organisations, readable by the current user
/// </summary>
/// <remarks>
/// See the <a href="https://docs.github.com/rest/packages#list-packages-for-an-organization">API documentation</a> for more details
/// </remarks>
/// <param name="org">Required: Organisation Name</param>
/// <param name="packageType">Required: The type of package</param>
/// <param name="packageVisibility">Optional: The visibility of the package</param>
/// <param name="options">Options for changing the API response</param>
IObservable<Package> GetAllForOrg(string org, PackageType packageType, PackageVisibility? packageVisibility, ApiOptions options);

/// <summary>
/// Get a specific package for an Organization.
Expand Down Expand Up @@ -51,6 +84,35 @@ public interface IObservablePackagesClient
/// <param name="packageName">Required: The name of the package</param>
IObservable<Unit> RestoreForOrg(string org, PackageType packageType, string packageName);

/// <summary>
/// Lists packages owned by the authenticated user within the user's namespace
/// </summary>
/// <remarks>
/// See the <a href="https://docs.github.com/rest/packages#list-packages-for-the-authenticated-users-namespace">API documentation</a> for more details
/// </remarks>
/// <param name="packageType">Required: The type of package</param>
IObservable<Package> GetAllForActiveUser(PackageType packageType);

/// <summary>
/// Lists packages owned by the authenticated user within the user's namespace
/// </summary>
/// <remarks>
/// See the <a href="https://docs.github.com/rest/packages#list-packages-for-the-authenticated-users-namespace">API documentation</a> for more details
/// </remarks>
/// <param name="packageType">Required: The type of package</param>
/// <param name="options">Options for changing the API response</param>
IObservable<Package> GetAllForActiveUser(PackageType packageType, ApiOptions options);

/// <summary>
/// Lists packages owned by the authenticated user within the user's namespace
/// </summary>
/// <remarks>
/// See the <a href="https://docs.github.com/rest/packages#list-packages-for-the-authenticated-users-namespace">API documentation</a> for more details
/// </remarks>
/// <param name="packageType">Required: The type of package</param>
/// <param name="packageVisibility">Optional: The visibility of the package</param>
IObservable<Package> GetAllForActiveUser(PackageType packageType, PackageVisibility? packageVisibility);

/// <summary>
/// Lists packages owned by the authenticated user within the user's namespace
/// </summary>
Expand All @@ -59,7 +121,8 @@ public interface IObservablePackagesClient
/// </remarks>
/// <param name="packageType">Required: The type of package</param>
/// <param name="packageVisibility">Optional: The visibility of the package</param>
IObservable<Package> GetAllForActiveUser(PackageType packageType, PackageVisibility? packageVisibility = null);
/// <param name="options">Options for changing the API response</param>
IObservable<Package> GetAllForActiveUser(PackageType packageType, PackageVisibility? packageVisibility, ApiOptions options);

/// <summary>
/// Gets a specific package for a package owned by the authenticated user.
Expand Down Expand Up @@ -91,6 +154,38 @@ public interface IObservablePackagesClient
/// <param name="packageName">Required: The name of the package</param>
IObservable<Unit> RestoreForActiveUser(PackageType packageType, string packageName);

/// <summary>
/// Lists packages owned by the authenticated user within the user's namespace
/// </summary>
/// <remarks>
/// See the <a href="https://docs.github.com/rest/packages#list-packages-for-the-authenticated-users-namespace">API documentation</a> for more details
/// </remarks>
/// <param name="username">Required: Username</param>
/// <param name="packageType">Required: The type of package</param>
IObservable<Package> GetAllForUser(string username, PackageType packageType);

/// <summary>
/// Lists packages owned by the authenticated user within the user's namespace
/// </summary>
/// <remarks>
/// See the <a href="https://docs.github.com/rest/packages#list-packages-for-the-authenticated-users-namespace">API documentation</a> for more details
/// </remarks>
/// <param name="username">Required: Username</param>
/// <param name="packageType">Required: The type of package</param>
/// <param name="options">Options for changing the API response</param>
IObservable<Package> GetAllForUser(string username, PackageType packageType, ApiOptions options);

/// <summary>
/// Lists packages owned by the authenticated user within the user's namespace
/// </summary>
/// <remarks>
/// See the <a href="https://docs.github.com/rest/packages#list-packages-for-the-authenticated-users-namespace">API documentation</a> for more details
/// </remarks>
/// <param name="username">Required: Username</param>
/// <param name="packageType">Required: The type of package</param>
/// <param name="packageVisibility">Optional: The visibility of the package</param>
IObservable<Package> GetAllForUser(string username, PackageType packageType, PackageVisibility? packageVisibility);

/// <summary>
/// Lists packages owned by the authenticated user within the user's namespace
/// </summary>
Expand All @@ -100,7 +195,8 @@ public interface IObservablePackagesClient
/// <param name="username">Required: Username</param>
/// <param name="packageType">Required: The type of package</param>
/// <param name="packageVisibility">Optional: The visibility of the package</param>
IObservable<Package> GetAllForUser(string username, PackageType packageType, PackageVisibility? packageVisibility = null);
/// <param name="options">Options for changing the API response</param>
IObservable<Package> GetAllForUser(string username, PackageType packageType, PackageVisibility? packageVisibility, ApiOptions options);

/// <summary>
/// Gets a specific package metadata for a public package owned by a user.
Expand Down
Loading

0 comments on commit bdc1694

Please sign in to comment.