Skip to content

Conversation

@ChaseDRedmon
Copy link
Owner

  1. Organize Requests and Clients into subfolders;
  2. Rename CreateAlbumRequest.cs to RemoteCreateAlbumRequest.cs.
  3. Add LocalCreateAlbumRequest.cs to create albums on catbox while uploading local files.
  4. Create abstraction for Local and Remote Requests: AlbumCreationRequest.cs.
  5. Begin work on CatBox client abstraction layer and created a method to upload files and create an album in one step.
  6. Working on better error handling from the API side of things.

…est.cs to RemoteCreateAlbumRequest.cs. Add LocalCreateAlbumRequest.cs to create albums on catbox while uploading local files. Create abstraction for Local and Remote Requests: AlbumCreationRequest.cs. Begin work on CatBox client abstraction layer and created a method to upload files and create an album in one step. Working on better error handling from the API side of things.
@ChaseDRedmon ChaseDRedmon self-assigned this May 6, 2023
@ChaseDRedmon ChaseDRedmon marked this pull request as draft May 6, 2023 04:27
…thods for uploading files and creating albums.
…matting, variable renaming, etc. Add upload to album request type. Renamed some request types. Trying out AnyOf request type to simplify API usage
…aks to Delegating Handler for exception throwing
…eter code. Remove ToRequest methods that converted Enums to API equivalent request values. Add AddHttpClientWithMessageHandler extension method to clean up service registration. Code comments. Code organization.
@ChaseDRedmon ChaseDRedmon marked this pull request as ready for review July 2, 2023 19:45
…f union type. Add AnyOf dependency. Add IAlbumUploadRequest.cs to abstract CreateAlbumRequest.cs and UploadToAlbumRequest.cs. Remove redundant upload methods in CatBox.cs. Rename Upload methods in CatBoxClient.cs. Change return type CatBoxClient.UplaodImage to IAsyncEnumerable<string?> instead of Task<string?>.
@ChaseDRedmon
Copy link
Owner Author

  1. Moved some files around to organized the folder structure.
  2. Removed throw new methods to replace them with the built in Throw helper class.
  3. Abstracted away Create and Upload album requests under new IAlbumUploadRequest interface to simply CatBox service class and method calls. Removed CreateAlbumRequest types as they are consolidated under the introduction of the AnyOf union dependency that was added to the project to reduce the number of Request types in the library

Will work on a list of breaking changes from 0.3 -> 0.4 later on

Comment on lines 17 to 20
public static void IfNull([DoesNotReturnIf(true)] object? s, [CallerArgumentExpression("s")] string memberName = "")
{
if (s is null) throw new ArgumentNullException(memberName, "Argument cannot be null");
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could just do

    public static void IfNull([DoesNotReturnIf(true)] object? s, [CallerArgumentExpression("s")] string memberName = "")
    {
        ArgumentNullException.ThrowIfNull(s, memberName);
    }

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the library includes a minimum target to .NET Standard 2.1 (the minimum version for C# 8 to support async-enumerables), the ArgumentNullException.ThrowIfNull isn't present in the BCL at this point. That was added in a later version of .NET

@ChaseDRedmon
Copy link
Owner Author

Latest feedback has been taken into consideration and committed into codebase

ChaseDRedmon and others added 6 commits November 24, 2025 13:44
Standardizes base class naming by adding "Base" suffix to abstract request classes. This improves code clarity by making inheritance hierarchies more explicit.

Changes:
- Rename AlbumCreationRequest → AlbumCreationRequestBase
- Rename Album → AlbumBase
- Rename UploadRequest → UploadRequestBase
- Rename TemporaryRequest → TemporaryRequestBase
- Update all derived classes to reference new base class names

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Removes interface abstractions for client classes, transitioning to direct concrete type registration. This simplifies the architecture by eliminating unnecessary abstraction layers.

Changes:
- Remove ICatBox, ICatBoxClient, and ILitterboxClient interfaces
- Update DI registration to use concrete types directly
- Aligns with modern DI practices where interfaces are only needed for multiple implementations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Moves Throw helper class from root namespace to CatBox.NET.Client namespace for better logical organization. The class contains HTTP client-specific validation helpers for file size limits and album operations.

Changes:
- Move src/CatBox.NET/Throw.cs → src/CatBox.NET/Client/Throw.cs
- Add AssemblyInfo.cs with InternalsVisibleTo attribute for test projects
- Improves code organization by placing validation helpers near their usage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Refactors client implementation code to utilize the new Throw helper methods, improving error handling consistency. Updates method signatures to work with renamed base classes and enhances validation logic throughout upload and album management operations.

Changes:
- Update CatBox.cs, CatBoxClient.cs, and LitterboxClient.cs with improved validation
- Streamline file processing in both CatBox and Litterbox clients
- Enhance error handling consistency using centralized Throw helpers
- Update method signatures for renamed base classes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Removes custom ApiValueAttribute in favor of Intellenum source generator pattern. Refactors RequestType and ExpireAfter enums to use Intellenum's built-in value mapping, eliminating the need for custom attribute reflection.

Changes:
- Delete src/CatBox.NET/Attributes/ApiValueAttribute.cs
- Refactor RequestType and ExpireAfter to use Intellenum
- Update RequestParameters enum implementation
- Improves performance by leveraging modern C# source generation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Enhances exception classes with more descriptive error messages and improved property names. Updates logger extensions for better diagnostic information and provides clearer feedback when API errors occur.

Changes:
- Enhance CatBoxAPIExceptions with better error messages
- Update exception properties for clarity
- Improve logger extensions with better diagnostics
- Add detailed messages for file size limit violations and invalid request types

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
ChaseDRedmon and others added 10 commits November 24, 2025 13:46
Updates request model classes with improved validation using the refactored Throw helper. Enhances documentation on request properties and standardizes null checks and parameter validation across all request types.

Changes:
- Update IAlbumUploadRequest, EditAlbumRequest, and ModifyAlbumImagesRequest
- Enhance validation in DeleteFileRequest, FileUploadRequest, and StreamUploadRequest
- Update UrlUploadRequest with improved validation
- Ensure consistent error messaging for invalid inputs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Updates project file with new dependencies and build configuration. Removes TaskAsyncEnumerableExtensions.cs as async enumerable handling is now integrated directly into client methods. Updates options class for improved configuration validation.

Changes:
- Update CatBox.NET.csproj with dependency changes
- Delete Extensions/TaskAsyncEnumerableExtensions.cs (functionality moved to clients)
- Update CatboxOptions.cs with improved validation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Implements comprehensive test coverage including unit tests with mocked HTTP responses and integration tests against live APIs. Adds test helper classes for creating mock HTTP clients and managing test configuration.

Changes:
- Add CatBoxClientTests.cs and CatBoxClientIntegrationTests.cs
- Add LitterboxClientTests.cs and LitterboxClientIntegrationTests.cs
- Add CommonTests.cs for utility function testing
- Create test helpers (HttpClientTestHelper, IntegrationTestConfig)
- Include test image assets (test-file.png, test-file.svg)
- Add comprehensive test documentation in README
- Remove unused Usings.cs global using directives file
- Update test project configuration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Updates the sample application to demonstrate the refactored API. Shows usage of new request patterns, concrete client types, and enhanced error handling. Updates project dependencies to match library changes and provides practical examples of album creation, file uploads, and error scenarios.

Changes:
- Update Program.cs with examples using refactored API
- Demonstrate new request patterns and error handling
- Update SampleApp.csproj dependencies
- Add practical usage examples for library consumers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Transitions from legacy .sln format to modern XML-based .slnx solution file format. This provides better merge conflict resolution and human-readability for the solution configuration.

Changes:
- Delete CatBox.NET.sln (legacy format)
- Add CatBox.NET.slnx (modern XML format)
- Improves version control friendliness

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Adds IDE-specific configuration files for Claude Code, JetBrains Rider, and Visual Studio Code. Configures workspace settings, project structure preferences, and code style rules to improve developer experience across different IDEs.

Changes:
- Add .claude/settings.local.json for Claude Code configuration
- Add .idea/.idea.CatBox.NET/.idea/projectSettingsUpdater.xml for Rider
- Add .vscode/settings.json for Visual Studio Code
- Standardizes development environment setup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Updates main README to reflect the architectural changes, including removal of interfaces, new request patterns, and updated usage examples. Documents breaking changes and provides migration guidance for users upgrading from previous versions.

Changes:
- Update README with refactored API examples
- Document breaking changes (interface removal, renamed base classes)
- Add migration guidance for existing users
- Update usage examples to reflect new patterns

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
* Add qodana.yaml file

* Add github workflow file

---------

Co-authored-by: Qodana Application <qodana-support@jetbrains.com>
@ChaseDRedmon ChaseDRedmon merged commit 7ab8344 into main Nov 24, 2025
1 check passed
@ChaseDRedmon ChaseDRedmon deleted the feature/Albums branch November 24, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants