public static async Task <TResult?> ExecuteAndTryReturnAsync <TResult>(this IApiClientOperation <TResult> operation, CancellationToken cancellationToken = default)
            where TResult : class
        {
            TResult?result = null;

            await operation.OnSuccess(r => result = r).ExecuteAsync(cancellationToken);

            return(result);
        }
        public static async Task <TResult> ExecuteAndEnsureReturnAsync <TResult>(this IApiClientOperation <TResult> operation, CancellationToken cancellationToken = default)
            where TResult : class
        {
            TResult?result = null;

            await operation
            .OnSuccess(r => result = r)
            .OnFailure(problem => throw new HttpRequestException(problem.Detail, null, (HttpStatusCode?)problem.Status))
            .ExecuteAsync(cancellationToken);

            Debug.Assert(result is not null);

            return(result);
        }