Files
Swarm/DysonNetwork.Drive/Interfaces/IFileReferenceService.cs

41 lines
2.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using DysonNetwork.Drive.Models;
namespace DysonNetwork.Drive.Interfaces;
public interface IFileReferenceService
{
Task<CloudFileReference> CreateReferenceAsync(
Guid fileId,
string resourceId,
string resourceType,
string referenceType,
string? referenceId = null,
string? referenceName = null,
string? referenceMimeType = null,
long? referenceSize = null,
string? referenceUrl = null,
string? referenceThumbnailUrl = null,
string? referencePreviewUrl = null,
string? referenceMetadata = null,
IDictionary<string, object>? metadata = null,
CancellationToken cancellationToken = default);
Task<CloudFileReference> GetReferenceAsync(Guid referenceId, CancellationToken cancellationToken = default);
Task<IEnumerable<CloudFileReference>> GetReferencesForFileAsync(Guid fileId, CancellationToken cancellationToken = default);
Task<IEnumerable<CloudFileReference>> GetReferencesForResourceAsync(string resourceId, string resourceType, CancellationToken cancellationToken = default);
Task<IEnumerable<CloudFileReference>> GetReferencesOfTypeAsync(string referenceType, CancellationToken cancellationToken = default);
Task<bool> DeleteReferenceAsync(Guid referenceId, CancellationToken cancellationToken = default);
Task<int> DeleteReferencesForFileAsync(Guid fileId, CancellationToken cancellationToken = default);
Task<int> DeleteReferencesForResourceAsync(string resourceId, string resourceType, CancellationToken cancellationToken = default);
Task<CloudFileReference> UpdateReferenceMetadataAsync(Guid referenceId, IDictionary<string, object> metadata, CancellationToken cancellationToken = default);
Task<bool> ReferenceExistsAsync(Guid referenceId, CancellationToken cancellationToken = default);
Task<bool> HasReferenceAsync(Guid fileId, string resourceId, string resourceType, string? referenceType = null, CancellationToken cancellationToken = default);
Task<CloudFileReference> UpdateReferenceResourceAsync(Guid referenceId, string newResourceId, string newResourceType, CancellationToken cancellationToken = default);
Task<IEnumerable<CloudFile>> GetFilesForResourceAsync(string resourceId, string resourceType, string? referenceType = null, CancellationToken cancellationToken = default);
Task<IEnumerable<CloudFile>> GetFilesForReferenceTypeAsync(string referenceType, CancellationToken cancellationToken = default);
}