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

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.

2 participants