From cbf3b1f724ff6b6ac2c006d48657627a49b31277 Mon Sep 17 00:00:00 2001 From: anthonychaussin Date: Wed, 15 Oct 2025 15:15:51 +0200 Subject: [PATCH 1/6] - Better error handling - Use Option Object instead of multiple parameters - File validator - Use ArrayPool for better memory use - Add some test --- DriveClient/Helpers/KDriveErrorHandler.cs | 39 ++++++++ DriveClient/Helpers/KDriveJsonHelper.cs | 19 +--- DriveClient/Models/KDriveClientOptions.cs | 28 ++++++ DriveClient/Models/KDriveFile.cs | 15 ++- DriveClient/Models/KDriveUploadResponse.cs | 6 +- DriveClient/kDriveClient.csproj | 6 +- DriveClient/kDriveClient/KDriveClient.cs | 95 ++++++++++++------- DriveClient/kDriveClient/Upload.cs | 39 ++++---- .../kDriveClient/KDriveClientTests.cs | 62 +++++++++++- DriveClientTests/kDriveClientTests.csproj | 1 + .../KDriveClientUploadTests.csproj | 24 +++++ .../kDriveClient/KDriveClientTests.cs | 42 ++++++++ README.md | 6 +- 13 files changed, 295 insertions(+), 87 deletions(-) create mode 100644 DriveClient/Helpers/KDriveErrorHandler.cs create mode 100644 DriveClient/Models/KDriveClientOptions.cs create mode 100644 KDriveClientUploadTests/KDriveClientUploadTests.csproj create mode 100644 KDriveClientUploadTests/kDriveClient/KDriveClientTests.cs diff --git a/DriveClient/Helpers/KDriveErrorHandler.cs b/DriveClient/Helpers/KDriveErrorHandler.cs new file mode 100644 index 0000000..e620432 --- /dev/null +++ b/DriveClient/Helpers/KDriveErrorHandler.cs @@ -0,0 +1,39 @@ +using kDriveClient.Models.Exceptions; + +namespace kDriveClient.Helpers +{ + /// + /// KDriveErrorHandler provides methods to handle API errors from kDrive. + /// + public static class KDriveErrorHandler + { + /// + /// HandleApiErrorAsync checks the HTTP response for errors and throws a KDriveApiException if an error is found. + /// + /// Response from the kDrive API + /// Cancellation token + /// Task + /// KDriveApiException is thrown when an error is found in the response + public static async Task HandleApiErrorAsync(HttpResponseMessage response, CancellationToken ct) + { + if (!response.IsSuccessStatusCode) + { + KDriveErrorResponse? error = null; + try + { + await using var stream = await response.Content.ReadAsStreamAsync(ct); + error = await JsonSerializer.DeserializeAsync(stream, KDriveJsonContext.Default.KDriveErrorResponse, cancellationToken: ct); + } + catch + { + response.EnsureSuccessStatusCode(); + } + + if (error is not null) + { + throw new KDriveApiException(error); + } + } + } + } +} \ No newline at end of file diff --git a/DriveClient/Helpers/KDriveJsonHelper.cs b/DriveClient/Helpers/KDriveJsonHelper.cs index 4cd29c3..bbbb263 100644 --- a/DriveClient/Helpers/KDriveJsonHelper.cs +++ b/DriveClient/Helpers/KDriveJsonHelper.cs @@ -52,24 +52,7 @@ public static (string Token, string UploadUrl) ParseStartSessionResponse(string /// Thrown when the response indicates an error. public static async Task DeserializeResponseAsync(HttpResponseMessage response, CancellationToken ct) { - if (!response.IsSuccessStatusCode) - { - KDriveErrorResponse? error = null; - try - { - await using var stream = await response.Content.ReadAsStreamAsync(ct); - error = await JsonSerializer.DeserializeAsync(stream, KDriveJsonContext.Default.KDriveErrorResponse, cancellationToken: ct); - } - catch - { - response.EnsureSuccessStatusCode(); - } - - if (error is not null) - { - throw new KDriveApiException(error); - } - } + await KDriveErrorHandler.HandleApiErrorAsync(response, ct); return response; } diff --git a/DriveClient/Models/KDriveClientOptions.cs b/DriveClient/Models/KDriveClientOptions.cs new file mode 100644 index 0000000..279034c --- /dev/null +++ b/DriveClient/Models/KDriveClientOptions.cs @@ -0,0 +1,28 @@ +namespace kDriveClient.Models +{ + /// + /// KDriveClientOptions holds configuration options for the KDriveClient. + /// + public class KDriveClientOptions + { + /// + /// Number of parallel chunk to upload. + /// + public int Parallelism { get; set; } = 4; + + /// + /// Size of each chunk in bytes when performing chunked uploads. + /// + public int? ChunkSize { get; set; } + + /// + /// Threshold in bytes to decide between direct upload and chunked upload. + /// + public long DirectUploadThresholdBytes { get; set; } = 1L * 1024 * 1024; + + /// + /// Use automatic chunk size adjustment based on bandwidth. + /// + public bool UseAutoChunkSize { get; set; } = true; + } +} \ No newline at end of file diff --git a/DriveClient/Models/KDriveFile.cs b/DriveClient/Models/KDriveFile.cs index ef73688..d20b04a 100644 --- a/DriveClient/Models/KDriveFile.cs +++ b/DriveClient/Models/KDriveFile.cs @@ -1,4 +1,5 @@ -using System.Text; +using System.Buffers; +using System.Text; namespace kDriveClient.Models { @@ -85,7 +86,8 @@ public void SplitIntoChunks(int chunkSize) throw new InvalidOperationException("Content stream is null."); } - var buffer = new byte[chunkSize]; + var pool = ArrayPool.Shared; + var buffer = pool.Rent(chunkSize); int chunkNumber = 0; int bytesRead; @@ -93,12 +95,15 @@ public void SplitIntoChunks(int chunkSize) using var fileSha256 = IncrementalHash.CreateHash(HashAlgorithmName.SHA256); while ((bytesRead = this.Content.Read(buffer, 0, chunkSize)) > 0) { - byte[] content = [.. buffer.Take(bytesRead)]; - var chunkHash = SHA256.HashData(content); - this.Chunks.Add(new KDriveChunk(content, chunkNumber++, chunkHash)); + var chunkData = new byte[bytesRead]; + Array.Copy(buffer, chunkData, bytesRead); + var chunkHash = SHA256.HashData(chunkData); + this.Chunks.Add(new KDriveChunk(chunkData, chunkNumber++, chunkHash)); fileSha256.AppendData(Encoding.UTF8.GetBytes(Convert.ToHexString(chunkHash).ToLowerInvariant())); } + pool.Return(buffer); + this.Content.Dispose(); GC.Collect(); diff --git a/DriveClient/Models/KDriveUploadResponse.cs b/DriveClient/Models/KDriveUploadResponse.cs index 72e10f3..5c606fa 100644 --- a/DriveClient/Models/KDriveUploadResponse.cs +++ b/DriveClient/Models/KDriveUploadResponse.cs @@ -95,17 +95,17 @@ public class KDriveUploadResponse : ApiResultBase /// /// File or folder type. /// - public required string Type { get; set; } + public string Type { get; set; } /// /// Current status of the file. /// - public required string Status { get; set; } + public string Status { get; set; } /// /// Visibility of the file. /// - public required string Visibility { get; set; } + public string Visibility { get; set; } /// /// Drive ID associated with the file. diff --git a/DriveClient/kDriveClient.csproj b/DriveClient/kDriveClient.csproj index 68c15a0..c9fdce1 100644 --- a/DriveClient/kDriveClient.csproj +++ b/DriveClient/kDriveClient.csproj @@ -23,8 +23,7 @@ Native .NET logging support README.md https://github.com/anthonychaussin/DriveClient infomaniak;kDrive;wrapper;c#;DotNet - - ✨ New features + ✨ New features - Improve chunk size estimation - Improve memory management - Complete kDrive File Object @@ -35,8 +34,7 @@ Native .NET logging support - Add custom chunk size support and fix total_chunk_hash calculation - Add optional chunkSize parameter to KDriveClient constructor - Fix total_chunk_hash calculation to hash concatenated chunk hash hex strings - - Use IncrementalHash for efficient hash computation during file chunking - + - Use IncrementalHash for efficient hash computation during file chunking en LICENSE.txt True diff --git a/DriveClient/kDriveClient/KDriveClient.cs b/DriveClient/kDriveClient/KDriveClient.cs index fb94cb8..558ac6d 100644 --- a/DriveClient/kDriveClient/KDriveClient.cs +++ b/DriveClient/kDriveClient/KDriveClient.cs @@ -31,7 +31,7 @@ public partial class KDriveClient : IKDriveClient /// /// Number of parallel threads to use for chunked uploads. /// - private Int32 Parallelism { get; set; } = 4; + public Int32 Parallelism { get; private set; } = 4; /// /// Rate limiter to control the rate of requests sent to the kDrive API according to their rate limits @@ -51,7 +51,7 @@ public partial class KDriveClient : IKDriveClient /// /// Dynamic chunk size in bytes. This is determined based on the speed test and is used for chunked uploads. /// - private Int32 DynamicChunkSizeBytes { get; set; } + public Int32 DynamicChunkSizeBytes { get; private set; } /// /// Progress reporter for tracking upload progress. @@ -63,7 +63,7 @@ public partial class KDriveClient : IKDriveClient /// /// Bearer token /// Drive ID - public KDriveClient(string token, long driveId) : this(token, driveId, true, 4, null) + public KDriveClient(string token, long driveId) : this(token, driveId, new KDriveClientOptions()) { } /// @@ -72,7 +72,25 @@ public KDriveClient(string token, long driveId) : this(token, driveId, true, 4, /// Bearer token /// Drive ID /// Logger - public KDriveClient(string token, long driveId, ILogger? logger) : this(token, driveId, true, 4, logger) + public KDriveClient(string token, long driveId, ILogger? logger) : this(token, driveId, new KDriveClientOptions(), logger) + { } + + /// + /// Constructs a new instance of the KDriveClient with custom options. + /// + /// Bearer token + /// Drive ID + /// Options + public KDriveClient(string token, long driveId, KDriveClientOptions options) : this(token, driveId, options, null) + { } + + /// + /// Constructs a new instance of the KDriveClient with custom HttpClient. + /// + /// Bearer token + /// Drive ID + /// Custom HttpClient + public KDriveClient(string token, long driveId, HttpClient? httpClient) : this(token, driveId, new KDriveClientOptions(), null, httpClient) { } /// @@ -80,10 +98,9 @@ public KDriveClient(string token, long driveId, ILogger? logger) : /// /// Bearer token /// Drive ID - /// Choose if we should make a speed test to optimize chunks - /// Number of parrallels threads + /// /// Logger - public KDriveClient(string token, long driveId, bool autoChunk, int parallelism, ILogger? logger) : this(token, driveId, autoChunk, parallelism, logger, null, null) + public KDriveClient(string token, long driveId, KDriveClientOptions options, ILogger? logger) : this(token, driveId, options, logger, null) { } /// @@ -91,46 +108,44 @@ public KDriveClient(string token, long driveId, bool autoChunk, int parallelism, /// /// Bearer token /// Drive ID - /// Choose if we should make a speed test to optimize chunks - /// Number of parrallels threads + /// Options /// Logger - /// Custome HttpClient - /// Optional custom chunk size in bytes. If not specified, will be calculated dynamically based on speed test when autoChunk is true. - public KDriveClient(string token, long driveId, bool autoChunk, int parallelism, ILogger? logger, HttpClient? httpClient = null, int? chunkSize = null) + /// Custom HttpClient + public KDriveClient(string token, long driveId, KDriveClientOptions options, ILogger? logger, HttpClient? httpClient = null) { DriveId = driveId; - Parallelism = parallelism; + Parallelism = options.Parallelism; Logger = logger; - string version = Assembly.GetEntryAssembly()?.GetName().Version?.ToString() ?? "unknown"; HttpClient = httpClient ?? new HttpClient { BaseAddress = new Uri("https://api.infomaniak.com") }; HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); HttpClient.DefaultRequestHeaders.UserAgent.ParseAdd("kDriveClient.NET/" + GetVersion()); this.Logger?.LogInformation("KDriveClient initialized with Drive ID: {DriveId}", DriveId); - if (autoChunk) + if (options.UseAutoChunkSize) { this.Logger?.LogInformation("Auto chunking enabled, initializing upload strategy..."); - InitializeUploadStrategyAsync(chunkSize).GetAwaiter().GetResult(); + InitializeUploadStrategyAsync().GetAwaiter().GetResult(); this.Logger?.LogInformation("Upload strategy initialized with direct upload threshold: {Threshold} bytes and dynamic chunk size: {ChunkSize} bytes", DirectUploadThresholdBytes, DynamicChunkSizeBytes); } - else if (chunkSize is null) // If autoChunk is disabled and no custom chunk size provided, use a default + else if (options.ChunkSize is null) // If autoChunk is disabled and no custom chunk size provided, use a default { DynamicChunkSizeBytes = 1024 * 1024; // Default to 1MB chunks this.Logger?.LogInformation("Using default chunk size: {ChunkSize} bytes", DynamicChunkSizeBytes); } else { - DynamicChunkSizeBytes = chunkSize.Value; + DynamicChunkSizeBytes = (int)options.ChunkSize; this.Logger?.LogInformation("Using custom chunk size: {ChunkSize} bytes", DynamicChunkSizeBytes); } } /// /// Uploads a file to kDrive, automatically determining the upload strategy based on file size. + /// Throws if the file is invalid. /// - /// to upload - /// Cancellation token to cancel the operation. - /// of your uploaded file + /// File to upload. + /// Cancellation token. + /// Upload response. public async Task UploadAsync(KDriveFile file, CancellationToken ct = default) { file.SplitIntoChunks(this.DynamicChunkSizeBytes); @@ -155,23 +170,39 @@ public async Task UploadAsync(KDriveFile file, Cancellatio /// protected virtual async Task SendAsync(HttpRequestMessage request, CancellationToken ct = default) { - using var lease = await RateLimiter.AcquireAsync(1, ct); - if (!lease.IsAcquired) + int maxRetries = 3; + int delay = 500; + var lastException = default(Exception); + for (int i = 0; i < maxRetries; i++) { - if (lease.TryGetMetadata("RETRY_AFTER", out var obj) && obj is TimeSpan retryAfter) + try { - Logger?.LogInformation("Rate limit reached. Retry-After {RetryAfter}", retryAfter); - await Task.Delay(retryAfter, ct); + using var lease = await RateLimiter.AcquireAsync(1, ct); + if (!lease.IsAcquired) + { + if (lease.TryGetMetadata("RETRY_AFTER", out var obj) && obj is TimeSpan retryAfter) + { + Logger?.LogInformation("Rate limit reached. Retry-After {RetryAfter}", retryAfter); + await Task.Delay(retryAfter, ct); + } + else + { + Logger?.LogWarning("Rate limit exceeded for request: {RequestMethod} {RequestUri}", request.Method, request.RequestUri); + throw new HttpRequestException("Rate limit exceeded"); + } + } + + Logger?.LogInformation("Sending request: {RequestMethod} {RequestUri}", request.Method, request.RequestUri); + return await SendWithErrorHandlingAsync(request, ct); } - else + catch (HttpRequestException ex) when (i < maxRetries - 1) { - Logger?.LogWarning("Rate limit exceeded for request: {RequestMethod} {RequestUri}", request.Method, request.RequestUri); - throw new HttpRequestException("Rate limit exceeded"); + await Task.Delay(delay, ct); + delay *= 2; + lastException = ex; } } - - Logger?.LogInformation("Sending request: {RequestMethod} {RequestUri}", request.Method, request.RequestUri); - return await SendWithErrorHandlingAsync(request, ct); + throw new HttpRequestException("Maximum retry attempts exceeded", lastException); } /// diff --git a/DriveClient/kDriveClient/Upload.cs b/DriveClient/kDriveClient/Upload.cs index c52da1f..eb673de 100644 --- a/DriveClient/kDriveClient/Upload.cs +++ b/DriveClient/kDriveClient/Upload.cs @@ -17,21 +17,7 @@ public partial class KDriveClient /// public async Task UploadFileDirectAsync(KDriveFile file, CancellationToken ct = default) { - if (file.Content == null) - { - this.Logger?.LogError("File content is null or empty"); - throw new ArgumentException("File content is required", nameof(file)); - } - else if (string.IsNullOrWhiteSpace(file.Name)) - { - this.Logger?.LogError("File name is null or empty"); - throw new ArgumentException("File name is required", nameof(file)); - } - else if (file.TotalSize <= 0) - { - this.Logger?.LogError("File size is less than or equal to 0"); - throw new ArgumentException("File size must be greater than 0", nameof(file)); - } + ValidateFile(file); this.Logger?.LogInformation("Starting direct upload for file '{FileName}' with size {FileSize} bytes...", file.Name, file.TotalSize); var response = await SendAsync(KDriveRequestFactory.CreateUploadDirectRequest(DriveId, file), ct); @@ -59,11 +45,7 @@ public async Task UploadFileDirectAsync(KDriveFile file, C /// public async Task UploadFileChunkedAsync(KDriveFile file, CancellationToken ct = default) { - if (file.Content == null) - { - this.Logger?.LogError("File content is null or empty"); - throw new ArgumentException("File content is required", nameof(file)); - } + ValidateFile(file); this.Logger?.LogInformation("Starting chunked upload for file '{FileName}' with size {FileSize} bytes...", file.Name, file.TotalSize); var (sessionToken, uploadUrl) = await StartUploadSessionAsync(file, ct); @@ -145,7 +127,7 @@ private async Task UploadChunkAsync(string uploadUrl, string sessionToken, KDriv var uploaded = (chunk.ChunkNumber + 1) * chunk.ChunkSize; var percent = Math.Min(100.0, uploaded * 100.0 / file.TotalSize); - Progress?.Report(percent); + this.Progress?.Report(percent); this.Logger?.LogInformation("Chunk {ChunkNumber}/{TotalChunks} for file '{FileName}' uploaded successfully. Uploaded {UploadedSize} bytes ({Percent}%).", chunk.ChunkNumber + 1, file.Chunks.Count, file.Name, uploaded, percent); } @@ -198,5 +180,20 @@ private async Task CancelUploadSessionRequest(string sessionToken, Cance this.Logger?.LogInformation("Upload session with token '{SessionToken}' cancelled successfully.", sessionToken); return await response.Content.ReadAsStringAsync(ct); } + + /// + /// Validates the file before upload. + /// + /// kDriveFile to validate + /// Exception thrown if validation fails + private static void ValidateFile(KDriveFile file) + { + if (file.Content == null) + throw new ArgumentException("File content is required", nameof(file)); + if (string.IsNullOrWhiteSpace(file.Name) || file.Name.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0) + throw new ArgumentException("File name is invalid", nameof(file)); + if (file.TotalSize <= 0) + throw new ArgumentException("File size must be greater than 0", nameof(file)); + } } } \ No newline at end of file diff --git a/DriveClientTests/kDriveClient/KDriveClientTests.cs b/DriveClientTests/kDriveClient/KDriveClientTests.cs index e863908..80d70a6 100644 --- a/DriveClientTests/kDriveClient/KDriveClientTests.cs +++ b/DriveClientTests/kDriveClient/KDriveClientTests.cs @@ -2,6 +2,7 @@ using kDriveClient.Models; using Microsoft.Extensions.Logging; using System.Net; +using Moq; namespace kDriveClientTests.kDriveClient { @@ -18,7 +19,7 @@ public async Task UploadDirect_Should_ConstructProperRequest() var handler = new FakeHttpMessageHandler(response); var logger = LoggerFactory.Create(builder => builder.AddConsole()).CreateLogger(); - var client = new KDriveClient("token", 111, false, 4, logger, new HttpClient(handler) { BaseAddress = new Uri("https://api.infomaniak.com") }); + var client = new KDriveClient("token", 111, new KDriveClientOptions(), logger, new HttpClient(handler) { BaseAddress = new Uri("https://api.infomaniak.com") }); var file = new KDriveFile { Name = "example.txt", @@ -33,6 +34,65 @@ public async Task UploadDirect_Should_ConstructProperRequest() StringAssert.Contains(handler.LastRequest.RequestUri!.ToString(), "/upload?"); Assert.AreEqual(HttpMethod.Post, handler.LastRequest.Method); } + + [TestMethod()] + public async Task UploadFileChunkedAsync_Should_CancelSession_OnError() + { + var file = new KDriveFile + { + Name = "test.txt", + Content = new MemoryStream([1, 2, 3]), + Chunks = + [ + new KDriveChunk([1], 0, [0x00]), + new KDriveChunk([2], 1, [0x01]) + ] + }; + var handler = new FakeHttpMessageHandler(new HttpResponseMessage(HttpStatusCode.InternalServerError)); + var logger = LoggerFactory.Create(builder => builder.AddConsole()).CreateLogger(); + var client = new KDriveClient("token", 111, new KDriveClientOptions(), logger, new HttpClient(handler)); + + await Assert.ThrowsExceptionAsync(async () => + { + await client.UploadFileChunkedAsync(file); + }); + } + + [TestMethod()] + public async Task UploadFileChunkedAsync_Should_UploadChunks_And_FinishSession() + { + var file = new KDriveFile + { + Name = "test.txt", + Content = new MemoryStream([1, 2, 3]), + Chunks = + [ + new KDriveChunk([1], 0, [0x00]), + new KDriveChunk([2], 1, [0x01]) + ] + }; + var response = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent("""{"result":"success","data":{"file":{"id":123,"name":"test.txt"}}}""") + }; + var handler = new FakeHttpMessageHandler(response); + var logger = LoggerFactory.Create(builder => builder.AddConsole()).CreateLogger(); + var client = new KDriveClient("token", 111, new KDriveClientOptions(), logger, new HttpClient(handler)); + var result = await client.UploadFileChunkedAsync(file); + + Assert.AreEqual(123, result.Id); + Assert.AreEqual("test.txt", result.Name); + } + + [TestMethod] + public void UploadAsync_Should_UseCustomOptions() + { + var options = new KDriveClientOptions { Parallelism = 8, ChunkSize = 512 * 1024 }; + var logger = new Mock>().Object; + var client = new KDriveClient("token", 123, options, logger); + Assert.AreEqual(8, client.Parallelism); + Assert.AreEqual(512 * 1024, client.DynamicChunkSizeBytes); + } } diff --git a/DriveClientTests/kDriveClientTests.csproj b/DriveClientTests/kDriveClientTests.csproj index 4dd425a..f235226 100644 --- a/DriveClientTests/kDriveClientTests.csproj +++ b/DriveClientTests/kDriveClientTests.csproj @@ -10,6 +10,7 @@ + diff --git a/KDriveClientUploadTests/KDriveClientUploadTests.csproj b/KDriveClientUploadTests/KDriveClientUploadTests.csproj new file mode 100644 index 0000000..25a25c7 --- /dev/null +++ b/KDriveClientUploadTests/KDriveClientUploadTests.csproj @@ -0,0 +1,24 @@ + + + + net9.0 + latest + enable + enable + + + + + + + + + + + + + + + + + diff --git a/KDriveClientUploadTests/kDriveClient/KDriveClientTests.cs b/KDriveClientUploadTests/kDriveClient/KDriveClientTests.cs new file mode 100644 index 0000000..4326d2a --- /dev/null +++ b/KDriveClientUploadTests/kDriveClient/KDriveClientTests.cs @@ -0,0 +1,42 @@ +using kDriveClient.kDriveClient; +using kDriveClient.Models; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; + +namespace kDriveClient.kDriveClient.Tests +{ + [TestClass()] + public class KDriveClientTests + { + [TestMethod()] + public async Task UploadFileChunkedAsync_Should_CancelSession_OnError() + { + // Arrange + var file = new KDriveFile + { + Name = "test.txt", + Content = new MemoryStream([1, 2, 3]), + Chunks = new List + { + new KDriveChunk([1], 0, [0x00]), + new KDriveChunk([2], 1, [0x01]) + } + }; + var handler = new FakeHttpMessageHandler(new HttpResponseMessage(HttpStatusCode.InternalServerError)); + var logger = LoggerFactory.Create(builder => builder.AddConsole()).CreateLogger(); + var client = new KDriveClient("token", 111, false, 4, logger, new HttpClient(handler)); + + // Act & Assert + await Assert.ThrowsExceptionAsync(async () => + { + await client.UploadFileChunkedAsync(file); + }); + // Ici, vous pouvez vérifier que CancelUploadSessionRequest a été appelé via un mock ou un logger. + } + } +} \ No newline at end of file diff --git a/README.md b/README.md index 040fde3..db45ae5 100644 --- a/README.md +++ b/README.md @@ -86,14 +86,14 @@ Console.WriteLine($"File downloaded and saved to {fs.Name}"); ✅ **Custom parallelism** ```csharp -var client = new KDriveClient("your_token", "your_drive_id", true, 8); +var client = new KDriveClient("your_token", "your_drive_id", new KDriveClientOptions { Parallelism = 8}); ``` ✅ **Inject your own `HttpClient` (for testing/mocking)** ```csharp var fakeHttpClient = new HttpClient(new FakeHandler()) { BaseAddress = new Uri("https://api.infomaniak.com") }; -var client = new KDriveClient("your_token", "your_drive_id", true, 4, null, httpClient: fakeHttpClient); +var client = new KDriveClient("your_token", "your_drive_id", httpClient: fakeHttpClient); ``` ✅ **Built-in error object** @@ -110,7 +110,7 @@ catch (KDriveApiException ex) ### ✅ **Features** * Automatic direct or chunked upload mode based on speed test -* Dynamic chunk size calculation (\~1s worth of data with safety margin) +* Dynamic chunk size calculation * Download with redirect support * Rate limit of 60 requests/min * Deserialized error responses (no manual parsing) From 4dd5c4ba0910f38fc7f08c79eb46ac9f29304492 Mon Sep 17 00:00:00 2001 From: anthonychaussin Date: Wed, 15 Oct 2025 17:42:59 +0200 Subject: [PATCH 2/6] - Download improvment --- DriveClient/Helpers/KDriveRequestFactory.cs | 6 ++- DriveClient/kDriveClient/Download.cs | 57 ++++++++++++++++----- DriveClient/kDriveClient/IkDriveClient.cs | 14 ++--- 3 files changed, 55 insertions(+), 22 deletions(-) diff --git a/DriveClient/Helpers/KDriveRequestFactory.cs b/DriveClient/Helpers/KDriveRequestFactory.cs index 5187c72..e92d932 100644 --- a/DriveClient/Helpers/KDriveRequestFactory.cs +++ b/DriveClient/Helpers/KDriveRequestFactory.cs @@ -107,7 +107,11 @@ public static HttpRequestMessage CreateCancelSessionRequest(long driveId, string /// An HttpRequestMessage configured for the download operation. public static HttpRequestMessage CreateDownloadRequest(long driveId, long fileId) { - return new HttpRequestMessage(HttpMethod.Get, $"/2/drive/{driveId}/files/{fileId}/download"); + return new HttpRequestMessage(HttpMethod.Get, $"/2/drive/{driveId}/files/{fileId}/download") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher + }; } /// diff --git a/DriveClient/kDriveClient/Download.cs b/DriveClient/kDriveClient/Download.cs index 4e4bc0f..8389301 100644 --- a/DriveClient/kDriveClient/Download.cs +++ b/DriveClient/kDriveClient/Download.cs @@ -1,4 +1,7 @@ using kDriveClient.Helpers; +using System; +using System.Buffers; +using System.Net; namespace kDriveClient.kDriveClient { @@ -8,42 +11,40 @@ namespace kDriveClient.kDriveClient public partial class KDriveClient { /// - /// Downloads a file from kDrive by its ID. + /// Downloads a file from kDrive by its ID and writes it directly to a destination stream. /// /// File ID. /// Cancellation token to cancel the operation. - /// Stream containing the file Data. + /// Task representing the asynchronous operation. public async Task DownloadFileAsync(long fileId, CancellationToken ct = default) { - this.Logger?.LogInformation("Downloading file with ID {FileId} from kDrive.", fileId); + this.Logger?.LogInformation("Downloading file with ID {FileId} from kDrive to destination stream.", fileId); var response = await SendAsync(KDriveRequestFactory.CreateDownloadRequest(this.DriveId, fileId), ct); + try { response = await KDriveJsonHelper.DeserializeResponseAsync(response, ct); } catch (Exception ex) { - this.Logger?.LogError(ex, "Failed to download file with ID {FileId} from kDrive.", fileId); + this.Logger?.LogError(ex, "Failed to download file with ID {FileId} from kDrive to destination stream.", fileId); throw; } + this.Logger?.LogInformation("Successfully downloaded file with ID {FileId} from kDrive to destination stream.", fileId); - this.Logger?.LogInformation("Successfully downloaded file with ID {FileId} from kDrive.", fileId); - - var ms = new MemoryStream(); - await response.Content.CopyToAsync(ms, ct); - this.Logger?.LogInformation("File with ID {FileId} downloaded successfully and copied to memory stream.", fileId); - ms.Position = 0; - return ms; + var tempFile = Path.GetTempFileName(); + await SaveStreamAsync(response.Content, tempFile, ct); + return File.OpenRead(tempFile); } /// /// Downloads a file from kDrive by its ID and writes it directly to a destination stream. /// /// File ID. - /// Destination stream to write the file Data. + /// File path to save the downloaded file. /// Cancellation token to cancel the operation. /// Task representing the asynchronous operation. - public async Task DownloadFileAsync(long fileId, Stream destination, CancellationToken ct = default) + public async Task DownloadFileAsync(long fileId, string filePath, CancellationToken ct = default) { this.Logger?.LogInformation("Downloading file with ID {FileId} from kDrive to destination stream.", fileId); var response = await SendAsync(KDriveRequestFactory.CreateDownloadRequest(this.DriveId, fileId), ct); @@ -59,7 +60,35 @@ public async Task DownloadFileAsync(long fileId, Stream destination, Cancellatio } this.Logger?.LogInformation("Successfully downloaded file with ID {FileId} from kDrive to destination stream.", fileId); - await response.Content.CopyToAsync(destination, ct); + await SaveStreamAsync(response.Content, filePath, ct); + } + + /// + /// Saves the content of an HttpContent to a file asynchronously. + /// + /// Content to save. + /// Path to save the content. + /// Cancellation token to cancel the operation. + /// Task representing the asynchronous operation. + static async Task SaveStreamAsync(HttpContent content, string path, CancellationToken ct) + { + await using var fs = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None, + bufferSize: 1024 * 256, options: FileOptions.Asynchronous | FileOptions.SequentialScan); + + using var stream = await content.ReadAsStreamAsync(ct).ConfigureAwait(false); + + var pool = ArrayPool.Shared; + var buffer = pool.Rent(1024 * 256); + try + { + int read; + while ((read = await stream.ReadAsync(buffer.AsMemory(0, buffer.Length), ct).ConfigureAwait(false)) > 0) + await fs.WriteAsync(buffer.AsMemory(0, read), ct).ConfigureAwait(false); + } + finally + { + pool.Return(buffer); + } } } } \ No newline at end of file diff --git a/DriveClient/kDriveClient/IkDriveClient.cs b/DriveClient/kDriveClient/IkDriveClient.cs index 70e0336..8844228 100644 --- a/DriveClient/kDriveClient/IkDriveClient.cs +++ b/DriveClient/kDriveClient/IkDriveClient.cs @@ -16,20 +16,20 @@ public interface IKDriveClient Task UploadAsync(KDriveFile file, CancellationToken ct = default); /// - /// Downloads a file from kDrive by its ID. + /// Downloads a file from kDrive by its ID and writes it directly to a destination stream. /// /// File ID. + /// Destination file path. /// Cancellation token to cancel the operation. - /// Stream containing the file Data. - Task DownloadFileAsync(long fileId, CancellationToken ct = default); + /// Task representing the asynchronous operation. + Task DownloadFileAsync(long fileId, string filePath, CancellationToken ct = default); /// - /// Downloads a file from kDrive by its ID and writes it directly to a destination stream. + /// Downloads a file from kDrive by its ID and returns it as a stream. /// /// File ID. - /// Destination stream to write the file Data. /// Cancellation token to cancel the operation. - /// Task representing the asynchronous operation. - Task DownloadFileAsync(long fileId, Stream destination, CancellationToken ct = default); + /// Stream containing the file content. + Task DownloadFileAsync(long fileId, CancellationToken ct = default); } } \ No newline at end of file From d4adad0d6baa11577795cf71536271deaafa417c Mon Sep 17 00:00:00 2001 From: anthonychaussin Date: Sun, 27 Sep 2026 16:32:21 +0200 Subject: [PATCH 3/6] Ship kDrive SDK 2.0 roadmap: domain surface, transfers, and hygiene. Unify OpenAPI-typed endpoints with domain aliases, smart helpers (bootstrap, enumerate, get-or-create folder), safer downloads/uploads, env-based ConsoleApp1 sample, and OpenAPI coverage in CI. Co-authored-by: Cursor --- .github/workflows/dotnet.yml | 9 +- ConsoleApp1/ConsoleApp1.csproj | 6 +- ConsoleApp1/Program.cs | 181 ++- DriveClient.sln | 44 +- DriveClient/Extensions/KDriveClientOptions.cs | 35 + .../KDriveServiceCollectionExtensions.cs | 74 + DriveClient/Helpers/KDriveDomainMapping.cs | 157 +++ DriveClient/Helpers/KDriveJsonContext.cs | 136 +- DriveClient/Helpers/KDriveJsonHelper.cs | 28 +- .../KDriveOpenApiJsonContext.Generated.cs | 98 ++ DriveClient/Helpers/KDriveRequestFactory.cs | 192 --- DriveClient/Helpers/TempFileStream.cs | 57 + DriveClient/Models/ApiResultBase.cs | 7 +- .../Models/Domain/KDriveBootstrapContext.cs | 22 + DriveClient/Models/Domain/KDriveEnums.cs | 294 ++++ DriveClient/Models/Domain/KDriveItem.cs | 234 ++++ DriveClient/Models/Domain/KDriveItemPage.cs | 109 ++ .../Models/Exceptions/KDriveApiException.cs | 7 +- .../Models/Exceptions/KDriveErrorDetail.cs | 4 +- ...rrorResposne.cs => KDriveErrorResponse.cs} | 4 +- .../Models/Generated/KDriveApiAccount.cs | 78 ++ .../Generated/KDriveApiActiveMembers.cs | 48 + .../Models/Generated/KDriveApiActivity.cs | 54 + .../Models/Generated/KDriveApiActivityFile.cs | 142 ++ .../Generated/KDriveApiActivityFileV3.cs | 148 ++ .../Generated/KDriveApiActivityReport.cs | 92 ++ .../Models/Generated/KDriveApiActivityV2.cs | 84 ++ .../Models/Generated/KDriveApiAppUser.cs | 140 ++ .../Generated/KDriveApiArchiveResource.cs | 42 + .../Generated/KDriveApiCancelResource.cs | 30 + .../Models/Generated/KDriveApiCategory.cs | 60 + .../Generated/KDriveApiCategorypermission.cs | 48 + .../Models/Generated/KDriveApiChart.cs | 33 + .../Models/Generated/KDriveApiChartData.cs | 42 + ...iveApiCheckchangeaccessfeedbackresource.cs | 42 + .../KDriveApiClosinguploadsession.cs | 39 + .../Models/Generated/KDriveApiComment.cs | 87 ++ .../Models/Generated/KDriveApiCountFile.cs | 36 + .../Generated/KDriveApiCountFileSize.cs | 30 + .../KDriveApiCreateDriveUserResponse.cs | 42 + .../Models/Generated/KDriveApiCursorV2.cs | 60 + .../KDriveApiDeletedGenericFileV2.cs | 84 ++ .../Models/Generated/KDriveApiDirectory.cs | 342 +++++ .../Models/Generated/KDriveApiDirectoryV3.cs | 366 +++++ .../Models/Generated/KDriveApiDrive.cs | 548 ++++++++ .../Generated/KDriveApiDriveDefaultLimits.cs | 108 ++ .../Generated/KDriveApiDriveSettings.cs | 190 +++ .../Models/Generated/KDriveApiDriveUser.cs | 311 +++++ .../Generated/KDriveApiDriveUserInvitation.cs | 141 ++ .../Generated/KDriveApiDrivepackprice.cs | 54 + .../Models/Generated/KDriveApiDropbox.cs | 128 ++ .../Generated/KDriveApiErrorResponse.cs | 24 + .../KDriveApiExternInvitationFileAccess.cs | 54 + .../Generated/KDriveApiExternalImport.cs | 90 ++ .../Generated/KDriveApiExternalImportFile.cs | 48 + ...Feedbackaccesspendinginvitationresource.cs | 48 + .../KDriveApiFeedbackaccessresource.cs | 42 + ...KDriveApiFeedbackaccessresourceC3fdaa7f.cs | 36 + .../Generated/KDriveApiFeedbackresource.cs | 36 + DriveClient/Models/Generated/KDriveApiFile.cs | 421 ++++++ .../Models/Generated/KDriveApiFileAccess.cs | 39 + .../Models/Generated/KDriveApiFileCategory.cs | 51 + .../Models/Generated/KDriveApiFileDeleted.cs | 84 ++ .../Generated/KDriveApiFileSystemItem.cs | 484 +++++++ .../Models/Generated/KDriveApiFileV3.cs | 433 ++++++ .../Models/Generated/KDriveApiFileVersion.cs | 69 + .../Generated/KDriveApiFileVersionV2.cs | 75 + .../Generated/KDriveApiFilecontenthash.cs | 24 + .../Models/Generated/KDriveApiKSuite.cs | 42 + .../Generated/KDriveApiMaintenanceType.cs | 36 + .../Generated/KDriveApiNavigatorResponse.cs | 36 + .../Models/Generated/KDriveApiPagination.cs | 42 + .../Models/Generated/KDriveApiPricingPlan.cs | 286 ++++ .../Models/Generated/KDriveApiPublicImage.cs | 30 + .../Models/Generated/KDriveApiResponse.cs | 24 + .../KDriveApiRewindSummaryFileCounter.cs | 42 + .../Models/Generated/KDriveApiRewindV3.cs | 511 +++++++ .../Models/Generated/KDriveApiRight.cs | 42 + .../Generated/KDriveApiSanitizedActivity.cs | 48 + .../KDriveApiSanitizedFileAccessRequest.cs | 72 + .../Models/Generated/KDriveApiShareLink.cs | 122 ++ .../Generated/KDriveApiSharedDirectory.cs | 378 +++++ .../Models/Generated/KDriveApiSharedFile.cs | 445 ++++++ .../Models/Generated/KDriveApiSharefile.cs | 42 + .../Generated/KDriveApiStatisticSharelink.cs | 134 ++ .../Models/Generated/KDriveApiStream.cs | 18 + DriveClient/Models/Generated/KDriveApiTag.cs | 42 + DriveClient/Models/Generated/KDriveApiTeam.cs | 84 ++ .../Generated/KDriveApiTeamFileAccess.cs | 54 + .../Models/Generated/KDriveApiTemporaryURL.cs | 24 + .../Generated/KDriveApiThirdpartydrive.cs | 30 + .../KDriveApiThirdpartydriveslist.cs | 30 + .../KDriveApiUUIDFeedbackresource.cs | 36 + .../Models/Generated/KDriveApiUUIDResource.cs | 24 + .../KDriveApiUploadSessionFeedback.cs | 69 + .../Generated/KDriveApiUploadsegment.cs | 48 + .../Generated/KDriveApiUserSignatureStroke.cs | 60 + .../KDriveApiUserSignatureStrokePoint.cs | 42 + .../Models/Generated/KDriveApiUserUuid.cs | 30 + .../Models/Generated/KDriveApiUserV3.cs | 143 ++ ...KDriveApiUserandteamsaccessonparentfile.cs | 42 + .../Generated/KDriveApiUserfileaccess.cs | 54 + .../Generated/KDriveApiUserpreference.cs | 184 +++ DriveClient/Models/KDriveChunk.cs | 48 +- DriveClient/Models/KDriveClientOptions.cs | 28 - DriveClient/Models/KDriveDownloadOptions.cs | 28 + DriveClient/Models/KDriveEndpointModels.cs | 362 +++++ DriveClient/Models/KDriveExtendedModels.cs | 419 ++++++ DriveClient/Models/KDriveFile.cs | 202 ++- DriveClient/Models/KDriveFinishRequest.cs | 7 +- DriveClient/Models/KDriveQueryModels.cs | 159 +++ DriveClient/Models/KDriveRequestModels.cs | 60 + DriveClient/Models/KDriveResponse.cs | 7 +- DriveClient/Models/KDriveStrictDtos.cs | 419 ++++++ DriveClient/Models/KDriveUploadOptions.cs | 48 + DriveClient/Models/KDriveUploadResponse.cs | 19 +- DriveClient/infomaniak_api_kdrive.json | 1 + DriveClient/kDriveClient.csproj | 45 +- .../Application/Api/IKDriveApiGateway.cs | 10 + .../IKDriveEndpointsService.Extended.cs | 150 ++ ...IKDriveEndpointsService.ExtendedAliases.cs | 162 +++ ...KDriveEndpointsService.ExtendedCoverage.cs | 86 ++ .../IKDriveEndpointsService.RawTyped.cs | 128 ++ .../Endpoints/IKDriveEndpointsService.cs | 204 +++ .../KDriveEndpointsService.Extended.cs | 365 +++++ .../KDriveEndpointsService.ExtendedAliases.cs | 316 +++++ ...KDriveEndpointsService.ExtendedCoverage.cs | 213 +++ .../KDriveEndpointsService.RawTyped.cs | 198 +++ .../Endpoints/KDriveEndpointsService.cs | 625 +++++++++ .../Upload/IKDriveUploadService.cs | 26 + .../Application/Upload/KDriveUploadService.cs | 228 +++ .../Domain/Common/KDriveApiLimits.cs | 10 + .../Domain/Common/QueryStringBuilder.cs | 31 + .../Domain/Upload/UploadStrategy.cs | 30 + DriveClient/kDriveClient/Download.cs | 139 +- .../kDriveClient/Endpoints.Extended.cs | 221 +++ .../kDriveClient/Endpoints.ExtendedAliases.cs | 239 ++++ .../Endpoints.ExtendedCoverage.cs | 125 ++ .../kDriveClient/Endpoints.RawTyped.cs | 188 +++ DriveClient/kDriveClient/Endpoints.cs | 396 ++++++ DriveClient/kDriveClient/IkDriveClient.cs | 35 - .../Api/HttpKDriveApiGateway.cs | 42 + .../Infrastructure/Api/KDriveHttpPipeline.cs | 87 ++ .../Interface/IKDriveCategories.cs | 243 ++++ .../kDriveClient/Interface/IKDriveComments.cs | 177 +++ .../kDriveClient/Interface/IKDriveDownload.cs | 60 + .../kDriveClient/Interface/IKDriveDrive.cs | 952 +++++++++++++ .../Interface/IKDriveFiles.Endpoints.cs | 1078 +++++++++++++++ .../kDriveClient/Interface/IKDriveFiles.cs | 18 + .../kDriveClient/Interface/IKDriveShares.cs | 924 +++++++++++++ .../kDriveClient/Interface/IKDriveSmart.cs | 136 ++ .../Interface/IKDriveTransport.cs | 61 + .../kDriveClient/Interface/IKDriveUpload.cs | 50 + .../Interface/IkDriveClient.Composition.cs | 17 + DriveClient/kDriveClient/KDriveClient.cs | 223 ++- .../kDriveClient/KDriveHttpTransport.cs | 213 +++ .../kDriveClient/KDriveRequestFactory.cs | 73 + DriveClient/kDriveClient/SmartEndpoints.cs | 722 ++++++++++ DriveClient/kDriveClient/SpeedTest.cs | 94 -- DriveClient/kDriveClient/Upload.cs | 233 +--- .../KDriveClientDownloadAndDiTests.cs | 193 +++ .../KDriveClientExtendedEndpointsTests.cs | 394 ++++++ .../KDriveClientSmartEndpointsTests.cs | 468 +++++++ .../kDriveClient/KDriveClientTests.cs | 112 -- .../KDriveClientTypedEndpointsTests.cs | 1227 +++++++++++++++++ .../kDriveClient/KDriveJsonHelperTests.cs | 47 + .../kDriveClient/KDriveOpenApiPropsTests.cs | 202 +++ .../kDriveClient/KDriveRateLimitTests.cs | 252 ++++ .../kDriveClient/KDriveUploadServiceTests.cs | 193 +++ DriveClientTests/kDriveClientTests.csproj | 9 +- .../KDriveClientUploadTests.csproj | 24 - .../kDriveClient/KDriveClientTests.cs | 42 - README.md | 294 +++- tools/_audit_coverage_tmp.py | 117 ++ tools/_audit_method_coverage_tmp.py | 153 ++ tools/_dump_request_bodies.py | 58 + tools/fix_test_queries.py | 31 + tools/gen_extended_aliases.py | 384 ++++++ tools/gen_interface_xml_docs.py | 224 +++ tools/gen_smart_aliases.py | 397 ++++++ tools/generate_kdrive_openapi_types.py | 358 +++++ tools/list_openapi_coverage.py | 132 ++ tools/regen_endpoint_facades.py | 221 +++ tools/replace_query_dicts.py | 68 + tools/split_client_interfaces.py | 154 +++ tools/strict_typing_refactor.py | 352 +++++ 186 files changed, 27203 insertions(+), 1034 deletions(-) create mode 100644 DriveClient/Extensions/KDriveClientOptions.cs create mode 100644 DriveClient/Extensions/KDriveServiceCollectionExtensions.cs create mode 100644 DriveClient/Helpers/KDriveDomainMapping.cs create mode 100644 DriveClient/Helpers/KDriveOpenApiJsonContext.Generated.cs delete mode 100644 DriveClient/Helpers/KDriveRequestFactory.cs create mode 100644 DriveClient/Helpers/TempFileStream.cs create mode 100644 DriveClient/Models/Domain/KDriveBootstrapContext.cs create mode 100644 DriveClient/Models/Domain/KDriveEnums.cs create mode 100644 DriveClient/Models/Domain/KDriveItem.cs create mode 100644 DriveClient/Models/Domain/KDriveItemPage.cs rename DriveClient/Models/Exceptions/{KDriveErrorResposne.cs => KDriveErrorResponse.cs} (89%) create mode 100644 DriveClient/Models/Generated/KDriveApiAccount.cs create mode 100644 DriveClient/Models/Generated/KDriveApiActiveMembers.cs create mode 100644 DriveClient/Models/Generated/KDriveApiActivity.cs create mode 100644 DriveClient/Models/Generated/KDriveApiActivityFile.cs create mode 100644 DriveClient/Models/Generated/KDriveApiActivityFileV3.cs create mode 100644 DriveClient/Models/Generated/KDriveApiActivityReport.cs create mode 100644 DriveClient/Models/Generated/KDriveApiActivityV2.cs create mode 100644 DriveClient/Models/Generated/KDriveApiAppUser.cs create mode 100644 DriveClient/Models/Generated/KDriveApiArchiveResource.cs create mode 100644 DriveClient/Models/Generated/KDriveApiCancelResource.cs create mode 100644 DriveClient/Models/Generated/KDriveApiCategory.cs create mode 100644 DriveClient/Models/Generated/KDriveApiCategorypermission.cs create mode 100644 DriveClient/Models/Generated/KDriveApiChart.cs create mode 100644 DriveClient/Models/Generated/KDriveApiChartData.cs create mode 100644 DriveClient/Models/Generated/KDriveApiCheckchangeaccessfeedbackresource.cs create mode 100644 DriveClient/Models/Generated/KDriveApiClosinguploadsession.cs create mode 100644 DriveClient/Models/Generated/KDriveApiComment.cs create mode 100644 DriveClient/Models/Generated/KDriveApiCountFile.cs create mode 100644 DriveClient/Models/Generated/KDriveApiCountFileSize.cs create mode 100644 DriveClient/Models/Generated/KDriveApiCreateDriveUserResponse.cs create mode 100644 DriveClient/Models/Generated/KDriveApiCursorV2.cs create mode 100644 DriveClient/Models/Generated/KDriveApiDeletedGenericFileV2.cs create mode 100644 DriveClient/Models/Generated/KDriveApiDirectory.cs create mode 100644 DriveClient/Models/Generated/KDriveApiDirectoryV3.cs create mode 100644 DriveClient/Models/Generated/KDriveApiDrive.cs create mode 100644 DriveClient/Models/Generated/KDriveApiDriveDefaultLimits.cs create mode 100644 DriveClient/Models/Generated/KDriveApiDriveSettings.cs create mode 100644 DriveClient/Models/Generated/KDriveApiDriveUser.cs create mode 100644 DriveClient/Models/Generated/KDriveApiDriveUserInvitation.cs create mode 100644 DriveClient/Models/Generated/KDriveApiDrivepackprice.cs create mode 100644 DriveClient/Models/Generated/KDriveApiDropbox.cs create mode 100644 DriveClient/Models/Generated/KDriveApiErrorResponse.cs create mode 100644 DriveClient/Models/Generated/KDriveApiExternInvitationFileAccess.cs create mode 100644 DriveClient/Models/Generated/KDriveApiExternalImport.cs create mode 100644 DriveClient/Models/Generated/KDriveApiExternalImportFile.cs create mode 100644 DriveClient/Models/Generated/KDriveApiFeedbackaccesspendinginvitationresource.cs create mode 100644 DriveClient/Models/Generated/KDriveApiFeedbackaccessresource.cs create mode 100644 DriveClient/Models/Generated/KDriveApiFeedbackaccessresourceC3fdaa7f.cs create mode 100644 DriveClient/Models/Generated/KDriveApiFeedbackresource.cs create mode 100644 DriveClient/Models/Generated/KDriveApiFile.cs create mode 100644 DriveClient/Models/Generated/KDriveApiFileAccess.cs create mode 100644 DriveClient/Models/Generated/KDriveApiFileCategory.cs create mode 100644 DriveClient/Models/Generated/KDriveApiFileDeleted.cs create mode 100644 DriveClient/Models/Generated/KDriveApiFileSystemItem.cs create mode 100644 DriveClient/Models/Generated/KDriveApiFileV3.cs create mode 100644 DriveClient/Models/Generated/KDriveApiFileVersion.cs create mode 100644 DriveClient/Models/Generated/KDriveApiFileVersionV2.cs create mode 100644 DriveClient/Models/Generated/KDriveApiFilecontenthash.cs create mode 100644 DriveClient/Models/Generated/KDriveApiKSuite.cs create mode 100644 DriveClient/Models/Generated/KDriveApiMaintenanceType.cs create mode 100644 DriveClient/Models/Generated/KDriveApiNavigatorResponse.cs create mode 100644 DriveClient/Models/Generated/KDriveApiPagination.cs create mode 100644 DriveClient/Models/Generated/KDriveApiPricingPlan.cs create mode 100644 DriveClient/Models/Generated/KDriveApiPublicImage.cs create mode 100644 DriveClient/Models/Generated/KDriveApiResponse.cs create mode 100644 DriveClient/Models/Generated/KDriveApiRewindSummaryFileCounter.cs create mode 100644 DriveClient/Models/Generated/KDriveApiRewindV3.cs create mode 100644 DriveClient/Models/Generated/KDriveApiRight.cs create mode 100644 DriveClient/Models/Generated/KDriveApiSanitizedActivity.cs create mode 100644 DriveClient/Models/Generated/KDriveApiSanitizedFileAccessRequest.cs create mode 100644 DriveClient/Models/Generated/KDriveApiShareLink.cs create mode 100644 DriveClient/Models/Generated/KDriveApiSharedDirectory.cs create mode 100644 DriveClient/Models/Generated/KDriveApiSharedFile.cs create mode 100644 DriveClient/Models/Generated/KDriveApiSharefile.cs create mode 100644 DriveClient/Models/Generated/KDriveApiStatisticSharelink.cs create mode 100644 DriveClient/Models/Generated/KDriveApiStream.cs create mode 100644 DriveClient/Models/Generated/KDriveApiTag.cs create mode 100644 DriveClient/Models/Generated/KDriveApiTeam.cs create mode 100644 DriveClient/Models/Generated/KDriveApiTeamFileAccess.cs create mode 100644 DriveClient/Models/Generated/KDriveApiTemporaryURL.cs create mode 100644 DriveClient/Models/Generated/KDriveApiThirdpartydrive.cs create mode 100644 DriveClient/Models/Generated/KDriveApiThirdpartydriveslist.cs create mode 100644 DriveClient/Models/Generated/KDriveApiUUIDFeedbackresource.cs create mode 100644 DriveClient/Models/Generated/KDriveApiUUIDResource.cs create mode 100644 DriveClient/Models/Generated/KDriveApiUploadSessionFeedback.cs create mode 100644 DriveClient/Models/Generated/KDriveApiUploadsegment.cs create mode 100644 DriveClient/Models/Generated/KDriveApiUserSignatureStroke.cs create mode 100644 DriveClient/Models/Generated/KDriveApiUserSignatureStrokePoint.cs create mode 100644 DriveClient/Models/Generated/KDriveApiUserUuid.cs create mode 100644 DriveClient/Models/Generated/KDriveApiUserV3.cs create mode 100644 DriveClient/Models/Generated/KDriveApiUserandteamsaccessonparentfile.cs create mode 100644 DriveClient/Models/Generated/KDriveApiUserfileaccess.cs create mode 100644 DriveClient/Models/Generated/KDriveApiUserpreference.cs delete mode 100644 DriveClient/Models/KDriveClientOptions.cs create mode 100644 DriveClient/Models/KDriveDownloadOptions.cs create mode 100644 DriveClient/Models/KDriveEndpointModels.cs create mode 100644 DriveClient/Models/KDriveExtendedModels.cs create mode 100644 DriveClient/Models/KDriveQueryModels.cs create mode 100644 DriveClient/Models/KDriveRequestModels.cs create mode 100644 DriveClient/Models/KDriveStrictDtos.cs create mode 100644 DriveClient/Models/KDriveUploadOptions.cs create mode 100644 DriveClient/infomaniak_api_kdrive.json create mode 100644 DriveClient/kDriveClient/Application/Api/IKDriveApiGateway.cs create mode 100644 DriveClient/kDriveClient/Application/Endpoints/IKDriveEndpointsService.Extended.cs create mode 100644 DriveClient/kDriveClient/Application/Endpoints/IKDriveEndpointsService.ExtendedAliases.cs create mode 100644 DriveClient/kDriveClient/Application/Endpoints/IKDriveEndpointsService.ExtendedCoverage.cs create mode 100644 DriveClient/kDriveClient/Application/Endpoints/IKDriveEndpointsService.RawTyped.cs create mode 100644 DriveClient/kDriveClient/Application/Endpoints/IKDriveEndpointsService.cs create mode 100644 DriveClient/kDriveClient/Application/Endpoints/KDriveEndpointsService.Extended.cs create mode 100644 DriveClient/kDriveClient/Application/Endpoints/KDriveEndpointsService.ExtendedAliases.cs create mode 100644 DriveClient/kDriveClient/Application/Endpoints/KDriveEndpointsService.ExtendedCoverage.cs create mode 100644 DriveClient/kDriveClient/Application/Endpoints/KDriveEndpointsService.RawTyped.cs create mode 100644 DriveClient/kDriveClient/Application/Endpoints/KDriveEndpointsService.cs create mode 100644 DriveClient/kDriveClient/Application/Upload/IKDriveUploadService.cs create mode 100644 DriveClient/kDriveClient/Application/Upload/KDriveUploadService.cs create mode 100644 DriveClient/kDriveClient/Domain/Common/KDriveApiLimits.cs create mode 100644 DriveClient/kDriveClient/Domain/Common/QueryStringBuilder.cs create mode 100644 DriveClient/kDriveClient/Domain/Upload/UploadStrategy.cs create mode 100644 DriveClient/kDriveClient/Endpoints.Extended.cs create mode 100644 DriveClient/kDriveClient/Endpoints.ExtendedAliases.cs create mode 100644 DriveClient/kDriveClient/Endpoints.ExtendedCoverage.cs create mode 100644 DriveClient/kDriveClient/Endpoints.RawTyped.cs create mode 100644 DriveClient/kDriveClient/Endpoints.cs delete mode 100644 DriveClient/kDriveClient/IkDriveClient.cs create mode 100644 DriveClient/kDriveClient/Infrastructure/Api/HttpKDriveApiGateway.cs create mode 100644 DriveClient/kDriveClient/Infrastructure/Api/KDriveHttpPipeline.cs create mode 100644 DriveClient/kDriveClient/Interface/IKDriveCategories.cs create mode 100644 DriveClient/kDriveClient/Interface/IKDriveComments.cs create mode 100644 DriveClient/kDriveClient/Interface/IKDriveDownload.cs create mode 100644 DriveClient/kDriveClient/Interface/IKDriveDrive.cs create mode 100644 DriveClient/kDriveClient/Interface/IKDriveFiles.Endpoints.cs create mode 100644 DriveClient/kDriveClient/Interface/IKDriveFiles.cs create mode 100644 DriveClient/kDriveClient/Interface/IKDriveShares.cs create mode 100644 DriveClient/kDriveClient/Interface/IKDriveSmart.cs create mode 100644 DriveClient/kDriveClient/Interface/IKDriveTransport.cs create mode 100644 DriveClient/kDriveClient/Interface/IKDriveUpload.cs create mode 100644 DriveClient/kDriveClient/Interface/IkDriveClient.Composition.cs create mode 100644 DriveClient/kDriveClient/KDriveHttpTransport.cs create mode 100644 DriveClient/kDriveClient/KDriveRequestFactory.cs create mode 100644 DriveClient/kDriveClient/SmartEndpoints.cs delete mode 100644 DriveClient/kDriveClient/SpeedTest.cs create mode 100644 DriveClientTests/kDriveClient/KDriveClientDownloadAndDiTests.cs create mode 100644 DriveClientTests/kDriveClient/KDriveClientExtendedEndpointsTests.cs create mode 100644 DriveClientTests/kDriveClient/KDriveClientSmartEndpointsTests.cs delete mode 100644 DriveClientTests/kDriveClient/KDriveClientTests.cs create mode 100644 DriveClientTests/kDriveClient/KDriveClientTypedEndpointsTests.cs create mode 100644 DriveClientTests/kDriveClient/KDriveJsonHelperTests.cs create mode 100644 DriveClientTests/kDriveClient/KDriveOpenApiPropsTests.cs create mode 100644 DriveClientTests/kDriveClient/KDriveRateLimitTests.cs create mode 100644 DriveClientTests/kDriveClient/KDriveUploadServiceTests.cs delete mode 100644 KDriveClientUploadTests/KDriveClientUploadTests.csproj delete mode 100644 KDriveClientUploadTests/kDriveClient/KDriveClientTests.cs create mode 100644 tools/_audit_coverage_tmp.py create mode 100644 tools/_audit_method_coverage_tmp.py create mode 100644 tools/_dump_request_bodies.py create mode 100644 tools/fix_test_queries.py create mode 100644 tools/gen_extended_aliases.py create mode 100644 tools/gen_interface_xml_docs.py create mode 100644 tools/gen_smart_aliases.py create mode 100644 tools/generate_kdrive_openapi_types.py create mode 100644 tools/list_openapi_coverage.py create mode 100644 tools/regen_endpoint_facades.py create mode 100644 tools/replace_query_dicts.py create mode 100644 tools/split_client_interfaces.py create mode 100644 tools/strict_typing_refactor.py diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 382d37e..3887b80 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -19,7 +19,14 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 9.0.x + dotnet-version: | + 10.0.x + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: OpenAPI coverage audit + run: python tools/list_openapi_coverage.py - name: Restore dependencies run: dotnet restore - name: Build diff --git a/ConsoleApp1/ConsoleApp1.csproj b/ConsoleApp1/ConsoleApp1.csproj index 19a98fd..38c045f 100644 --- a/ConsoleApp1/ConsoleApp1.csproj +++ b/ConsoleApp1/ConsoleApp1.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 enable enable @@ -11,6 +11,10 @@ + + + + PreserveNewest diff --git a/ConsoleApp1/Program.cs b/ConsoleApp1/Program.cs index 7924af5..6aade9c 100644 --- a/ConsoleApp1/Program.cs +++ b/ConsoleApp1/Program.cs @@ -1,29 +1,174 @@ -using kDriveClient.kDriveClient; +using kDriveClient.kDriveClient; using kDriveClient.Models; +using kDriveClient.Models.Domain; +using kDriveClient.Models.Exceptions; +using System.Diagnostics; +using System.Globalization; -var client = new KDriveClient("toekn", 0000); -var file = new KDriveFile +// Local E2E sample. Credentials come from environment / user-secrets — never hardcode tokens. +var token = Environment.GetEnvironmentVariable("KDRIVE_TOKEN") + ?? throw new InvalidOperationException("Set KDRIVE_TOKEN environment variable (or user-secrets) before running."); +var driveId = long.Parse(Environment.GetEnvironmentVariable("KDRIVE_DRIVE_ID") ?? "0", CultureInfo.InvariantCulture); +var testRootParentDirectoryId = long.Parse(Environment.GetEnvironmentVariable("KDRIVE_PARENT_DIR_ID") ?? "5", CultureInfo.InvariantCulture); +var accountIdEnv = Environment.GetEnvironmentVariable("KDRIVE_ACCOUNT_ID"); +long? accountId = long.TryParse(accountIdEnv, out var aid) ? aid : null; +var testRootFolderName = "kDriveClient-E2E-Test"; +var localInputFilePath = Path.Combine(AppContext.BaseDirectory, "example.txt"); +var localTestDirectory = Path.Combine(AppContext.BaseDirectory, "test"); +var cleanupRemoteAtEnd = true; + +if (driveId <= 0 || testRootParentDirectoryId <= 0) +{ + Console.Error.WriteLine("Set KDRIVE_DRIVE_ID and optionally KDRIVE_PARENT_DIR_ID / KDRIVE_ACCOUNT_ID."); + return; +} + +if (!File.Exists(localInputFilePath)) +{ + Console.Error.WriteLine($"Input file not found: {localInputFilePath}"); + return; +} + +Directory.CreateDirectory(localTestDirectory); + +var uploadOptions = new KDriveUploadOptions { - Name = "example.txt", - DirectoryPath = "/Private/test", - Content = File.OpenRead("example.txt"), - CreatedAt = (int)DateTimeOffset.UtcNow.ToUnixTimeSeconds(), - LastModifiedAt = (int)new FileInfo("example.txt").LastWriteTimeUtc.Subtract(DateTime.UnixEpoch).TotalSeconds + UseAutoChunkSize = false, + ChunkSize = 1024 * 1024 * 8, + Parallelism = 4 }; -var response = await client.UploadAsync(file); -Console.WriteLine($"Uploaded file ID: {response.Id}"); +var client = await KDriveClient.CreateAsync(token, driveId, uploadOptions); +var results = new List(); +long? uploadedFileId = null; +long? runFolderId = null; +long? testRootFolderId = null; +var localDownloadedPath = Path.Combine(localTestDirectory, "downloaded.txt"); + +try +{ + if (accountId is > 0) + { + await RunEndpointAsync(results, "BootstrapAsync", async () => + { + var ctx = await client.BootstrapAsync(accountId.Value, preferredDriveId: driveId); + Console.WriteLine($"Bootstrap selected drive {ctx.DriveId} ({ctx.Drives.Count} drives)."); + return ctx; + }); + } + + var testRoot = await client.GetOrCreateFolderAsync(testRootParentDirectoryId, testRootFolderName); + testRootFolderId = testRoot.Id; + + var runFolder = await client.GetOrCreateFolderAsync(testRoot.Id, $"run-{DateTime.UtcNow:yyyyMMdd-HHmmss}"); + runFolderId = runFolder.Id; + + using var uploadFile = new KDriveFile(localInputFilePath, "/"); + uploadFile.DirectoryId = runFolderId.Value.ToString(CultureInfo.InvariantCulture); + + await RunEndpointNoResultAsync(results, "UploadAsync", async () => + { + var uploaded = await client.UploadAsync(uploadFile); + uploadedFileId = uploaded.Id; + Console.WriteLine($"Uploaded file id: {uploaded.Id}"); + }); -var stream = await client.DownloadFileAsync(response.Id); + if (uploadedFileId is null || runFolderId is null) + throw new InvalidOperationException("Setup failed: uploaded file id or run folder id is missing."); -Console.WriteLine($"File downloaded"); + var listQuery = new KDriveListQuery { Limit = 50, Includes = KDriveItemIncludes.Path }; -using var fs = File.Create("downloaded.txt"); -await stream.CopyToAsync(fs); + await RunEndpointNoResultAsync(results, "DownloadFileAsync", async () => + { + await client.DownloadFileAsync(uploadedFileId.Value, localDownloadedPath); + }); -Console.WriteLine($"File saved to {fs.Name}"); + await RunEndpointAsync(results, "GetItemAsync", () => client.GetItemAsync(uploadedFileId.Value, "path")); + await RunEndpointAsync(results, "GetItemsAsync", () => client.GetItemsAsync(runFolderId.Value, listQuery)); + await RunEndpointAsync(results, "GetRecentAsync", () => client.GetRecentAsync(listQuery)); + await RunEndpointAsync(results, "GetFavoritesAsync", () => client.GetFavoritesAsync(listQuery)); + await RunEndpointAsync(results, "SearchItemsAsync", () => client.SearchItemsAsync(new KDriveSearchQuery { Query = "example", Limit = 20 })); + await RunEndpointAsync(results, "GetTrashItemsAsync", () => client.GetTrashItemsAsync(listQuery)); -using var outFile = File.Create("downloaded_direct.txt"); -await client.DownloadFileAsync(response.Id, outFile); + await RunEndpointNoResultAsync(results, "EnumerateItemsAsync", async () => + { + var count = 0; + await foreach (var _ in client.EnumerateItemsAsync(runFolderId.Value, listQuery, pageSize: 50)) + count++; + Console.WriteLine($"Enumerated {count} items."); + }); + + var copy = await RunEndpointAsync(results, "CopyItemAsync", () => + client.CopyItemAsync(uploadedFileId.Value, runFolderId.Value, "copy-e2e.txt", conflict: "rename")); + if (copy?.Item?.Id is long copyId) + await RunEndpointAsync(results, "TrashItemAsync", () => client.TrashItemAsync(copyId)); +} +finally +{ + PrintSummary(results); + + if (cleanupRemoteAtEnd) + { + if (uploadedFileId is not null) + await SafeTrashAsync(client, uploadedFileId.Value, "uploaded file"); + if (runFolderId is not null) + await SafeTrashAsync(client, runFolderId.Value, "run folder"); + } +} + +static async Task RunEndpointAsync(ICollection results, string name, Func> action) +{ + var sw = Stopwatch.StartNew(); + try + { + var value = await action(); + sw.Stop(); + results.Add(new EndpointCheck(name, true, $"OK ({sw.ElapsedMilliseconds} ms)")); + Console.WriteLine($"[OK] {name} ({sw.ElapsedMilliseconds} ms)"); + return value; + } + catch (Exception ex) + { + sw.Stop(); + var detail = BuildExceptionDetail(ex); + results.Add(new EndpointCheck(name, false, detail)); + Console.WriteLine($"[ERR] {name} => {detail}"); + return default; + } +} + +static Task RunEndpointNoResultAsync(ICollection results, string name, Func action) + => RunEndpointAsync(results, name, async () => { await action(); return null; }); + +static void PrintSummary(IEnumerable results) +{ + var entries = results.ToList(); + var ok = entries.Count(x => x.Success); + Console.WriteLine(); + Console.WriteLine($"========== Endpoint Test Summary =========="); + Console.WriteLine($"Total: {entries.Count} | Success: {ok} | Failed: {entries.Count - ok}"); + foreach (var item in entries.Where(x => !x.Success)) + Console.WriteLine($" - {item.Name}: {item.Detail}"); +} + +static string BuildExceptionDetail(Exception ex) +{ + if (ex is KDriveApiException apiEx) + return $"{apiEx.Error.Error.Code}: {apiEx.Error.Error.Description}"; + return $"{ex.GetType().Name}: {ex.Message}"; +} + +static async Task SafeTrashAsync(KDriveClient client, long itemId, string label) +{ + try + { + await client.TrashItemAsync(itemId); + Console.WriteLine($"Cleanup: trashed {label} (id: {itemId})."); + } + catch (Exception ex) + { + Console.WriteLine($"Cleanup warning for {label}: {BuildExceptionDetail(ex)}"); + } +} -Console.WriteLine($"File downloaded and saved to {fs.Name}"); \ No newline at end of file +readonly record struct EndpointCheck(string Name, bool Success, string Detail); diff --git a/DriveClient.sln b/DriveClient.sln index 6e12125..9f1753f 100644 --- a/DriveClient.sln +++ b/DriveClient.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.14.36212.18 +# Visual Studio Version 18 +VisualStudioVersion = 18.5.11716.220 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "kDriveClient", "DriveClient\kDriveClient.csproj", "{084DDB93-889E-4836-9540-9B62114F273C}" EndProject @@ -12,26 +12,56 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Éléments de solution", " README.md = README.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{4D48AA16-E910-4A1F-B3A0-ACEF4A14E780}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{8C7C8C7D-E8F8-4003-9222-67F4561A1BD9}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DriveClient", "DriveClient", "{0FD03D6A-3714-32FA-703E-1549276A6354}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {084DDB93-889E-4836-9540-9B62114F273C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {084DDB93-889E-4836-9540-9B62114F273C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {084DDB93-889E-4836-9540-9B62114F273C}.Debug|x64.ActiveCfg = Debug|Any CPU + {084DDB93-889E-4836-9540-9B62114F273C}.Debug|x64.Build.0 = Debug|Any CPU + {084DDB93-889E-4836-9540-9B62114F273C}.Debug|x86.ActiveCfg = Debug|Any CPU + {084DDB93-889E-4836-9540-9B62114F273C}.Debug|x86.Build.0 = Debug|Any CPU {084DDB93-889E-4836-9540-9B62114F273C}.Release|Any CPU.ActiveCfg = Release|Any CPU {084DDB93-889E-4836-9540-9B62114F273C}.Release|Any CPU.Build.0 = Release|Any CPU + {084DDB93-889E-4836-9540-9B62114F273C}.Release|x64.ActiveCfg = Release|Any CPU + {084DDB93-889E-4836-9540-9B62114F273C}.Release|x64.Build.0 = Release|Any CPU + {084DDB93-889E-4836-9540-9B62114F273C}.Release|x86.ActiveCfg = Release|Any CPU + {084DDB93-889E-4836-9540-9B62114F273C}.Release|x86.Build.0 = Release|Any CPU {7CAAEB7C-4DEF-47B2-8928-EA1453D9C286}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7CAAEB7C-4DEF-47B2-8928-EA1453D9C286}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7CAAEB7C-4DEF-47B2-8928-EA1453D9C286}.Debug|x64.ActiveCfg = Debug|Any CPU + {7CAAEB7C-4DEF-47B2-8928-EA1453D9C286}.Debug|x64.Build.0 = Debug|Any CPU + {7CAAEB7C-4DEF-47B2-8928-EA1453D9C286}.Debug|x86.ActiveCfg = Debug|Any CPU + {7CAAEB7C-4DEF-47B2-8928-EA1453D9C286}.Debug|x86.Build.0 = Debug|Any CPU {7CAAEB7C-4DEF-47B2-8928-EA1453D9C286}.Release|Any CPU.ActiveCfg = Release|Any CPU {7CAAEB7C-4DEF-47B2-8928-EA1453D9C286}.Release|Any CPU.Build.0 = Release|Any CPU - {4D48AA16-E910-4A1F-B3A0-ACEF4A14E780}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4D48AA16-E910-4A1F-B3A0-ACEF4A14E780}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4D48AA16-E910-4A1F-B3A0-ACEF4A14E780}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4D48AA16-E910-4A1F-B3A0-ACEF4A14E780}.Release|Any CPU.Build.0 = Release|Any CPU + {7CAAEB7C-4DEF-47B2-8928-EA1453D9C286}.Release|x64.ActiveCfg = Release|Any CPU + {7CAAEB7C-4DEF-47B2-8928-EA1453D9C286}.Release|x64.Build.0 = Release|Any CPU + {7CAAEB7C-4DEF-47B2-8928-EA1453D9C286}.Release|x86.ActiveCfg = Release|Any CPU + {7CAAEB7C-4DEF-47B2-8928-EA1453D9C286}.Release|x86.Build.0 = Release|Any CPU + {8C7C8C7D-E8F8-4003-9222-67F4561A1BD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C7C8C7D-E8F8-4003-9222-67F4561A1BD9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C7C8C7D-E8F8-4003-9222-67F4561A1BD9}.Debug|x64.ActiveCfg = Debug|Any CPU + {8C7C8C7D-E8F8-4003-9222-67F4561A1BD9}.Debug|x64.Build.0 = Debug|Any CPU + {8C7C8C7D-E8F8-4003-9222-67F4561A1BD9}.Debug|x86.ActiveCfg = Debug|Any CPU + {8C7C8C7D-E8F8-4003-9222-67F4561A1BD9}.Debug|x86.Build.0 = Debug|Any CPU + {8C7C8C7D-E8F8-4003-9222-67F4561A1BD9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C7C8C7D-E8F8-4003-9222-67F4561A1BD9}.Release|Any CPU.Build.0 = Release|Any CPU + {8C7C8C7D-E8F8-4003-9222-67F4561A1BD9}.Release|x64.ActiveCfg = Release|Any CPU + {8C7C8C7D-E8F8-4003-9222-67F4561A1BD9}.Release|x64.Build.0 = Release|Any CPU + {8C7C8C7D-E8F8-4003-9222-67F4561A1BD9}.Release|x86.ActiveCfg = Release|Any CPU + {8C7C8C7D-E8F8-4003-9222-67F4561A1BD9}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/DriveClient/Extensions/KDriveClientOptions.cs b/DriveClient/Extensions/KDriveClientOptions.cs new file mode 100644 index 0000000..ab8752d --- /dev/null +++ b/DriveClient/Extensions/KDriveClientOptions.cs @@ -0,0 +1,35 @@ +using kDriveClient.Models; + +namespace kDriveClient.Extensions +{ + /// + /// Options for registering in DI. + /// + public sealed class KDriveClientOptions + { + /// + /// Bearer API token. + /// + public string Token { get; set; } = string.Empty; + + /// + /// Target drive id. + /// + public long DriveId { get; set; } + + /// + /// API base address (defaults to Infomaniak). + /// + public Uri BaseAddress { get; set; } = new("https://api.infomaniak.com"); + + /// + /// Upload strategy options. + /// + public KDriveUploadOptions Upload { get; set; } = new(); + + /// + /// Named registration name. + /// + public string HttpClientName { get; set; } = "kDrive"; + } +} diff --git a/DriveClient/Extensions/KDriveServiceCollectionExtensions.cs b/DriveClient/Extensions/KDriveServiceCollectionExtensions.cs new file mode 100644 index 0000000..db9442d --- /dev/null +++ b/DriveClient/Extensions/KDriveServiceCollectionExtensions.cs @@ -0,0 +1,74 @@ +using kDriveClient.kDriveClient; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; +using System.Net.Http.Headers; + +namespace kDriveClient.Extensions +{ + /// + /// DI registration helpers for kDriveClient. + /// + public static class KDriveServiceCollectionExtensions + { + /// + /// Registers and domain interfaces against a shared scoped instance. + /// Uses for the underlying HTTP client. + /// Upload bandwidth probing is deferred until the first upload (or call yourself). + /// + public static IServiceCollection AddKDriveClient( + this IServiceCollection services, + Action configure) + { + ArgumentNullException.ThrowIfNull(services); + ArgumentNullException.ThrowIfNull(configure); + + services.AddOptions().Configure(configure); + services.AddHttpClient("kDrive") + .ConfigureHttpClient((sp, client) => + { + var options = sp.GetRequiredService>().Value; + client.BaseAddress = options.BaseAddress; + if (!string.IsNullOrWhiteSpace(options.Token)) + { + client.DefaultRequestHeaders.Authorization = + new AuthenticationHeaderValue("Bearer", options.Token); + } + }); + + services.AddScoped(sp => + { + var options = sp.GetRequiredService>().Value; + if (string.IsNullOrWhiteSpace(options.Token)) + throw new InvalidOperationException("KDriveClientOptions.Token is required."); + if (options.DriveId <= 0) + throw new InvalidOperationException("KDriveClientOptions.DriveId must be a positive value."); + + var factory = sp.GetRequiredService(); + var http = factory.CreateClient( + string.IsNullOrWhiteSpace(options.HttpClientName) ? "kDrive" : options.HttpClientName); + http.BaseAddress ??= options.BaseAddress; + if (http.DefaultRequestHeaders.Authorization is null && !string.IsNullOrWhiteSpace(options.Token)) + { + http.DefaultRequestHeaders.Authorization = + new AuthenticationHeaderValue("Bearer", options.Token); + } + + var logger = sp.GetService>(); + return new KDriveClient(options.Token, options.DriveId, options.Upload, logger, http); + }); + + services.AddScoped(sp => sp.GetRequiredService()); + services.AddScoped(sp => sp.GetRequiredService()); + services.AddScoped(sp => sp.GetRequiredService()); + services.AddScoped(sp => sp.GetRequiredService()); + services.AddScoped(sp => sp.GetRequiredService()); + services.AddScoped(sp => sp.GetRequiredService()); + services.AddScoped(sp => sp.GetRequiredService()); + services.AddScoped(sp => sp.GetRequiredService()); + services.AddScoped(sp => sp.GetRequiredService()); + + return services; + } + } +} diff --git a/DriveClient/Helpers/KDriveDomainMapping.cs b/DriveClient/Helpers/KDriveDomainMapping.cs new file mode 100644 index 0000000..5fdf61d --- /dev/null +++ b/DriveClient/Helpers/KDriveDomainMapping.cs @@ -0,0 +1,157 @@ +using kDriveClient.Models; +using kDriveClient.Models.Domain; +using kDriveClient.Models.Generated; + +namespace kDriveClient.Helpers +{ + /// + /// Maps transport DTOs and queries to domain / HTTP dictionary forms. + /// Generated OpenAPI types (, …) are the transport source of truth; + /// domain types () are the stable public surface. + /// + public static class KDriveDomainMapping + { + /// Converts a typed list query to an HTTP query dictionary (null-safe). + public static IDictionary? ToQuery(KDriveListQuery? query) + => KDriveListQuery.ToDictionaryOrNull(query); + + /// Converts a typed search query to an HTTP query dictionary (null-safe). + public static IDictionary? ToQuery(KDriveSearchQuery? query) + => query?.ToDictionary(); + + /// Converts a typed paged query to an HTTP query dictionary (null-safe). + public static IDictionary? ToQuery(KDrivePagedQuery? query) + => query?.ToDictionary(); + + /// Maps a navigator response to a domain item page. + public static KDriveItemPage? ToItemPage(KDriveNavigatorResponse? response) + => KDriveItemPage.From(response); + + /// Maps a resource response to a domain item result. + public static KDriveItemResult? ToItemResult(KDriveResourceResponse? response) + => KDriveItemResult.From(response); + + /// Maps a resource response to domain access. + public static KDriveAccess? ToAccess(KDriveResourceResponse? response) + => KDriveAccess.From(response); + + /// Maps many file-system DTOs to domain items. + public static IReadOnlyList ToItems(IEnumerable? items) + => KDriveItem.FromMany(items); + + /// Maps a generated OpenAPI FileV3 DTO to a domain item. + public static KDriveItem? ToItem(KDriveApiFileV3? dto) + => dto is null ? null : KDriveItem.From(ToFileSystemItem(dto)); + + /// Maps a generated OpenAPI DirectoryV3 DTO to a domain item. + public static KDriveItem? ToItem(KDriveApiDirectoryV3? dto) + => dto is null ? null : KDriveItem.From(ToFileSystemItem(dto)); + + /// + /// Projects OpenAPI FileV3 onto . + /// Scalars are copied field-to-field; nested relation shapes that diverge across + /// generated schemas are aligned via a targeted JSON projection. + /// + public static KDriveFileSystemItem ToFileSystemItem(KDriveApiFileV3 dto) + { + ArgumentNullException.ThrowIfNull(dto); + var item = new KDriveFileSystemItem + { + Id = dto.Id, + Name = dto.Name, + SortedName = dto.SortedName, + Path = dto.Path, + Type = dto.Type ?? "file", + Status = dto.Status, + Visibility = dto.Visibility, + DriveId = dto.DriveId, + Depth = dto.Depth, + CreatedBy = dto.CreatedBy, + CreatedAt = dto.CreatedAt, + AddedAt = dto.AddedAt, + LastModifiedAt = dto.LastModifiedAt, + LastModifiedBy = dto.LastModifiedBy, + RevisedAt = dto.RevisedAt, + UpdatedAt = dto.UpdatedAt, + ParentId = dto.ParentId, + DeletedAt = dto.DeletedAt, + Size = dto.Size, + MimeType = dto.MimeType, + Hash = dto.Hash, + Etag = dto.Etag, + IsFavorite = dto.IsFavorite, + ExtensionType = dto.ExtensionType, + ScanStatus = dto.ScanStatus, + ShareLink = dto.ShareLink, + Categories = dto.Categories, + }; + AlignNestedViaJson(dto, item); + return item; + } + + /// + /// Projects OpenAPI DirectoryV3 onto . + /// + public static KDriveFileSystemItem ToFileSystemItem(KDriveApiDirectoryV3 dto) + { + ArgumentNullException.ThrowIfNull(dto); + var item = new KDriveFileSystemItem + { + Id = dto.Id, + Name = dto.Name, + SortedName = dto.SortedName, + Path = dto.Path, + Type = dto.Type ?? "dir", + Status = dto.Status, + Visibility = dto.Visibility, + DriveId = dto.DriveId, + Depth = dto.Depth, + CreatedBy = dto.CreatedBy, + CreatedAt = dto.CreatedAt, + AddedAt = dto.AddedAt, + LastModifiedAt = dto.LastModifiedAt, + LastModifiedBy = dto.LastModifiedBy, + RevisedAt = dto.RevisedAt, + UpdatedAt = dto.UpdatedAt, + ParentId = dto.ParentId, + DeletedAt = dto.DeletedAt, + Etag = dto.Etag, + Color = dto.Color, + IsFavorite = dto.IsFavorite, + ShareLink = dto.ShareLink, + Categories = dto.Categories, + Dropbox = dto.Dropbox, + }; + AlignNestedViaJson(dto, item); + return item; + } + + static void AlignNestedViaJson(T source, KDriveFileSystemItem target) + { + // Nested capability / conversion shapes differ between FileV3, DirectoryV3, and FileSystemItem. + // A single targeted serialize/deserialize fills those without re-mapping every scalar. + var json = source switch + { + KDriveApiFileV3 file => JsonSerializer.Serialize(file, KDriveOpenApiJsonContext.Default.KDriveApiFileV3), + KDriveApiDirectoryV3 dir => JsonSerializer.Serialize(dir, KDriveOpenApiJsonContext.Default.KDriveApiDirectoryV3), + _ => null + }; + if (json is null) + return; + + var bridge = JsonSerializer.Deserialize(json, KDriveJsonContext.Default.KDriveFileSystemItem); + if (bridge is null) + return; + + target.Capabilities ??= bridge.Capabilities; + target.ConversionCapabilities ??= bridge.ConversionCapabilities; + target.Dropbox ??= bridge.Dropbox; + target.Color ??= bridge.Color; + target.Size ??= bridge.Size; + target.MimeType ??= bridge.MimeType; + target.Hash ??= bridge.Hash; + target.ExtensionType ??= bridge.ExtensionType; + target.ScanStatus ??= bridge.ScanStatus; + } + } +} diff --git a/DriveClient/Helpers/KDriveJsonContext.cs b/DriveClient/Helpers/KDriveJsonContext.cs index fbda3eb..8910f21 100644 --- a/DriveClient/Helpers/KDriveJsonContext.cs +++ b/DriveClient/Helpers/KDriveJsonContext.cs @@ -11,11 +11,143 @@ namespace kDriveClient.Helpers [JsonSerializable(typeof(KDriveResponse))] [JsonSerializable(typeof(KDriveFile))] [JsonSerializable(typeof(KDriveChunk))] - [JsonSerializable(typeof(KDriveUploadResponseWraper))] + [JsonSerializable(typeof(KDriveUploadResponseWrapper))] + [JsonSerializable(typeof(KDriveUploadResponse))] [JsonSerializable(typeof(KDriveFinishRequest))] [JsonSerializable(typeof(KDriveUploadDataResponse))] + [JsonSerializable(typeof(KDriveDriveSummary))] + [JsonSerializable(typeof(KDriveUserSummary))] + [JsonSerializable(typeof(KDriveDriveUserSummary))] + [JsonSerializable(typeof(KDriveFileSystemItem))] + [JsonSerializable(typeof(KDriveCancelResource))] + [JsonSerializable(typeof(KDriveDirectoryCount))] + [JsonSerializable(typeof(KDriveFileVersion))] + [JsonSerializable(typeof(KDriveFileActivity))] + [JsonSerializable(typeof(KDriveUserV3))] + [JsonSerializable(typeof(KDriveUuidResource))] + [JsonSerializable(typeof(KDriveFeedbackResource))] + [JsonSerializable(typeof(KDriveFileHash))] + [JsonSerializable(typeof(KDriveFileSizeInfo))] + [JsonSerializable(typeof(KDriveTemporaryUrl))] + [JsonSerializable(typeof(KDriveShareLink))] + [JsonSerializable(typeof(KDriveShareLinkRequest))] + [JsonSerializable(typeof(KDriveArchiveRequest))] + [JsonSerializable(typeof(KDriveDropboxRequest))] + [JsonSerializable(typeof(KDriveCancelUploadByPathRequest))] + [JsonSerializable(typeof(KDriveExternalImport))] + [JsonSerializable(typeof(KDriveCategory))] + [JsonSerializable(typeof(KDriveComment))] + [JsonSerializable(typeof(KDriveDropbox))] + [JsonSerializable(typeof(KDriveDriveDetail))] + [JsonSerializable(typeof(KDriveDriveSettings))] + [JsonSerializable(typeof(KDriveDriveInvitation))] + [JsonSerializable(typeof(KDriveUserPreference))] + [JsonSerializable(typeof(KDriveActivityReport))] + [JsonSerializable(typeof(KDriveActivityV2))] + [JsonSerializable(typeof(KDriveFileAccessUser))] + [JsonSerializable(typeof(KDriveFileAccessTeam))] + [JsonSerializable(typeof(KDriveFileAccessRequest))] + [JsonSerializable(typeof(KDriveFileAccess))] + [JsonSerializable(typeof(KDriveFileAccessInvitation))] + [JsonSerializable(typeof(KDriveParentFileAccess))] + [JsonSerializable(typeof(KDriveStatisticShareLink))] + [JsonSerializable(typeof(KDriveStatisticsData))] + [JsonSerializable(typeof(KDriveOAuthImportDrive))] + [JsonSerializable(typeof(KDrivePendingAccessInvitation))] + [JsonSerializable(typeof(KDriveExportData))] + [JsonSerializable(typeof(KDriveCategoryPermission))] + [JsonSerializable(typeof(KDriveSetFileAccessRequest))] + [JsonSerializable(typeof(KDriveFileAccessUsersRequest))] + [JsonSerializable(typeof(KDriveFileAccessUserUpdateRequest))] + [JsonSerializable(typeof(KDriveFileAccessTeamsRequest))] + [JsonSerializable(typeof(KDriveFileAccessTeamUpdateRequest))] + [JsonSerializable(typeof(KDriveFileAccessInvitationsRequest))] + [JsonSerializable(typeof(KDriveFileAccessInvitationsCheckRequest))] + [JsonSerializable(typeof(KDriveCreateFileAccessRequestBody))] + [JsonSerializable(typeof(KDriveFileAccessApplicationsRequest))] + [JsonSerializable(typeof(KDriveFileAccessCheckRequest))] + [JsonSerializable(typeof(KDriveFileAccessForceRequest))] + [JsonSerializable(typeof(KDriveCreateUserRequest))] + [JsonSerializable(typeof(KDriveUpdateUserRequest))] + [JsonSerializable(typeof(KDrivePatchUserManagerRequest))] + [JsonSerializable(typeof(KDriveUpdateDriveRequest))] + [JsonSerializable(typeof(KDriveDriveSettingsAiRequest))] + [JsonSerializable(typeof(KDriveDriveSettingsLinkRequest))] + [JsonSerializable(typeof(KDriveDriveSettingsOfficeRequest))] + [JsonSerializable(typeof(KDriveDriveSettingsTrashRequest))] + [JsonSerializable(typeof(KDriveUserPreferencesRequest))] + [JsonSerializable(typeof(KDriveUpdateInvitationRequest))] + [JsonSerializable(typeof(KDriveStartOAuthImportRequest))] + [JsonSerializable(typeof(KDriveStartKdriveImportRequest))] + [JsonSerializable(typeof(KDriveStartWebdavImportRequest))] + [JsonSerializable(typeof(KDriveStartSharelinkImportRequest))] + [JsonSerializable(typeof(KDriveCategoryFilesRequest))] + [JsonSerializable(typeof(KDriveCategoryRightsRequest))] + [JsonSerializable(typeof(KDriveCreateActivityReportRequest))] + [JsonSerializable(typeof(KDriveDropboxInviteRequest))] + [JsonSerializable(typeof(KDriveCategoryAiFeedbackRequest))] + [JsonSerializable(typeof(KDriveSetCurrentVersionRequest))] + [JsonSerializable(typeof(KDriveUpdateFileVersionRequest))] + [JsonSerializable(typeof(KDriveUploadSessionBatchFile))] + [JsonSerializable(typeof(KDriveUploadSessionBatchRequest))] + [JsonSerializable(typeof(KDriveFinishUploadSessionBatchRequest))] + [JsonSerializable(typeof(List))] + [JsonSerializable(typeof(List))] + [JsonSerializable(typeof(List))] + [JsonSerializable(typeof(KDrivePagedResponse))] + [JsonSerializable(typeof(KDrivePagedResponse))] + [JsonSerializable(typeof(KDrivePagedResponse))] + [JsonSerializable(typeof(KDrivePagedResponse))] + [JsonSerializable(typeof(KDrivePagedResponse))] + [JsonSerializable(typeof(KDrivePagedResponse))] + [JsonSerializable(typeof(KDrivePagedResponse))] + [JsonSerializable(typeof(KDrivePagedResponse))] + [JsonSerializable(typeof(KDrivePagedResponse))] + [JsonSerializable(typeof(KDrivePagedResponse))] + [JsonSerializable(typeof(KDriveNavigatorResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse>))] + [JsonSerializable(typeof(KDrivePagedResponse))] + [JsonSerializable(typeof(KDriveResourceResponse>))] + [JsonSerializable(typeof(KDriveResourceResponse>))] + [JsonSerializable(typeof(KDrivePagedResponse))] + [JsonSerializable(typeof(KDrivePagedResponse))] + [JsonSerializable(typeof(KDrivePagedResponse))] + [JsonSerializable(typeof(KDrivePagedResponse))] + [JsonSerializable(typeof(KDriveNavigatorResponse))] + [JsonSerializable(typeof(KDriveNavigatorResponse))] + [JsonSerializable(typeof(KDriveNavigatorResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(KDriveResourceResponse>))] + [JsonSerializable(typeof(KDriveResourceResponse))] + [JsonSerializable(typeof(Dictionary))] + [JsonSerializable(typeof(long[]))] + [JsonSerializable(typeof(string[]))] [JsonSourceGenerationOptions(PropertyNameCaseInsensitive = true)] public partial class KDriveJsonContext : JsonSerializerContext { } -} \ No newline at end of file +} diff --git a/DriveClient/Helpers/KDriveJsonHelper.cs b/DriveClient/Helpers/KDriveJsonHelper.cs index bbbb263..549af7a 100644 --- a/DriveClient/Helpers/KDriveJsonHelper.cs +++ b/DriveClient/Helpers/KDriveJsonHelper.cs @@ -16,14 +16,36 @@ public static class KDriveJsonHelper /// public static KDriveUploadResponse DeserializeUploadResponse(string json) { - return JsonSerializer.Deserialize(json, KDriveJsonContext.Default.KDriveUploadResponseWraper)?.Data?.File ?? throw new InvalidOperationException("Failed to parse upload response"); + // Variant 1: { result, data: { file: { ... } } } + var wrapper = JsonSerializer.Deserialize(json, KDriveJsonContext.Default.KDriveUploadResponseWrapper); + if (wrapper?.Data?.File is not null) + { + return wrapper.Data.File; + } + + // Variant 2: { result, data: { ...upload response... } } + var resource = JsonSerializer.Deserialize(json, KDriveJsonContext.Default.KDriveResourceResponseKDriveUploadResponse); + if (resource?.Data is not null) + { + return resource.Data; + } + + // Variant 3: { ...upload response... } (raw object) + var upload = JsonSerializer.Deserialize(json, KDriveJsonContext.Default.KDriveUploadResponse); + if (upload is not null && (upload.Id > 0 || !string.IsNullOrWhiteSpace(upload.Name))) + { + return upload; + } + + var snippet = json.Length > 400 ? json[..400] + "..." : json; + throw new InvalidOperationException($"Failed to parse upload response. Payload: {snippet}"); } /// /// Parses the start session response JSON to extract the token and upload URL. /// /// JSON string to deserialize - /// BaseUrl and Toekn as a tuple + /// Token and upload URL as a tuple /// public static (string Token, string UploadUrl) ParseStartSessionResponse(string json) { @@ -57,4 +79,4 @@ public static async Task DeserializeResponseAsync(HttpRespo return response; } } -} \ No newline at end of file +} diff --git a/DriveClient/Helpers/KDriveOpenApiJsonContext.Generated.cs b/DriveClient/Helpers/KDriveOpenApiJsonContext.Generated.cs new file mode 100644 index 0000000..2d1e48f --- /dev/null +++ b/DriveClient/Helpers/KDriveOpenApiJsonContext.Generated.cs @@ -0,0 +1,98 @@ +// +#nullable enable +using System.Text.Json.Serialization; +using kDriveClient.Models.Generated; + +namespace kDriveClient.Helpers; + +/// +/// Source-generated JSON context for OpenAPI kDrive DTOs (91ac10ff_*). +/// Kept separate from to avoid generator hint-name collisions. +/// + [JsonSerializable(typeof(KDriveApiAccount))] + [JsonSerializable(typeof(KDriveApiActiveMembers))] + [JsonSerializable(typeof(KDriveApiActivity))] + [JsonSerializable(typeof(KDriveApiActivityFile))] + [JsonSerializable(typeof(KDriveApiActivityFileV3))] + [JsonSerializable(typeof(KDriveApiActivityReport))] + [JsonSerializable(typeof(KDriveApiActivityV2))] + [JsonSerializable(typeof(KDriveApiAppUser))] + [JsonSerializable(typeof(KDriveApiArchiveResource))] + [JsonSerializable(typeof(KDriveApiCancelResource))] + [JsonSerializable(typeof(KDriveApiCategory))] + [JsonSerializable(typeof(KDriveApiCategorypermission))] + [JsonSerializable(typeof(KDriveApiChart))] + [JsonSerializable(typeof(KDriveApiChartData))] + [JsonSerializable(typeof(KDriveApiCheckchangeaccessfeedbackresource))] + [JsonSerializable(typeof(KDriveApiClosinguploadsession))] + [JsonSerializable(typeof(KDriveApiComment))] + [JsonSerializable(typeof(KDriveApiCountFile))] + [JsonSerializable(typeof(KDriveApiCountFileSize))] + [JsonSerializable(typeof(KDriveApiCreateDriveUserResponse))] + [JsonSerializable(typeof(KDriveApiCursorV2))] + [JsonSerializable(typeof(KDriveApiDeletedGenericFileV2))] + [JsonSerializable(typeof(KDriveApiDirectory))] + [JsonSerializable(typeof(KDriveApiDirectoryV3))] + [JsonSerializable(typeof(KDriveApiDrive))] + [JsonSerializable(typeof(KDriveApiDriveDefaultLimits))] + [JsonSerializable(typeof(KDriveApiDriveSettings))] + [JsonSerializable(typeof(KDriveApiDriveUser))] + [JsonSerializable(typeof(KDriveApiDriveUserInvitation))] + [JsonSerializable(typeof(KDriveApiDrivepackprice))] + [JsonSerializable(typeof(KDriveApiDropbox))] + [JsonSerializable(typeof(KDriveApiErrorResponse))] + [JsonSerializable(typeof(KDriveApiExternInvitationFileAccess))] + [JsonSerializable(typeof(KDriveApiExternalImport))] + [JsonSerializable(typeof(KDriveApiExternalImportFile))] + [JsonSerializable(typeof(KDriveApiFeedbackaccesspendinginvitationresource))] + [JsonSerializable(typeof(KDriveApiFeedbackaccessresource))] + [JsonSerializable(typeof(KDriveApiFeedbackaccessresourceC3fdaa7f))] + [JsonSerializable(typeof(KDriveApiFeedbackresource))] + [JsonSerializable(typeof(KDriveApiFile))] + [JsonSerializable(typeof(KDriveApiFileAccess))] + [JsonSerializable(typeof(KDriveApiFileCategory))] + [JsonSerializable(typeof(KDriveApiFileDeleted))] + [JsonSerializable(typeof(KDriveApiFileSystemItem))] + [JsonSerializable(typeof(KDriveApiFileV3))] + [JsonSerializable(typeof(KDriveApiFileVersion))] + [JsonSerializable(typeof(KDriveApiFileVersionV2))] + [JsonSerializable(typeof(KDriveApiFilecontenthash))] + [JsonSerializable(typeof(KDriveApiKSuite))] + [JsonSerializable(typeof(KDriveApiMaintenanceType))] + [JsonSerializable(typeof(KDriveApiNavigatorResponse))] + [JsonSerializable(typeof(KDriveApiPagination))] + [JsonSerializable(typeof(KDriveApiPricingPlan))] + [JsonSerializable(typeof(KDriveApiPublicImage))] + [JsonSerializable(typeof(KDriveApiResponse))] + [JsonSerializable(typeof(KDriveApiRewindSummaryFileCounter))] + [JsonSerializable(typeof(KDriveApiRewindV3))] + [JsonSerializable(typeof(KDriveApiRight))] + [JsonSerializable(typeof(KDriveApiSanitizedActivity))] + [JsonSerializable(typeof(KDriveApiSanitizedFileAccessRequest))] + [JsonSerializable(typeof(KDriveApiShareLink))] + [JsonSerializable(typeof(KDriveApiSharedDirectory))] + [JsonSerializable(typeof(KDriveApiSharedFile))] + [JsonSerializable(typeof(KDriveApiSharefile))] + [JsonSerializable(typeof(KDriveApiStatisticSharelink))] + [JsonSerializable(typeof(KDriveApiStream))] + [JsonSerializable(typeof(KDriveApiTag))] + [JsonSerializable(typeof(KDriveApiTeam))] + [JsonSerializable(typeof(KDriveApiTeamFileAccess))] + [JsonSerializable(typeof(KDriveApiTemporaryURL))] + [JsonSerializable(typeof(KDriveApiThirdpartydrive))] + [JsonSerializable(typeof(KDriveApiThirdpartydriveslist))] + [JsonSerializable(typeof(KDriveApiUUIDFeedbackresource))] + [JsonSerializable(typeof(KDriveApiUUIDResource))] + [JsonSerializable(typeof(KDriveApiUploadSessionFeedback))] + [JsonSerializable(typeof(KDriveApiUploadsegment))] + [JsonSerializable(typeof(KDriveApiUserSignatureStroke))] + [JsonSerializable(typeof(KDriveApiUserSignatureStrokePoint))] + [JsonSerializable(typeof(KDriveApiUserUuid))] + [JsonSerializable(typeof(KDriveApiUserV3))] + [JsonSerializable(typeof(KDriveApiUserandteamsaccessonparentfile))] + [JsonSerializable(typeof(KDriveApiUserfileaccess))] + [JsonSerializable(typeof(KDriveApiUserpreference))] +[JsonSourceGenerationOptions(PropertyNameCaseInsensitive = true)] +public partial class KDriveOpenApiJsonContext : JsonSerializerContext +{ +} diff --git a/DriveClient/Helpers/KDriveRequestFactory.cs b/DriveClient/Helpers/KDriveRequestFactory.cs deleted file mode 100644 index e92d932..0000000 --- a/DriveClient/Helpers/KDriveRequestFactory.cs +++ /dev/null @@ -1,192 +0,0 @@ -using kDriveClient.Models; -using System.Net; -using System.Net.Http.Headers; - -namespace kDriveClient.Helpers -{ - /// - /// KDriveRequestFactory is a static class that provides methods to create HTTP requests for various operations related to KDrive files. - /// - public static class KDriveRequestFactory - { - /// - /// Creates an HTTP request for uploading a file directly to KDrive. - /// - /// The ID of the drive where the file will be uploaded. - /// The KDriveFile object containing the file details to be uploaded. - /// An HttpRequestMessage configured for the upload operation. - public static HttpRequestMessage CreateUploadDirectRequest(long driveId, KDriveFile file) - { - var url = $"/3/drive/{driveId}/upload?" + string.Join("&", BuildUploadQueryParams(file).ToList().ConvertAll(e => $"{e.Key}={e.Value}")); - var request = new HttpRequestMessage(HttpMethod.Post, url) - { - Content = new StreamContent(new MemoryStream(file.Chunks.First().Content!)) - }; - - request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); - request.Content.Headers.ContentLength = file.TotalSize; - - return request; - } - - /// - /// Creates an HTTP request to start a file upload session in KDrive. - /// - /// The ID of the drive where the file will be uploaded. - /// The KDriveFile object containing the file details to be uploaded. - /// An HttpRequestMessage configured to start the upload session. - public static HttpRequestMessage CreateStartSessionRequest(long driveId, KDriveFile file) - { - var content = new StringContent(JsonSerializer.Serialize(BuildUploadQueryParams(file), KDriveJsonContext.Default.Object)); - content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); - - return new HttpRequestMessage(HttpMethod.Post, $"/3/drive/{driveId}/upload/session/start") - { - Content = content - }; - } - - /// - /// Creates an HTTP request to upload a chunk of a file to KDrive. - /// - /// The base URL of the KDrive API. - /// The session token for the upload session. - /// The ID of the drive where the file is being uploaded. - /// The KDriveChunk object containing the chunk data to be uploaded. - /// An HttpRequestMessage configured for the chunk upload operation. - public static HttpRequestMessage CreateChunkUploadRequest(string baseUrl, string token, long driveId, KDriveChunk chunk) - { - var content = new ReadOnlyMemoryContent(new ReadOnlyMemory(chunk.Content, 0, chunk.ChunkSize)); - content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); - return new HttpRequestMessage(HttpMethod.Post, $"{baseUrl}/3/drive/{driveId}/upload/session/{token}/chunk?chunk_number={chunk.ChunkNumber + 1}&chunk_size={chunk.ChunkSize}&chunk_hash=sha256:{chunk.ChunkHash.ToLowerInvariant()}") - { - Content = content, - Version = HttpVersion.Version20, - VersionPolicy = HttpVersionPolicy.RequestVersionOrLower, - }; - } - - /// - /// Creates an HTTP request to finish an upload session in KDrive. - /// - /// The ID of the drive where the file is being uploaded. - /// The session token for the upload session. - /// The SHA-256 hash of the entire file content. - /// An HttpRequestMessage configured to finish the upload session. - public static HttpRequestMessage CreateFinishSessionRequest(long driveId, string sessionToken, string totalChunkHash) - { - var content = new StringContent(JsonSerializer.Serialize(new KDriveFinishRequest - { - TotalChunkHash = $"sha256:{totalChunkHash.ToLowerInvariant()}" - }, KDriveJsonContext.Default.KDriveFinishRequest)); - - content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); - - return new HttpRequestMessage(HttpMethod.Post, $"/3/drive/{driveId}/upload/session/{sessionToken}/finish") - { - Content = content - }; - } - - /// - /// Creates an HTTP request to cancel an upload session in KDrive. - /// - /// The ID of the drive where the file is being uploaded. - /// The session token for the upload session. - /// An HttpRequestMessage configured to cancel the upload session. - public static HttpRequestMessage CreateCancelSessionRequest(long driveId, string sessionToken) - { - return new HttpRequestMessage(HttpMethod.Delete, $"/2/drive/{driveId}/upload/session/{sessionToken}"); - } - - /// - /// Creates an HTTP request to download a file from KDrive. - /// - /// The ID of the drive where the file is being uploaded. - /// The ID of the file to be downloaded. - /// An HttpRequestMessage configured for the download operation. - public static HttpRequestMessage CreateDownloadRequest(long driveId, long fileId) - { - return new HttpRequestMessage(HttpMethod.Get, $"/2/drive/{driveId}/files/{fileId}/download") - { - Version = HttpVersion.Version20, - VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher - }; - } - - /// - /// Builds the query parameters for the file upload request. - /// - /// The KDriveFile object containing the file details. - /// A dictionary containing the query parameters for the upload request. - private static Dictionary BuildUploadQueryParams(KDriveFile file) - { - var list = new Dictionary - { - { "file_name", file.GetEscapedFileName() }, - { "total_size", file.TotalSize }, - { "conflict", file.ConvertConflictChoice() } - }; - - AddDirectoryParam(file, list); - AddOptionalParam(list, "with", file.SymbolicLink); - AddOptionalNumericParam(list, "created_at", file.CreatedAt); - AddOptionalNumericParam(list, "last_modified_at", file.LastModifiedAt); - AddOptionalNumericParam(list, "total_chunks", file.Chunks.Count); - AddOptionalChunkHash(list, file.TotalChunkHash); - - return list; - } - - /// - /// Add the directory parameter to the upload request. - /// - /// The KDriveFile object containing the file details. - /// The dictionary to which the directory parameter will be added. - /// Thrown if neither DirectoryId nor DirectoryPath is provided. - private static void AddDirectoryParam(KDriveFile file, Dictionary list) - { - if (file.DirectoryId is not null) - list.Add("directory_id", file.DirectoryId); - else if (!string.IsNullOrWhiteSpace(file.DirectoryPath)) - list.Add("directory_path", file.DirectoryPath); - else - throw new ArgumentException("Either DirectoryId or DirectoryPath must be provided"); - } - - /// - /// Add an optional parameter to the upload request if the value is not null or whitespace. - /// - /// The dictionary to which the parameter will be added. - /// The key for the parameter." - /// The value for the parameter. - private static void AddOptionalParam(Dictionary list, string key, string? value) - { - if (!string.IsNullOrWhiteSpace(value)) - list.Add(key, value); - } - - /// - /// Add an optional numeric parameter to the upload request if the value is greater than zero. - /// - /// The dictionary to which the parameter will be added. - /// The key for the parameter." - /// The value for the parameter. - private static void AddOptionalNumericParam(Dictionary list, string key, int value) - { - if (value > 0) - list.Add(key, value); - } - - /// - /// Add the total chunk hash to the upload request if it is not null or whitespace. - /// - /// The dictionary to which the parameter will be added. - /// The SHA-256 hash of the entire file content. - private static void AddOptionalChunkHash(Dictionary list, string? hash) - { - if (!string.IsNullOrWhiteSpace(hash)) - list.Add("total_chunk_hash", $"sha256:{hash.ToLowerInvariant()}"); - } - } -} \ No newline at end of file diff --git a/DriveClient/Helpers/TempFileStream.cs b/DriveClient/Helpers/TempFileStream.cs new file mode 100644 index 0000000..9ecf577 --- /dev/null +++ b/DriveClient/Helpers/TempFileStream.cs @@ -0,0 +1,57 @@ +namespace kDriveClient.Helpers +{ + /// + /// File stream backed by a temporary file that is deleted when disposed. + /// + internal sealed class TempFileStream : FileStream + { + private readonly string _path; + private int _disposed; + + private TempFileStream(string path) + : base(path, FileMode.Open, FileAccess.Read, FileShare.Read, bufferSize: 1024 * 256, + options: FileOptions.Asynchronous | FileOptions.SequentialScan | FileOptions.DeleteOnClose) + { + _path = path; + } + + public static async Task CreateFromContentAsync(HttpContent content, CancellationToken ct) + { + var path = Path.Combine(Path.GetTempPath(), $"kdrive-{Guid.NewGuid():N}.tmp"); + await using (var fs = new FileStream(path, FileMode.CreateNew, FileAccess.Write, FileShare.None, + bufferSize: 1024 * 256, options: FileOptions.Asynchronous | FileOptions.SequentialScan)) + { + await using var stream = await content.ReadAsStreamAsync(ct).ConfigureAwait(false); + await stream.CopyToAsync(fs, ct).ConfigureAwait(false); + } + + return new TempFileStream(path); + } + + protected override void Dispose(bool disposing) + { + if (Interlocked.Exchange(ref _disposed, 1) != 0) + { + base.Dispose(disposing); + return; + } + + try + { + base.Dispose(disposing); + } + finally + { + try + { + if (File.Exists(_path)) + File.Delete(_path); + } + catch + { + // Best-effort cleanup if DeleteOnClose did not run. + } + } + } + } +} diff --git a/DriveClient/Models/ApiResultBase.cs b/DriveClient/Models/ApiResultBase.cs index 8963de1..32280f4 100644 --- a/DriveClient/Models/ApiResultBase.cs +++ b/DriveClient/Models/ApiResultBase.cs @@ -10,5 +10,10 @@ public abstract class ApiResultBase /// [JsonExtensionData] public Dictionary? ExtraData { get; set; } + + /// + /// Number of extension fields returned by the API. + /// + protected int ExtraDataCount => ExtraData?.Count ?? 0; } -} \ No newline at end of file +} diff --git a/DriveClient/Models/Domain/KDriveBootstrapContext.cs b/DriveClient/Models/Domain/KDriveBootstrapContext.cs new file mode 100644 index 0000000..e57b4c8 --- /dev/null +++ b/DriveClient/Models/Domain/KDriveBootstrapContext.cs @@ -0,0 +1,22 @@ +namespace kDriveClient.Models.Domain +{ + /// + /// Result of discovering account drives and selecting a working drive id. + /// + public sealed class KDriveBootstrapContext + { + /// Account id used for discovery. + public long AccountId { get; init; } + + /// Selected drive id (preferred or first available). + public long DriveId { get; init; } + + /// Selected drive summary when available. + public Models.KDriveDriveSummary? Drive { get; init; } + + /// All drives returned for the account. + public IReadOnlyList Drives { get; init; } = []; + } +} + + diff --git a/DriveClient/Models/Domain/KDriveEnums.cs b/DriveClient/Models/Domain/KDriveEnums.cs new file mode 100644 index 0000000..83954b7 --- /dev/null +++ b/DriveClient/Models/Domain/KDriveEnums.cs @@ -0,0 +1,294 @@ +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Domain +{ + /// + /// Discriminator for a remote file-system item in kDrive (file vs directory). + /// + /// + /// The Infomaniak API exposes this as the JSON string property type + /// (file or dir). Prefer this enum over comparing raw strings. + /// + [JsonConverter(typeof(JsonStringEnumConverter))] + public enum KDriveItemType + { + /// Unknown or unrecognized API value. + Unknown = 0, + + /// A regular file. + [JsonStringEnumMemberName("file")] + File = 1, + + /// A directory (folder). API value is dir. + [JsonStringEnumMemberName("dir")] + Directory = 2 + } + + /// + /// Access right granted on a file, directory, share link, or invitation. + /// + /// + /// Common Infomaniak values: none, read, write, manage, + /// plus share-link style values such as public / password depending on the endpoint. + /// + [JsonConverter(typeof(JsonStringEnumConverter))] + public enum KDriveRight + { + /// Unknown or unrecognized API value. + Unknown = 0, + + /// No access. + [JsonStringEnumMemberName("none")] + None = 1, + + /// Read-only access. + [JsonStringEnumMemberName("read")] + Read = 2, + + /// Read and write access. + [JsonStringEnumMemberName("write")] + Write = 3, + + /// Full management access (ACL, share, delete, etc.). + [JsonStringEnumMemberName("manage")] + Manage = 4, + + /// Public share-link style access (share links). + [JsonStringEnumMemberName("public")] + Public = 5, + + /// Password-protected share-link style access. + [JsonStringEnumMemberName("password")] + Password = 6 + } + + /// + /// Visibility of a file-system item as returned by the API. + /// + [JsonConverter(typeof(JsonStringEnumConverter))] + public enum KDriveVisibility + { + /// Unknown or unrecognized API value. + Unknown = 0, + + /// Inherited from parent. + [JsonStringEnumMemberName("is_inherited")] + Inherited = 1, + + /// Private to the owner / limited ACL. + [JsonStringEnumMemberName("is_private")] + Private = 2, + + /// Shared collaboratively. + [JsonStringEnumMemberName("is_shared")] + Shared = 3, + + /// Team / collaborative directory. + [JsonStringEnumMemberName("is_team_space")] + TeamSpace = 4, + + /// Root of a team space. + [JsonStringEnumMemberName("is_team_space_folder")] + TeamSpaceFolder = 5, + + /// Inside a team space folder. + [JsonStringEnumMemberName("is_in_team_space_folder")] + InTeamSpaceFolder = 6 + } + + /// + /// Role of a user on a drive. + /// + [JsonConverter(typeof(JsonStringEnumConverter))] + public enum KDriveUserRole + { + /// Unknown or unrecognized API value. + Unknown = 0, + + /// External / limited user. + [JsonStringEnumMemberName("external")] + External = 1, + + /// Standard user. + [JsonStringEnumMemberName("user")] + User = 2, + + /// Drive administrator. + [JsonStringEnumMemberName("admin")] + Admin = 3, + + /// Drive owner. + [JsonStringEnumMemberName("owner")] + Owner = 4 + } + + /// + /// Typed with includes for list/detail endpoints (comma-separated in the query string). + /// + /// + /// Combine flags with |. They are serialized to the API with parameter + /// (for example path,users). + /// + [Flags] + public enum KDriveItemIncludes + { + /// No extra includes. + None = 0, + + /// Include resolved path information. + Path = 1 << 0, + + /// Include users related to the item. + Users = 1 << 1, + + /// Include permission / capabilities payload. + Capabilities = 1 << 2, + + /// Include categories attached to the item. + Categories = 1 << 3, + + /// Include share-link information when present. + ShareLink = 1 << 4, + + /// Include dropbox information when present. + Dropbox = 1 << 5, + + /// Include version information. + Version = 1 << 6, + + /// Include conversion capabilities. + Conversion = 1 << 7 + } + + /// + /// Sort direction for list endpoints (order query parameter). + /// + [JsonConverter(typeof(JsonStringEnumConverter))] + public enum KDriveSortOrder + { + /// Ascending. + [JsonStringEnumMemberName("asc")] + Asc = 0, + + /// Descending. + [JsonStringEnumMemberName("desc")] + Desc = 1 + } + + /// + /// Helpers to parse and format API string enums / include flags. + /// + public static class KDriveEnumFormatting + { + /// Parses an API type value into . + public static KDriveItemType ParseItemType(string? value) + { + if (string.IsNullOrWhiteSpace(value)) + return KDriveItemType.Unknown; + + return value.Trim().ToLowerInvariant() switch + { + "file" => KDriveItemType.File, + "dir" or "directory" or "folder" => KDriveItemType.Directory, + _ => KDriveItemType.Unknown + }; + } + + /// Formats to the API type string. + public static string? FormatItemType(KDriveItemType type) => type switch + { + KDriveItemType.File => "file", + KDriveItemType.Directory => "dir", + _ => null + }; + + /// Parses an API right string into . + public static KDriveRight ParseRight(string? value) + { + if (string.IsNullOrWhiteSpace(value)) + return KDriveRight.Unknown; + + return value.Trim().ToLowerInvariant() switch + { + "none" => KDriveRight.None, + "read" => KDriveRight.Read, + "write" => KDriveRight.Write, + "manage" => KDriveRight.Manage, + "public" => KDriveRight.Public, + "password" => KDriveRight.Password, + _ => KDriveRight.Unknown + }; + } + + /// Formats to the API string. + public static string? FormatRight(KDriveRight right) => right switch + { + KDriveRight.None => "none", + KDriveRight.Read => "read", + KDriveRight.Write => "write", + KDriveRight.Manage => "manage", + KDriveRight.Public => "public", + KDriveRight.Password => "password", + _ => null + }; + + /// Parses an API visibility string into . + public static KDriveVisibility ParseVisibility(string? value) + { + if (string.IsNullOrWhiteSpace(value)) + return KDriveVisibility.Unknown; + + return value.Trim().ToLowerInvariant() switch + { + "is_inherited" => KDriveVisibility.Inherited, + "is_private" => KDriveVisibility.Private, + "is_shared" => KDriveVisibility.Shared, + "is_team_space" => KDriveVisibility.TeamSpace, + "is_team_space_folder" => KDriveVisibility.TeamSpaceFolder, + "is_in_team_space_folder" => KDriveVisibility.InTeamSpaceFolder, + _ => KDriveVisibility.Unknown + }; + } + + /// Parses an API role string into . + public static KDriveUserRole ParseUserRole(string? value) + { + if (string.IsNullOrWhiteSpace(value)) + return KDriveUserRole.Unknown; + + return value.Trim().ToLowerInvariant() switch + { + "external" => KDriveUserRole.External, + "user" => KDriveUserRole.User, + "admin" => KDriveUserRole.Admin, + "owner" => KDriveUserRole.Owner, + _ => KDriveUserRole.Unknown + }; + } + + /// Formats include flags to a comma-separated with query value. + public static string? FormatIncludes(KDriveItemIncludes includes) + { + if (includes == KDriveItemIncludes.None) + return null; + + var parts = new List(); + if (includes.HasFlag(KDriveItemIncludes.Path)) parts.Add("path"); + if (includes.HasFlag(KDriveItemIncludes.Users)) parts.Add("users"); + if (includes.HasFlag(KDriveItemIncludes.Capabilities)) parts.Add("capabilities"); + if (includes.HasFlag(KDriveItemIncludes.Categories)) parts.Add("categories"); + if (includes.HasFlag(KDriveItemIncludes.ShareLink)) parts.Add("sharelink"); + if (includes.HasFlag(KDriveItemIncludes.Dropbox)) parts.Add("dropbox"); + if (includes.HasFlag(KDriveItemIncludes.Version)) parts.Add("version"); + if (includes.HasFlag(KDriveItemIncludes.Conversion)) parts.Add("conversion"); + return parts.Count == 0 ? null : string.Join(",", parts); + } + + /// Formats to the API order value. + public static string FormatSortOrder(KDriveSortOrder order) => order switch + { + KDriveSortOrder.Desc => "desc", + _ => "asc" + }; + } +} diff --git a/DriveClient/Models/Domain/KDriveItem.cs b/DriveClient/Models/Domain/KDriveItem.cs new file mode 100644 index 0000000..9c346c6 --- /dev/null +++ b/DriveClient/Models/Domain/KDriveItem.cs @@ -0,0 +1,234 @@ +using kDriveClient.Models.Generated; + +namespace kDriveClient.Models.Domain +{ + /// + /// A remote file-system item on a kDrive (file or directory). + /// + /// + /// This is the consumer-facing domain model. Prefer it over the raw transport DTO + /// . Use pattern matching or + /// / to distinguish files and folders. + /// + /// Do not confuse with , which is the local upload payload + /// (stream / path to upload), not a remote resource. + /// + /// OpenAPI relation fields (capabilities, sharelink, categories, …) + /// are mapped from generated 91ac10ff_* DTOs when requested via with=. + /// + /// + /// + public abstract class KDriveItem + { + /// Unique item identifier. Directories and files share the same id space. + public long Id { get; init; } + + /// Display name. + public string? Name { get; init; } + + /// Full path when requested via includes. + public string? Path { get; init; } + + /// Typed item kind (file or directory). + public KDriveItemType ItemType { get; init; } + + /// Raw API status string when present. + public string? Status { get; init; } + + /// Typed visibility when the API value is recognized. + public KDriveVisibility Visibility { get; init; } + + /// Owning drive id. + public long? DriveId { get; init; } + + /// Parent directory id (root items may be null). + public long? ParentId { get; init; } + + /// Depth in the tree when provided by the API. + public int? Depth { get; init; } + + /// Size in bytes (files; directories may report aggregated size). + public long? Size { get; init; } + + /// MIME type for files. + public string? MimeType { get; init; } + + /// Extension classification from the API. + public string? ExtensionType { get; init; } + + /// Content hash when provided. + public string? Hash { get; init; } + + /// Entity tag for caching / concurrency. + public string? Etag { get; init; } + + /// Directory color when set. + public string? Color { get; init; } + + /// Unix timestamp (seconds) of creation. + public long? CreatedAt { get; init; } + + /// Unix timestamp (seconds) of last update. + public long? UpdatedAt { get; init; } + + /// Unix timestamp (seconds) of last content modification. + public long? LastModifiedAt { get; init; } + + /// Unix timestamp (seconds) when moved to trash; null if not trashed. + public long? DeletedAt { get; init; } + + /// Whether the item is marked as favorite. + public bool? IsFavorite { get; init; } + + /// Creator user id (OpenAPI created_by). + public long? CreatedBy { get; init; } + + /// Last modifier user id (OpenAPI last_modified_by). + public long? LastModifiedBy { get; init; } + + /// Scan status when provided (files). + public string? ScanStatus { get; init; } + + /// Typed capabilities when requested via with=capabilities. + public KDriveApiFileSystemItemCapabilities? Capabilities { get; init; } + + /// Public share link when requested via with=sharelink. + public KDriveApiShareLink? ShareLink { get; init; } + + /// Categories when requested via with=categories. + public IReadOnlyList Categories { get; init; } = []; + + /// Directory dropbox when present. + public KDriveApiDropbox? Dropbox { get; init; } + + /// Underlying transport DTO when mapping from the API. + public KDriveFileSystemItem? Source { get; init; } + + /// True when this item is a file. + public bool IsFile => ItemType == KDriveItemType.File || this is KDriveRemoteFile; + + /// True when this item is a directory. + public bool IsDirectory => ItemType == KDriveItemType.Directory || this is KDriveDirectory; + + /// True when the item is in the trash ( set). + public bool IsTrashed => DeletedAt is > 0; + + /// + /// Creates a typed domain item from the API transport DTO. + /// + /// Raw file-system item from the API. May be null. + /// + /// A , , or null when + /// is null. Unknown types default to . + /// + public static KDriveItem? From(KDriveFileSystemItem? dto) + { + if (dto is null) + return null; + + var type = KDriveEnumFormatting.ParseItemType(dto.Type); + return type switch + { + KDriveItemType.Directory => KDriveDirectory.FromDto(dto), + _ => KDriveRemoteFile.FromDto(dto, type) + }; + } + + /// Maps a sequence of transport DTOs to domain items (skips nulls). + public static IReadOnlyList FromMany(IEnumerable? items) + { + if (items is null) + return []; + + return items.Select(From).Where(i => i is not null).Cast().ToList(); + } + + /// + public override string ToString() => + $"{GetType().Name}(Id={Id}, Name={Name}, ItemType={ItemType}, ParentId={ParentId}, Path={Path})"; + } + + /// + /// A remote file stored on kDrive (not a local upload payload). + /// + /// + /// + public sealed class KDriveRemoteFile : KDriveItem + { + /// Builds a remote file domain object from the transport DTO. + public static KDriveRemoteFile FromDto(KDriveFileSystemItem dto, KDriveItemType? type = null) => new() + { + Id = dto.Id ?? 0, + Name = dto.Name, + Path = dto.Path, + ItemType = type ?? KDriveEnumFormatting.ParseItemType(dto.Type), + Status = dto.Status, + Visibility = KDriveEnumFormatting.ParseVisibility(dto.Visibility), + DriveId = dto.DriveId, + ParentId = dto.ParentId, + Depth = dto.Depth is null ? null : checked((int)dto.Depth.Value), + Size = dto.Size, + MimeType = dto.MimeType, + ExtensionType = dto.ExtensionType, + Hash = dto.Hash, + Etag = dto.Etag, + Color = dto.Color, + CreatedAt = dto.CreatedAt, + UpdatedAt = dto.UpdatedAt, + LastModifiedAt = dto.LastModifiedAt, + DeletedAt = dto.DeletedAt, + IsFavorite = dto.IsFavorite, + CreatedBy = dto.CreatedBy, + LastModifiedBy = dto.LastModifiedBy, + ScanStatus = dto.ScanStatus, + Capabilities = dto.Capabilities, + ShareLink = dto.ShareLink, + Categories = dto.Categories ?? [], + Dropbox = dto.Dropbox, + Source = dto + }; + } + + /// + /// A remote directory (folder) on kDrive. + /// + /// + /// API paths often still use the parameter name file_id for directories; + /// pass the same way you would for a file. + /// + public sealed class KDriveDirectory : KDriveItem + { + /// Builds a directory domain object from the transport DTO. + public static KDriveDirectory FromDto(KDriveFileSystemItem dto) => new() + { + Id = dto.Id ?? 0, + Name = dto.Name, + Path = dto.Path, + ItemType = KDriveItemType.Directory, + Status = dto.Status, + Visibility = KDriveEnumFormatting.ParseVisibility(dto.Visibility), + DriveId = dto.DriveId, + ParentId = dto.ParentId, + Depth = dto.Depth is null ? null : checked((int)dto.Depth.Value), + Size = dto.Size, + MimeType = dto.MimeType, + ExtensionType = dto.ExtensionType, + Hash = dto.Hash, + Etag = dto.Etag, + Color = dto.Color, + CreatedAt = dto.CreatedAt, + UpdatedAt = dto.UpdatedAt, + LastModifiedAt = dto.LastModifiedAt, + DeletedAt = dto.DeletedAt, + IsFavorite = dto.IsFavorite, + CreatedBy = dto.CreatedBy, + LastModifiedBy = dto.LastModifiedBy, + ScanStatus = dto.ScanStatus, + Capabilities = dto.Capabilities, + ShareLink = dto.ShareLink, + Categories = dto.Categories ?? [], + Dropbox = dto.Dropbox, + Source = dto + }; + } +} diff --git a/DriveClient/Models/Domain/KDriveItemPage.cs b/DriveClient/Models/Domain/KDriveItemPage.cs new file mode 100644 index 0000000..ef7340d --- /dev/null +++ b/DriveClient/Models/Domain/KDriveItemPage.cs @@ -0,0 +1,109 @@ +namespace kDriveClient.Models.Domain +{ + /// + /// A page of remote file-system items (cursor-based navigator response). + /// + public sealed class KDriveItemPage + { + /// Items on this page, as domain instances. + public IReadOnlyList Items { get; init; } = []; + + /// Cursor for the next page, when is true. + public string? Cursor { get; init; } + + /// Whether more pages are available. + public bool? HasMore { get; init; } + + /// Server response timestamp when provided. + public long? ResponseAt { get; init; } + + /// API envelope result string (typically success). + public string? Result { get; init; } + + /// Maps a navigator transport response to a domain page. + public static KDriveItemPage? From(KDriveNavigatorResponse? response) + { + if (response is null) + return null; + + return new KDriveItemPage + { + Items = KDriveItem.FromMany(response.Data), + Cursor = response.Cursor, + HasMore = response.HasMore, + ResponseAt = response.ResponseAt, + Result = response.Result + }; + } + } + + /// + /// A single-item API response mapped to a domain . + /// + public sealed class KDriveItemResult + { + /// The remote item, or null when the payload was empty. + public KDriveItem? Item { get; init; } + + /// API envelope result string (typically success). + public string? Result { get; init; } + + /// Maps a resource transport response to a domain result. + public static KDriveItemResult? From(KDriveResourceResponse? response) + { + if (response is null) + return null; + + return new KDriveItemResult + { + Item = KDriveItem.From(response.Data), + Result = response.Result + }; + } + } + + /// + /// Collaborative access (ACL) snapshot for a file or directory. + /// + /// + /// Distinct from a (public URL) and from a dropbox + /// (upload inbox). This models who can read/write/manage the item inside the drive. + /// + public sealed class KDriveAccess + { + /// Users with explicit access. + public IReadOnlyList Users { get; init; } = []; + + /// Teams with explicit access. + public IReadOnlyList Teams { get; init; } = []; + + /// Pending invitations. + public IReadOnlyList Invitations { get; init; } = []; + + /// Inherited parent access when provided. + public KDriveParentFileAccess? ParentAccess { get; init; } + + /// Underlying transport DTO. + public KDriveFileAccess? Source { get; init; } + + /// Maps the ACL transport DTO to a domain access object. + public static KDriveAccess? From(KDriveFileAccess? dto) + { + if (dto is null) + return null; + + return new KDriveAccess + { + Users = dto.Users ?? [], + Teams = dto.Teams ?? [], + Invitations = dto.Invitations ?? [], + ParentAccess = dto.ParentAccess, + Source = dto + }; + } + + /// Maps a resource envelope to domain access. + public static KDriveAccess? From(KDriveResourceResponse? response) + => From(response?.Data); + } +} diff --git a/DriveClient/Models/Exceptions/KDriveApiException.cs b/DriveClient/Models/Exceptions/KDriveApiException.cs index 759e7ce..28d72ba 100644 --- a/DriveClient/Models/Exceptions/KDriveApiException.cs +++ b/DriveClient/Models/Exceptions/KDriveApiException.cs @@ -10,5 +10,10 @@ public class KDriveApiException(KDriveErrorResponse error) : Exception($"{error. /// Error contains the details of the error returned by the kDrive API. /// public KDriveErrorResponse Error { get; } = error; + + public override string ToString() + { + return $"{base.ToString()}, ApiError=({Error})"; + } } -} \ No newline at end of file +} diff --git a/DriveClient/Models/Exceptions/KDriveErrorDetail.cs b/DriveClient/Models/Exceptions/KDriveErrorDetail.cs index 5ded591..3fda295 100644 --- a/DriveClient/Models/Exceptions/KDriveErrorDetail.cs +++ b/DriveClient/Models/Exceptions/KDriveErrorDetail.cs @@ -21,7 +21,7 @@ public class KDriveErrorDetail : ApiResultBase /// public override string ToString() { - return $"Code: {Code}, Description: {Description}"; + return $"Code={Code}, Description={Description}, ExtraDataCount={ExtraDataCount}"; } } -} \ No newline at end of file +} diff --git a/DriveClient/Models/Exceptions/KDriveErrorResposne.cs b/DriveClient/Models/Exceptions/KDriveErrorResponse.cs similarity index 89% rename from DriveClient/Models/Exceptions/KDriveErrorResposne.cs rename to DriveClient/Models/Exceptions/KDriveErrorResponse.cs index 96260f2..c4d24ca 100644 --- a/DriveClient/Models/Exceptions/KDriveErrorResposne.cs +++ b/DriveClient/Models/Exceptions/KDriveErrorResponse.cs @@ -21,7 +21,7 @@ public class KDriveErrorResponse : ApiResultBase /// public override string ToString() { - return $"Result: {Result}, Code: {Error?.Code}, Description: {Error?.Description}"; + return $"Result={Result}, Error={Error}, ExtraDataCount={ExtraDataCount}"; } } -} \ No newline at end of file +} diff --git a/DriveClient/Models/Generated/KDriveApiAccount.cs b/DriveClient/Models/Generated/KDriveApiAccount.cs new file mode 100644 index 0000000..091b043 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiAccount.cs @@ -0,0 +1,78 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Account + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiAccount + { + /// + /// Unique identifier of the resource `Account` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// If the account is a beta version + /// + [JsonPropertyName("beta")] + public bool? Beta { get; set; } + + /// + /// Name of the resource `Account` + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// legal_entity_type + /// + [JsonPropertyName("legal_entity_type")] + public string? LegalEntityType { get; set; } + + /// + /// User phone number + /// + [JsonPropertyName("phone")] + public string? Phone { get; set; } + + /// + /// Support level of the account + /// + [JsonPropertyName("support_level")] + public long? SupportLevel { get; set; } + + /// + /// If the account requires 2FA + /// + [JsonPropertyName("has_2fa_required")] + public bool? Has2faRequired { get; set; } + + /// + /// If the account has Single Sign-On (SSO) + /// + [JsonPropertyName("is_sso")] + public bool? IsSso { get; set; } + + /// + /// website + /// + [JsonPropertyName("website")] + public string? Website { get; set; } + + /// + /// Timestamp `Account` was created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiActiveMembers.cs b/DriveClient/Models/Generated/KDriveApiActiveMembers.cs new file mode 100644 index 0000000..1a411e7 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiActiveMembers.cs @@ -0,0 +1,48 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Active Members + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiActiveMembers + { + /// + /// User identifier + /// + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + + /// + /// Connected user name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// User agent used on connection + /// + [JsonPropertyName("agent")] + public string? Agent { get; set; } + + /// + /// Ip used on connection + /// + [JsonPropertyName("ip")] + public string? Ip { get; set; } + + /// + /// Last login at + /// + [JsonPropertyName("last_login_at")] + public long? LastLoginAt { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiActivity.cs b/DriveClient/Models/Generated/KDriveApiActivity.cs new file mode 100644 index 0000000..c8962e5 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiActivity.cs @@ -0,0 +1,54 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Activity + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiActivity + { + /// + /// Action type + /// + [JsonPropertyName("action")] + public string? Action { get; set; } + + /// + /// Directory/File identifier + /// + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + + /// + /// Parent directory identifier + /// + [JsonPropertyName("parent_id")] + public long? ParentId { get; set; } + + /// + /// Path of Directory/File + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// Destination of Directory/File in case of move or rename action + /// + [JsonPropertyName("destination")] + public string? Destination { get; set; } + + /// + /// Creation date of Directory/File + /// + [JsonPropertyName("executed_at")] + public long? ExecutedAt { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiActivityFile.cs b/DriveClient/Models/Generated/KDriveApiActivityFile.cs new file mode 100644 index 0000000..2924b76 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiActivityFile.cs @@ -0,0 +1,142 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Activity File + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiActivityFile + { + /// + /// Unique identifier of the resource `Activity File` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Timestamp `Activity File` was created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Activity type + /// + [JsonPropertyName("action")] + public string? Action { get; set; } + + /// + /// Current path of the activity file/directory + /// + [JsonPropertyName("new_path")] + public string? NewPath { get; set; } + + /// + /// Previous path of the activity file/directory + /// + [JsonPropertyName("old_path")] + public string? OldPath { get; set; } + + /// + /// Logged file identifier + /// + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + + /// + /// User identifier of the action, null if the user was not logged + /// + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + + [JsonPropertyName("user")] + public KDriveApiAppUser? User { get; set; } + + /// + /// Information about where the Activity was generated + /// + [JsonPropertyName("source")] + public KDriveApiActivityFileSource? Source { get; set; } + + /// + /// Associated File or Directory, null is element was deleted + /// + [JsonPropertyName("file")] + public JsonElement? File { get; set; } + + [JsonPropertyName("parent")] + public KDriveApiDirectory? Parent { get; set; } + + /// + /// Object the Activity is about + /// + [JsonPropertyName("entity")] + public KDriveApiActivityFileEntity? Entity { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// Information about where the Activity was generated + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiActivityFileSource + { + /// + /// Name of the source + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Ip of the source + /// + [JsonPropertyName("ip")] + public string? Ip { get; set; } + + /// + /// User Agent of the source + /// + [JsonPropertyName("user_agent")] + public string? UserAgent { get; set; } + + /// + /// Device of the source + /// + [JsonPropertyName("device")] + public string? Device { get; set; } + + /// + /// Location of the source + /// + [JsonPropertyName("location")] + public string? Location { get; set; } + + } + + /// + /// Object the Activity is about + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiActivityFileEntity + { + /// + /// Id of the object + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Type of the object + /// + [JsonPropertyName("type")] + public long? Type { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiActivityFileV3.cs b/DriveClient/Models/Generated/KDriveApiActivityFileV3.cs new file mode 100644 index 0000000..487be25 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiActivityFileV3.cs @@ -0,0 +1,148 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Activity File V3 + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiActivityFileV3 + { + /// + /// Unique identifier of the resource `Activity File V3` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Timestamp `Activity File V3` was created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Activity type + /// + [JsonPropertyName("action")] + public string? Action { get; set; } + + /// + /// Current path of the activity file/directory + /// + [JsonPropertyName("new_path")] + public string? NewPath { get; set; } + + /// + /// Previous path of the activity file/directory + /// + [JsonPropertyName("old_path")] + public string? OldPath { get; set; } + + /// + /// get private folder user id + /// + [JsonPropertyName("private_path_user_id")] + public long? PrivatePathUserId { get; set; } + + /// + /// Logged file identifier + /// + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + + /// + /// User identifier of the action, null if the user was not logged + /// + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + + [JsonPropertyName("user")] + public KDriveApiAppUser? User { get; set; } + + /// + /// Information about where the Activity was generated + /// + [JsonPropertyName("source")] + public KDriveApiActivityFileV3Source? Source { get; set; } + + /// + /// Associated File or Directory, null is element was deleted + /// + [JsonPropertyName("file")] + public JsonElement? File { get; set; } + + [JsonPropertyName("parent")] + public KDriveApiDirectoryV3? Parent { get; set; } + + /// + /// Object the Activity is about + /// + [JsonPropertyName("entity")] + public KDriveApiActivityFileV3Entity? Entity { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// Information about where the Activity was generated + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiActivityFileV3Source + { + /// + /// Name of the source + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Ip of the source + /// + [JsonPropertyName("ip")] + public string? Ip { get; set; } + + /// + /// User Agent of the source + /// + [JsonPropertyName("user_agent")] + public string? UserAgent { get; set; } + + /// + /// Device of the source + /// + [JsonPropertyName("device")] + public string? Device { get; set; } + + /// + /// Location of the source + /// + [JsonPropertyName("location")] + public string? Location { get; set; } + + } + + /// + /// Object the Activity is about + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiActivityFileV3Entity + { + /// + /// Id of the object + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Type of the object + /// + [JsonPropertyName("type")] + public long? Type { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiActivityReport.cs b/DriveClient/Models/Generated/KDriveApiActivityReport.cs new file mode 100644 index 0000000..e8c511b --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiActivityReport.cs @@ -0,0 +1,92 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Activity Report + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiActivityReport + { + /// + /// Activity report identifier + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Report status: in_progress: Report generation still in progress done: Report can be downloaded/exported failed: Report generation failed + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Size in octet of the report + /// + [JsonPropertyName("size")] + public string? Size { get; set; } + + [JsonPropertyName("generated_by")] + public KDriveApiAppUser? GeneratedBy { get; set; } + + /// + /// The download url of the report content + /// + [JsonPropertyName("download_url")] + public string? DownloadUrl { get; set; } + + /// + /// Timestamp `Activity Report` was created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Timestamp `Activity Report` was updated at + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + /// + /// Filter used to generate the report + /// + [JsonPropertyName("filters")] + public KDriveApiActivityReportFilters? Filters { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// Filter used to generate the report + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiActivityReportFilters + { + /// + /// Logged interaction type of activities on the drive or file. acl_insert : Technical: when a new group access to a file/directory is create. acl_main_users_insert : Logged when the main kDrive team access to a file/directory is created. acl_main_users_remove : Logged when the main… + /// + [JsonPropertyName("actions")] + public List? Actions { get; set; } + + /// + /// Starting date of the report + /// + [JsonPropertyName("start_at")] + public long? StartAt { get; set; } + + /// + /// Ending date of the report + /// + [JsonPropertyName("end_at")] + public long? EndAt { get; set; } + + [JsonPropertyName("user")] + public KDriveApiAppUser? User { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiActivityV2.cs b/DriveClient/Models/Generated/KDriveApiActivityV2.cs new file mode 100644 index 0000000..ff9cb5a --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiActivityV2.cs @@ -0,0 +1,84 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Activity V2 + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiActivityV2 + { + /// + /// Action type + /// + [JsonPropertyName("action")] + public string? Action { get; set; } + + /// + /// Directory/File identifier + /// + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + + /// + /// Parent directory identifier + /// + [JsonPropertyName("parent_id")] + public long? ParentId { get; set; } + + /// + /// Directory/File type + /// + [JsonPropertyName("file_type")] + public string? FileType { get; set; } + + /// + /// Size of Activity V2 The unit of size is defined in Bytes + /// + [JsonPropertyName("size")] + public long? Size { get; set; } + + /// + /// Activity V2 creation timestamp (in seconds), if available in its metadata or specified on upload + /// + [JsonPropertyName("last_modified_at")] + public long? LastModifiedAt { get; set; } + + /// + /// Time the action took place + /// + [JsonPropertyName("timestamp")] + public long? Timestamp { get; set; } + + /// + /// Path of Directory/File + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// Destination of Directory/File in case of move or rename action + /// + [JsonPropertyName("destination")] + public string? Destination { get; set; } + + /// + /// Creation date of Directory/File + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Symlink target path if the related file was uploaded as a symlink + /// + [JsonPropertyName("symbolic_link")] + public string? SymbolicLink { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiAppUser.cs b/DriveClient/Models/Generated/KDriveApiAppUser.cs new file mode 100644 index 0000000..ad1fbcb --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiAppUser.cs @@ -0,0 +1,140 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// App User + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiAppUser + { + /// + /// Unique identifier of the resource `App User` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Display name + /// + [JsonPropertyName("display_name")] + public string? DisplayName { get; set; } + + /// + /// First name + /// + [JsonPropertyName("first_name")] + public string? FirstName { get; set; } + + /// + /// Last name + /// + [JsonPropertyName("last_name")] + public string? LastName { get; set; } + + /// + /// Email + /// + [JsonPropertyName("email")] + public string? Email { get; set; } + + /// + /// returns true if the user is provided by an external IDP + /// + [JsonPropertyName("is_sso")] + public bool? IsSso { get; set; } + + /// + /// null is returned only when request parameter no_avatar_default=1 and the user has not set an avatar + /// + [JsonPropertyName("avatar")] + public string? Avatar { get; set; } + + /// + /// type + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// Timestamp `App User` was deleted at + /// + [JsonPropertyName("deleted_at")] + public long? DeletedAt { get; set; } + + /// + /// List of Team identifiers + /// + [JsonPropertyName("teams")] + public List? Teams { get; set; } + + /// + /// security + /// + [JsonPropertyName("security")] + public KDriveApiAppUserSecurity? Security { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// security + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiAppUserSecurity + { + /// + /// The last date the assistant was used + /// + [JsonPropertyName("assistant_at")] + public long? AssistantAt { get; set; } + + /// + /// Double authentication method used to log in + /// + [JsonPropertyName("double_auth_method")] + public string? DoubleAuthMethod { get; set; } + + /// + /// Whether the `App User` has double authentication enabled + /// + [JsonPropertyName("has_double_auth")] + public bool? HasDoubleAuth { get; set; } + + /// + /// Last time `App User`'s password was changed + /// + [JsonPropertyName("last_password_at")] + public long? LastPasswordAt { get; set; } + + /// + /// Security score of the `App User` + /// + [JsonPropertyName("score")] + public long? Score { get; set; } + + /// + /// Whether the `App User` has a valid email + /// + [JsonPropertyName("has_valid_email")] + public long? HasValidEmail { get; set; } + + /// + /// Whether the `App User` has a recovery email + /// + [JsonPropertyName("has_recovery_email")] + public bool? HasRecoveryEmail { get; set; } + + /// + /// Whether the `App User` has a valid phone number + /// + [JsonPropertyName("has_valid_phone")] + public bool? HasValidPhone { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiArchiveResource.cs b/DriveClient/Models/Generated/KDriveApiArchiveResource.cs new file mode 100644 index 0000000..32dbb88 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiArchiveResource.cs @@ -0,0 +1,42 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Archive Resource + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiArchiveResource + { + /// + /// Universally unique identifier of the resource `Archive Resource` + /// + [JsonPropertyName("uuid")] + public string? Uuid { get; set; } + + /// + /// Number of files in the archive + /// + [JsonPropertyName("number_of_files")] + public long? NumberOfFiles { get; set; } + + /// + /// List of infected `File` + /// + [JsonPropertyName("infected_files")] + public List? InfectedFiles { get; set; } + + /// + /// List of PUA `File` + /// + [JsonPropertyName("pua_files")] + public List? PuaFiles { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiCancelResource.cs b/DriveClient/Models/Generated/KDriveApiCancelResource.cs new file mode 100644 index 0000000..b3c592c --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiCancelResource.cs @@ -0,0 +1,30 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// CancelResource + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiCancelResource + { + /// + /// cancel_id + /// + [JsonPropertyName("cancel_id")] + public string? CancelId { get; set; } + + /// + /// valid_until + /// + [JsonPropertyName("valid_until")] + public long? ValidUntil { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiCategory.cs b/DriveClient/Models/Generated/KDriveApiCategory.cs new file mode 100644 index 0000000..7a83875 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiCategory.cs @@ -0,0 +1,60 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Category + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiCategory + { + /// + /// Category identifier + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Category name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Color the Category displays in + /// + [JsonPropertyName("color")] + public string? Color { get; set; } + + /// + /// If the Category is system or user defined + /// + [JsonPropertyName("is_predefined")] + public bool? IsPredefined { get; set; } + + /// + /// Unique identifier of the creator of the resource `Category` + /// + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + /// + /// Timestamp `Category` was created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Number of uses of the Category + /// + [JsonPropertyName("user_uses")] + public long? UserUses { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiCategorypermission.cs b/DriveClient/Models/Generated/KDriveApiCategorypermission.cs new file mode 100644 index 0000000..65607c6 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiCategorypermission.cs @@ -0,0 +1,48 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Category permission + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiCategorypermission + { + /// + /// User can create new categories + /// + [JsonPropertyName("can_create")] + public bool? CanCreate { get; set; } + + /// + /// User can edit existing categories + /// + [JsonPropertyName("can_edit")] + public bool? CanEdit { get; set; } + + /// + /// User can delete categories and remove them from files + /// + [JsonPropertyName("can_delete")] + public bool? CanDelete { get; set; } + + /// + /// User can read the categories that are present on files + /// + [JsonPropertyName("can_read_on_file")] + public bool? CanReadOnFile { get; set; } + + /// + /// User can add categories to files + /// + [JsonPropertyName("can_put_on_file")] + public bool? CanPutOnFile { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiChart.cs b/DriveClient/Models/Generated/KDriveApiChart.cs new file mode 100644 index 0000000..304872e --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiChart.cs @@ -0,0 +1,33 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Chart + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiChart + { + /// + /// Chart title + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + [JsonPropertyName("labels")] + public KDriveApiChartData? Labels { get; set; } + + /// + /// Data information + /// + [JsonPropertyName("data")] + public List? Data { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiChartData.cs b/DriveClient/Models/Generated/KDriveApiChartData.cs new file mode 100644 index 0000000..22535d7 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiChartData.cs @@ -0,0 +1,42 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Chart Data + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiChartData + { + /// + /// X coordinate name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// X coordinate unit + /// + [JsonPropertyName("unit")] + public string? Unit { get; set; } + + /// + /// X coordinate data points + /// + [JsonPropertyName("data")] + public JsonElement? Data { get; set; } + + /// + /// Metric of the requested chart + /// + [JsonPropertyName("metric")] + public string? Metric { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiCheckchangeaccessfeedbackresource.cs b/DriveClient/Models/Generated/KDriveApiCheckchangeaccessfeedbackresource.cs new file mode 100644 index 0000000..7352ffe --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiCheckchangeaccessfeedbackresource.cs @@ -0,0 +1,42 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Check change access feedback resource + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiCheckchangeaccessfeedbackresource + { + /// + /// User identifier + /// + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + + /// + /// The current user right for the File/Directory + /// + [JsonPropertyName("current_right")] + public string? CurrentRight { get; set; } + + /// + /// If the right asked need to be applied to this user, return false if the right is the same level or not applicable. Note: A user with limited file access don't need to change his right + /// + [JsonPropertyName("need_change")] + public bool? NeedChange { get; set; } + + /// + /// Additional information about why the right need to be applied or not : user_right_need_change: If the right need to be changed user_right_is_same_level: If the right is the same level user_not_connected_to_drive: If the user did not connected to the drive yet error: If the right… + /// + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiClosinguploadsession.cs b/DriveClient/Models/Generated/KDriveApiClosinguploadsession.cs new file mode 100644 index 0000000..90b2920 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiClosinguploadsession.cs @@ -0,0 +1,39 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Closing upload session + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiClosinguploadsession + { + /// + /// Upload session token + /// + [JsonPropertyName("token")] + public string? Token { get; set; } + + [JsonPropertyName("file")] + public KDriveApiFileV3? File { get; set; } + + /// + /// Upload session was closed + /// + [JsonPropertyName("result")] + public bool? Result { get; set; } + + /// + /// Additional message about the closed upload session + /// + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiComment.cs b/DriveClient/Models/Generated/KDriveApiComment.cs new file mode 100644 index 0000000..78024ed --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiComment.cs @@ -0,0 +1,87 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Comment + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiComment + { + /// + /// Unique identifier of the resource `Comment` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Comment parent identifier. If present, this comment is a response of another comment + /// + [JsonPropertyName("parent_id")] + public long? ParentId { get; set; } + + /// + /// Comment message + /// + [JsonPropertyName("body")] + public string? Body { get; set; } + + /// + /// If a comment is set as resolved, solved. + /// + [JsonPropertyName("is_resolved")] + public bool? IsResolved { get; set; } + + /// + /// Timestamp `Comment` was created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Timestamp `Comment` was updated at + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + /// + /// Whether current user has liked the comment + /// + [JsonPropertyName("liked")] + public bool? Liked { get; set; } + + /// + /// Number of likes + /// + [JsonPropertyName("likes_count")] + public long? LikesCount { get; set; } + + /// + /// Number of responses for this comment + /// + [JsonPropertyName("responses_count")] + public long? ResponsesCount { get; set; } + + [JsonPropertyName("user")] + public KDriveApiAppUser? User { get; set; } + + /// + /// responses + /// + [JsonPropertyName("responses")] + public List? Responses { get; set; } + + /// + /// likes + /// + [JsonPropertyName("likes")] + public List? Likes { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiCountFile.cs b/DriveClient/Models/Generated/KDriveApiCountFile.cs new file mode 100644 index 0000000..0eabdcc --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiCountFile.cs @@ -0,0 +1,36 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Count File + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiCountFile + { + /// + /// Total of element in the directory + /// + [JsonPropertyName("count")] + public long? Count { get; set; } + + /// + /// Total of files in the directory + /// + [JsonPropertyName("files")] + public long? Files { get; set; } + + /// + /// Total of directories in the directory + /// + [JsonPropertyName("directories")] + public long? Directories { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiCountFileSize.cs b/DriveClient/Models/Generated/KDriveApiCountFileSize.cs new file mode 100644 index 0000000..3a3bb36 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiCountFileSize.cs @@ -0,0 +1,30 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Count File Size + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiCountFileSize + { + /// + /// Total size of files + /// + [JsonPropertyName("size")] + public long? Size { get; set; } + + /// + /// Total size of files (with versions) + /// + [JsonPropertyName("storage_size")] + public long? StorageSize { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiCreateDriveUserResponse.cs b/DriveClient/Models/Generated/KDriveApiCreateDriveUserResponse.cs new file mode 100644 index 0000000..041ca0d --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiCreateDriveUserResponse.cs @@ -0,0 +1,42 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Create DriveUser Response + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiCreateDriveUserResponse + { + [JsonPropertyName("invitation")] + public KDriveApiDriveUserInvitation? Invitation { get; set; } + + [JsonPropertyName("drive_user")] + public KDriveApiDriveUser? DriveUser { get; set; } + + /// + /// Error message when applicable + /// + [JsonPropertyName("error")] + public string? Error { get; set; } + + /// + /// when no invitation or drive_user + /// + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + + /// + /// when no invitation or drive_user + /// + [JsonPropertyName("email")] + public string? Email { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiCursorV2.cs b/DriveClient/Models/Generated/KDriveApiCursorV2.cs new file mode 100644 index 0000000..b99b7f1 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiCursorV2.cs @@ -0,0 +1,60 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Cursor V2 + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiCursorV2 + { + /// + /// ID of the user who created the cursor + /// + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + + /// + /// ID of the directory the cursor was created in + /// + [JsonPropertyName("source_id")] + public long? SourceId { get; set; } + + /// + /// ID of the last activity seen by the cursor + /// + [JsonPropertyName("activity_id")] + public long? ActivityId { get; set; } + + /// + /// Timestamp of the cursor's creation + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Whether the cursor also reads children directories + /// + [JsonPropertyName("recursive")] + public bool? Recursive { get; set; } + + /// + /// Current page of cursor data + /// + [JsonPropertyName("page")] + public long? Page { get; set; } + + /// + /// Curent limit of cursor + /// + [JsonPropertyName("limit")] + public long? Limit { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiDeletedGenericFileV2.cs b/DriveClient/Models/Generated/KDriveApiDeletedGenericFileV2.cs new file mode 100644 index 0000000..1510d4e --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiDeletedGenericFileV2.cs @@ -0,0 +1,84 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Deleted Generic File V2 + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDeletedGenericFileV2 + { + /// + /// Unique identifier of the resource `Deleted Generic File V2` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// File name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Type of returned element either a dir (Directory) or file (File) + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// Full path of the Deleted Generic File V2 + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// Visibility of Deleted Generic File V2, empty string if no specific visibility. Add additional information about Deleted Generic File V2 to show different icons or more. : Empty visibility mean no special visibility. is_in_private_space : Is a Deleted Generic File V2 inside the p… + /// + [JsonPropertyName("visibility")] + public string? Visibility { get; set; } + + /// + /// Current path depth of Deleted Generic File V2 + /// + [JsonPropertyName("depth")] + public long? Depth { get; set; } + + /// + /// The identifier of the user who first uploaded the Deleted Generic File V2 + /// + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + /// + /// Parent directory identifier + /// + [JsonPropertyName("parent_id")] + public long? ParentId { get; set; } + + /// + /// Timestamp of deleted resource Deleted Generic File V2, only visible when the Deleted Generic File V2 is trashed + /// + [JsonPropertyName("deleted_at")] + public long? DeletedAt { get; set; } + + /// + /// User identifier of deleted resource Deleted Generic File V2, only visible when the Deleted Generic File V2 is trashed + /// + [JsonPropertyName("deleted_by")] + public long? DeletedBy { get; set; } + + /// + /// File type, properties is not returned for directory type + /// + [JsonPropertyName("extension_type")] + public string? ExtensionType { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiDirectory.cs b/DriveClient/Models/Generated/KDriveApiDirectory.cs new file mode 100644 index 0000000..539d833 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiDirectory.cs @@ -0,0 +1,342 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Directory + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDirectory + { + /// + /// Unique identifier of the resource `Directory` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// File name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Specific sortable name + /// + [JsonPropertyName("sorted_name")] + public string? SortedName { get; set; } + + /// + /// Full path of the Directory + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// Type of returned element either a dir (Directory) or file (File) + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// Current state of Directory. The state can be null meaning that the Directory has no specific state. locked : Directory is currently locked. No action can be made except unlocking by the application which locked the File (such as office, webdav or external import). ok : Directory… + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Visibility of Directory, empty string if no specific visibility. Add additional information about Directory to show different icons or more. : Empty visibility mean no special visibility. is_in_team_space_folder : Is a Directory inside a Common Documents directory. is_root : Is … + /// + [JsonPropertyName("visibility")] + public string? Visibility { get; set; } + + /// + /// Drive identifier + /// + [JsonPropertyName("drive_id")] + public long? DriveId { get; set; } + + /// + /// Current path depth of Directory + /// + [JsonPropertyName("depth")] + public long? Depth { get; set; } + + /// + /// The identifier of the user who first uploaded the Directory + /// + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + /// + /// Directory creation timestamp (in seconds), if available in its metadata or specified on upload + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// The timestamp (in seconds) at which the Directory has been uploaded for the first time + /// + [JsonPropertyName("added_at")] + public long? AddedAt { get; set; } + + /// + /// Directory creation timestamp (in seconds), if available in its metadata or specified on upload + /// + [JsonPropertyName("last_modified_at")] + public long? LastModifiedAt { get; set; } + + /// + /// Parent directory identifier + /// + [JsonPropertyName("parent_id")] + public long? ParentId { get; set; } + + /// + /// Timestamp of deleted resource Directory, only visible when the Directory is trashed + /// + [JsonPropertyName("deleted_at")] + public long? DeletedAt { get; set; } + + /// + /// User identifier of deleted resource Directory, only visible when the Directory is trashed + /// + [JsonPropertyName("deleted_by")] + public long? DeletedBy { get; set; } + + /// + /// Root Directory identifier, only visible for shared user + /// + [JsonPropertyName("shared_root_id")] + public long? SharedRootId { get; set; } + + /// + /// Get all parents directories + /// + [JsonPropertyName("parents")] + public List? Parents { get; set; } + + /// + /// Array of users identifiers that has access to the Directory + /// + [JsonPropertyName("users")] + public List? Users { get; set; } + + /// + /// Array of teams identifiers that has access to the Directory + /// + [JsonPropertyName("teams")] + public List? Teams { get; set; } + + /// + /// Is Directory pinned as favorite + /// + [JsonPropertyName("is_favorite")] + public bool? IsFavorite { get; set; } + + /// + /// Activities information about the Directory + /// + [JsonPropertyName("activity")] + public KDriveApiDirectoryActivity? Activity { get; set; } + + [JsonPropertyName("sharelink")] + public KDriveApiShareLink? ShareLink { get; set; } + + /// + /// Directory rights + /// + [JsonPropertyName("capabilities")] + public KDriveApiDirectoryCapabilities? Capabilities { get; set; } + + /// + /// When Directory is locked, locked information + /// + [JsonPropertyName("lock")] + public KDriveApiDirectoryLock? Lock { get; set; } + + /// + /// File categories + /// + [JsonPropertyName("categories")] + public List? Categories { get; set; } + + /// + /// ETag of the file + /// + [JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Color of the directory for the user requesting it + /// + [JsonPropertyName("color")] + public string? Color { get; set; } + + [JsonPropertyName("dropbox")] + public KDriveApiDropbox? Dropbox { get; set; } + + [JsonPropertyName("external_import")] + public KDriveApiExternalImport? ExternalImport { get; set; } + + [JsonPropertyName("rewind")] + public KDriveApiRewindV3? Rewind { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// Activities information about the Directory + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDirectoryActivity + { + /// + /// Timestamp of the last user access of the Directory + /// + [JsonPropertyName("last_accessed_at")] + public long? LastAccessedAt { get; set; } + + } + + /// + /// Directory rights + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDirectoryCapabilities + { + /// + /// Right to set file as favorite + /// + [JsonPropertyName("can_use_favorite")] + public bool? CanUseFavorite { get; set; } + + /// + /// Right to share file by link (share_link) + /// + [JsonPropertyName("can_become_sharelink")] + public bool? CanBecomeSharelink { get; set; } + + /// + /// Right to use and give team access + /// + [JsonPropertyName("can_use_team")] + public bool? CanUseTeam { get; set; } + + /// + /// Right to see Directory information + /// + [JsonPropertyName("can_show")] + public bool? CanShow { get; set; } + + /// + /// Right to read Directory content + /// + [JsonPropertyName("can_read")] + public bool? CanRead { get; set; } + + /// + /// Right to write Directory + /// + [JsonPropertyName("can_write")] + public bool? CanWrite { get; set; } + + /// + /// Right to share Directory or manage access to Directory + /// + [JsonPropertyName("can_share")] + public bool? CanShare { get; set; } + + /// + /// Right to leave shared Directory + /// + [JsonPropertyName("can_leave")] + public bool? CanLeave { get; set; } + + /// + /// Right to delete Directory + /// + [JsonPropertyName("can_delete")] + public bool? CanDelete { get; set; } + + /// + /// Right to rename Directory + /// + [JsonPropertyName("can_rename")] + public bool? CanRename { get; set; } + + /// + /// Right to move Directory + /// + [JsonPropertyName("can_move")] + public bool? CanMove { get; set; } + + /// + /// Right to add new child directory + /// + [JsonPropertyName("can_create_directory")] + public bool? CanCreateDirectory { get; set; } + + /// + /// Right to add new child file + /// + [JsonPropertyName("can_create_file")] + public bool? CanCreateFile { get; set; } + + /// + /// Right to upload a child file + /// + [JsonPropertyName("can_upload")] + public bool? CanUpload { get; set; } + + /// + /// right to move directory + /// + [JsonPropertyName("can_move_into")] + public bool? CanMoveInto { get; set; } + + /// + /// Right to use convert directory into collaborative directory + /// + [JsonPropertyName("can_become_dropbox")] + public bool? CanBecomeDropbox { get; set; } + + } + + /// + /// When Directory is locked, locked information + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDirectoryLock + { + /// + /// When Directory is locked, locked timestamp + /// + [JsonPropertyName("locked_at")] + public long? LockedAt { get; set; } + + /// + /// When Directory is locked, automatic lock release timestamp + /// + [JsonPropertyName("unlocked_at")] + public long? UnlockedAt { get; set; } + + /// + /// When Directory is locked, locked reason + /// + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// When Directory is locked, locked token + /// + [JsonPropertyName("token")] + public string? Token { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiDirectoryV3.cs b/DriveClient/Models/Generated/KDriveApiDirectoryV3.cs new file mode 100644 index 0000000..a8d8ae9 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiDirectoryV3.cs @@ -0,0 +1,366 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Directory V3 + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDirectoryV3 + { + /// + /// Unique identifier of the resource `Directory V3` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// File name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Specific sortable name + /// + [JsonPropertyName("sorted_name")] + public string? SortedName { get; set; } + + /// + /// Full path of the Directory V3 + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// Type of returned element either a dir (Directory) or file (File) + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// Current state of Directory V3. The state can be null meaning that the Directory V3 has no specific state. locked : Directory V3 is currently locked. No action can be made except unlocking by the application which locked the File (such as office, webdav or external import). ok : … + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Visibility of Directory V3, empty string if no specific visibility. Add additional information about Directory V3 to show different icons or more. : Empty visibility mean no special visibility. is_in_private_space : Is a Directory V3 inside the private directory of the user. is_… + /// + [JsonPropertyName("visibility")] + public string? Visibility { get; set; } + + /// + /// Drive identifier + /// + [JsonPropertyName("drive_id")] + public long? DriveId { get; set; } + + /// + /// Current path depth of Directory V3 + /// + [JsonPropertyName("depth")] + public long? Depth { get; set; } + + /// + /// The identifier of the user who first uploaded the Directory V3 + /// + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + /// + /// Directory V3 creation timestamp (in seconds), if available in its metadata or specified on upload + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// The timestamp (in seconds) at which the Directory V3 has been uploaded for the first time + /// + [JsonPropertyName("added_at")] + public long? AddedAt { get; set; } + + /// + /// Directory V3 creation timestamp (in seconds), if available in its metadata or specified on upload + /// + [JsonPropertyName("last_modified_at")] + public long? LastModifiedAt { get; set; } + + /// + /// Id of the user who last modified the Directory V3 + /// + [JsonPropertyName("last_modified_by")] + public long? LastModifiedBy { get; set; } + + /// + /// The last time the content of the Directory V3 was revised + /// + [JsonPropertyName("revised_at")] + public long? RevisedAt { get; set; } + + /// + /// The last time the Directory V3 was updated + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + /// + /// Parent directory identifier + /// + [JsonPropertyName("parent_id")] + public long? ParentId { get; set; } + + /// + /// Timestamp of deleted resource Directory V3, only visible when the Directory V3 is trashed + /// + [JsonPropertyName("deleted_at")] + public long? DeletedAt { get; set; } + + /// + /// User identifier of deleted resource Directory V3, only visible when the Directory V3 is trashed + /// + [JsonPropertyName("deleted_by")] + public long? DeletedBy { get; set; } + + /// + /// Root Directory identifier, only visible for shared user + /// + [JsonPropertyName("shared_root_id")] + public long? SharedRootId { get; set; } + + /// + /// Get all parents directories + /// + [JsonPropertyName("parents")] + public List? Parents { get; set; } + + /// + /// Array of users identifiers that has access to the Directory V3 + /// + [JsonPropertyName("users")] + public List? Users { get; set; } + + /// + /// Array of teams identifiers that has access to the Directory V3 + /// + [JsonPropertyName("teams")] + public List? Teams { get; set; } + + /// + /// Is Directory V3 pinned as favorite + /// + [JsonPropertyName("is_favorite")] + public bool? IsFavorite { get; set; } + + /// + /// Activities information about the Directory V3 + /// + [JsonPropertyName("activity")] + public KDriveApiDirectoryV3Activity? Activity { get; set; } + + [JsonPropertyName("sharelink")] + public KDriveApiShareLink? ShareLink { get; set; } + + /// + /// Directory rights + /// + [JsonPropertyName("capabilities")] + public KDriveApiDirectoryV3Capabilities? Capabilities { get; set; } + + /// + /// When Directory V3 is locked, locked information + /// + [JsonPropertyName("lock")] + public KDriveApiDirectoryV3Lock? Lock { get; set; } + + /// + /// File categories + /// + [JsonPropertyName("categories")] + public List? Categories { get; set; } + + /// + /// ETag of the file + /// + [JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Color of the directory for the user requesting it + /// + [JsonPropertyName("color")] + public string? Color { get; set; } + + [JsonPropertyName("dropbox")] + public KDriveApiDropbox? Dropbox { get; set; } + + [JsonPropertyName("external_import")] + public KDriveApiExternalImport? ExternalImport { get; set; } + + [JsonPropertyName("rewind")] + public KDriveApiRewindV3? Rewind { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// Activities information about the Directory V3 + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDirectoryV3Activity + { + /// + /// Timestamp of the last user access of the Directory V3 + /// + [JsonPropertyName("last_accessed_at")] + public long? LastAccessedAt { get; set; } + + } + + /// + /// Directory rights + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDirectoryV3Capabilities + { + /// + /// Right to set file as favorite + /// + [JsonPropertyName("can_use_favorite")] + public bool? CanUseFavorite { get; set; } + + /// + /// Right to share file by link (share_link) + /// + [JsonPropertyName("can_become_sharelink")] + public bool? CanBecomeSharelink { get; set; } + + /// + /// Right to use and give team access + /// + [JsonPropertyName("can_use_team")] + public bool? CanUseTeam { get; set; } + + /// + /// Right to see Directory V3 information + /// + [JsonPropertyName("can_show")] + public bool? CanShow { get; set; } + + /// + /// Right to read Directory V3 content + /// + [JsonPropertyName("can_read")] + public bool? CanRead { get; set; } + + /// + /// Right to write Directory V3 + /// + [JsonPropertyName("can_write")] + public bool? CanWrite { get; set; } + + /// + /// Right to share Directory V3 or manage access to Directory V3 + /// + [JsonPropertyName("can_share")] + public bool? CanShare { get; set; } + + /// + /// Right to leave shared Directory V3 + /// + [JsonPropertyName("can_leave")] + public bool? CanLeave { get; set; } + + /// + /// Right to delete Directory V3 + /// + [JsonPropertyName("can_delete")] + public bool? CanDelete { get; set; } + + /// + /// Right to rename Directory V3 + /// + [JsonPropertyName("can_rename")] + public bool? CanRename { get; set; } + + /// + /// Right to move Directory V3 + /// + [JsonPropertyName("can_move")] + public bool? CanMove { get; set; } + + /// + /// Right to add new child directory + /// + [JsonPropertyName("can_create_directory")] + public bool? CanCreateDirectory { get; set; } + + /// + /// Right to add new child file + /// + [JsonPropertyName("can_create_file")] + public bool? CanCreateFile { get; set; } + + /// + /// Right to upload a child file + /// + [JsonPropertyName("can_upload")] + public bool? CanUpload { get; set; } + + /// + /// right to move directory + /// + [JsonPropertyName("can_move_into")] + public bool? CanMoveInto { get; set; } + + /// + /// Right to use convert directory into collaborative directory + /// + [JsonPropertyName("can_become_dropbox")] + public bool? CanBecomeDropbox { get; set; } + + /// + /// Right to change or add color to the directory + /// + [JsonPropertyName("colorable")] + public bool? Colorable { get; set; } + + } + + /// + /// When Directory V3 is locked, locked information + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDirectoryV3Lock + { + /// + /// When Directory V3 is locked, locked timestamp + /// + [JsonPropertyName("locked_at")] + public long? LockedAt { get; set; } + + /// + /// When Directory V3 is locked, automatic lock release timestamp + /// + [JsonPropertyName("unlocked_at")] + public long? UnlockedAt { get; set; } + + /// + /// List of applications. 365 : The 365 application. external_import : The external_import application. internal_copy : The internal_copy application. internal_import : The internal_import application. onlyoffice : The onlyoffice application. webdav : The webdav application. + /// + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// When Directory V3 is locked, locked token + /// + [JsonPropertyName("token")] + public string? Token { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiDrive.cs b/DriveClient/Models/Generated/KDriveApiDrive.cs new file mode 100644 index 0000000..25dfecc --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiDrive.cs @@ -0,0 +1,548 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Drive + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDrive + { + /// + /// Id of the kDrive + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Name of the kDrive + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Maximum space (in bytes) + /// + [JsonPropertyName("size")] + public long? Size { get; set; } + + /// + /// Used space (in bytes) + /// + [JsonPropertyName("used_size")] + public long? UsedSize { get; set; } + + /// + /// Creation timestamp + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Last update timestamp + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + /// + /// When maintenance is activated + /// + [JsonPropertyName("in_maintenance")] + public bool? InMaintenance { get; set; } + + /// + /// Reason of Drive maintenance. demo_end : The demonstration period of the Drive has come to an end. invoice_overdue : An invoice for this Drive is currently unpaid. not_renew : This Drive has expired and must be renewed. + /// + [JsonPropertyName("maintenance_reason")] + public string? MaintenanceReason { get; set; } + + /// + /// When maintenance was activated at + /// + [JsonPropertyName("maintenance_at")] + public long? MaintenanceAt { get; set; } + + /// + /// Types of maintenances. asleep : The Drive is inactive, cannot perform requested operation. An API call will wake it up asynchronously. hard_delete : The Drive and its storage are being hard deleted, cannot perform requested operation. manager_in_maintenance : Drive is in mainten… + /// + [JsonPropertyName("maintenance_types")] + public List? MaintenanceTypes { get; set; } + + /// + /// Backend version + /// + [JsonPropertyName("version")] + public string? Version { get; set; } + + /// + /// Number of user slots used + /// + [JsonPropertyName("users_count")] + public long? UsersCount { get; set; } + + /// + /// Maximum number of users for this kdrive + /// + [JsonPropertyName("users_quota")] + public long? UsersQuota { get; set; } + + /// + /// Unique id of the kDrive product + /// + [JsonPropertyName("product_id")] + public long? ProductId { get; set; } + + /// + /// Id of the account in which the kDrive is + /// + [JsonPropertyName("account_id")] + public long? AccountId { get; set; } + + [JsonPropertyName("account")] + public KDriveApiAccount? Account { get; set; } + + /// + /// Product expiration timestamp + /// + [JsonPropertyName("expired_at")] + public long? ExpiredAt { get; set; } + + /// + /// If the product is locked + /// + [JsonPropertyName("is_locked")] + public bool? IsLocked { get; set; } + + /// + /// Custom description of this kDrive + /// + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Reference used for billing + /// + [JsonPropertyName("bill_reference")] + public string? BillReference { get; set; } + + /// + /// If the product is in free trial period + /// + [JsonPropertyName("is_demo")] + public bool? IsDemo { get; set; } + + /// + /// Role of the current user within this kDrive + /// + [JsonPropertyName("role")] + public string? Role { get; set; } + + /// + /// Whether user is an administrator of the current kDrive account + /// + [JsonPropertyName("account_admin")] + public bool? AccountAdmin { get; set; } + + /// + /// Whether this drive has been purchased within an app store + /// + [JsonPropertyName("is_in_app_subscription")] + public bool? IsInAppSubscription { get; set; } + + [JsonPropertyName("rewind")] + public KDriveApiRewindV3? Rewind { get; set; } + + /// + /// Number of pending invitation. + /// + [JsonPropertyName("invitations_count")] + public long? InvitationsCount { get; set; } + + /// + /// All categories of the kDrive + /// + [JsonPropertyName("categories")] + public List? Categories { get; set; } + + [JsonPropertyName("categories_permissions")] + public KDriveApiCategorypermission? CategoriesPermissions { get; set; } + + /// + /// All users identifiers by types + /// + [JsonPropertyName("users")] + public KDriveApiDriveUsers? Users { get; set; } + + /// + /// All teams identifiers by types + /// + [JsonPropertyName("teams")] + public KDriveApiDriveTeams? Teams { get; set; } + + [JsonPropertyName("rights")] + public KDriveApiRight? Rights { get; set; } + + /// + /// User defined tags on this kDrive + /// + [JsonPropertyName("tags")] + public List? Tags { get; set; } + + [JsonPropertyName("k_suite")] + public KDriveApiKSuite? KSuite { get; set; } + + /// + /// The Drive available features list + /// + [JsonPropertyName("capabilities")] + public KDriveApiDriveCapabilities? Capabilities { get; set; } + + /// + /// Settings of the current users for this kDrive + /// + [JsonPropertyName("settings")] + public KDriveApiDriveSettingsInline? Settings { get; set; } + + /// + /// preferences + /// + [JsonPropertyName("preferences")] + public KDriveApiDrivePreferences? Preferences { get; set; } + + [JsonPropertyName("pack")] + public KDriveApiPricingPlan? Pack { get; set; } + + /// + /// Bdd storage hostname + /// + [JsonPropertyName("bdd_storage_host")] + public string? BddStorageHost { get; set; } + + /// + /// Status of the drive + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Drive feature limits depending on offer + /// + [JsonPropertyName("quota")] + public KDriveApiDriveQuota? Quota { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// All users identifiers by types + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveUsers + { + /// + /// Users identifiers of the account group + /// + [JsonPropertyName("account")] + public List? Account { get; set; } + + /// + /// Users identifiers of the kDrive + /// + [JsonPropertyName("drive")] + public List? Drive { get; set; } + + /// + /// Users identifiers of the drive (only externals users) + /// + [JsonPropertyName("external")] + public List? External { get; set; } + + /// + /// Users identifiers of the drive (only internal users) + /// + [JsonPropertyName("internal")] + public List? Internal { get; set; } + + } + + /// + /// All teams identifiers by types + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveTeams + { + /// + /// Teams identifiers of the account group + /// + [JsonPropertyName("account")] + public List? Account { get; set; } + + /// + /// Teams identifiers of the kDrive + /// + [JsonPropertyName("drive")] + public List? Drive { get; set; } + + } + + /// + /// The Drive available features list + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveCapabilities + { + /// + /// Is versioning activated + /// + [JsonPropertyName("use_versioning")] + public bool? UseVersioning { get; set; } + + /// + /// During upload compression is allowed + /// + [JsonPropertyName("use_upload_compression")] + public bool? UseUploadCompression { get; set; } + + /// + /// Shared/Team directory feature + /// + [JsonPropertyName("use_team_space")] + public bool? UseTeamSpace { get; set; } + + /// + /// Can add an user in the kDrive + /// + [JsonPropertyName("can_add_user")] + public bool? CanAddUser { get; set; } + + /// + /// Can see stats of the kDrive + /// + [JsonPropertyName("can_see_stats")] + public bool? CanSeeStats { get; set; } + + /// + /// Can the drive be upgraded to a kSuite + /// + [JsonPropertyName("can_upgrade_to_ksuite")] + public bool? CanUpgradeToKsuite { get; set; } + + /// + /// Can rewind the kDrive + /// + [JsonPropertyName("can_rewind")] + public bool? CanRewind { get; set; } + + } + + /// + /// Settings of the current users for this kDrive + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveSettingsInline + { + /// + /// ai_scan + /// + [JsonPropertyName("ai_scan")] + public KDriveApiDriveSettingsInlineAiScan? AiScan { get; set; } + + /// + /// versioning + /// + [JsonPropertyName("versioning")] + public KDriveApiDriveSettingsInlineVersioning? Versioning { get; set; } + + /// + /// office + /// + [JsonPropertyName("office")] + public KDriveApiDriveSettingsInlineOffice? Office { get; set; } + + /// + /// Max time the files of an user deleted is kept + /// + [JsonPropertyName("max_keep_deleted_user")] + public string? MaxKeepDeletedUser { get; set; } + + } + + /// + /// ai_scan + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveSettingsInlineAiScan + { + /// + /// Is AI scanning enabled + /// + [JsonPropertyName("is_enabled")] + public bool? IsEnabled { get; set; } + + /// + /// Is AI scanning approved + /// + [JsonPropertyName("has_approved")] + public bool? HasApproved { get; set; } + + /// + /// Are AI categories approved + /// + [JsonPropertyName("has_approved_ai_categories")] + public bool? HasApprovedAiCategories { get; set; } + + /// + /// Is file content search approved + /// + [JsonPropertyName("has_approved_content_search")] + public bool? HasApprovedContentSearch { get; set; } + + /// + /// When AI scanning was approved at + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + } + + /// + /// versioning + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveSettingsInlineVersioning + { + /// + /// Number of versions that can be kept if active + /// + [JsonPropertyName("max_numbers")] + public long? MaxNumbers { get; set; } + + /// + /// Maximum number of days versions are kept + /// + [JsonPropertyName("max_days")] + public long? MaxDays { get; set; } + + } + + /// + /// office + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveSettingsInlineOffice + { + /// + /// Default current application for presentation document. 365 : The 365 application. collabora : The collabora application. onlyoffice : The onlyoffice application. + /// + [JsonPropertyName("presentation")] + public string? Presentation { get; set; } + + /// + /// Default current application for spreadsheet document. 365 : The 365 application. collabora : The collabora application. onlyoffice : The onlyoffice application. + /// + [JsonPropertyName("spreadsheet")] + public string? Spreadsheet { get; set; } + + /// + /// Default current application for text document. 365 : The 365 application. collabora : The collabora application. onlyoffice : The onlyoffice application. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// OnlyOffice display mode. desktop : Optimized for the display in desktop computer browsers. embedded : Optimized for embedding the documents into a website page. mobile : Optimized for the display in mobile device browsers. + /// + [JsonPropertyName("default_mode")] + public string? DefaultMode { get; set; } + + } + + /// + /// preferences + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDrivePreferences + { + /// + /// Default color for kDrive + /// + [JsonPropertyName("color")] + public string? Color { get; set; } + + /// + /// Is the drive hidden for the current user + /// + [JsonPropertyName("hide")] + public bool? Hide { get; set; } + + /// + /// The default drive chosen by the user, if none the first drive in the list should be considered the default. There should only be one default drive. + /// + [JsonPropertyName("default")] + public bool? Default { get; set; } + + /// + /// User's default landing page + /// + [JsonPropertyName("default_page")] + public string? DefaultPage { get; set; } + + /// + /// User's UI preferences on current drive + /// + [JsonPropertyName("ui")] + public KDriveApiDrivePreferencesUi? Ui { get; set; } + + } + + /// + /// User's UI preferences on current drive + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDrivePreferencesUi + { + /// + /// Display an alert when storage limit is about to be reached + /// + [JsonPropertyName("storage_warning_alert")] + public bool? StorageWarningAlert { get; set; } + + /// + /// Display an alert when storage limit has been reached + /// + [JsonPropertyName("storage_limit_alert")] + public bool? StorageLimitAlert { get; set; } + + /// + /// Display a promotion message about the RAG OCR if the user has not seen it yet + /// + [JsonPropertyName("rag_ocr_promotion")] + public bool? RagOcrPromotion { get; set; } + + } + + /// + /// Drive feature limits depending on offer + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveQuota + { + /// + /// dropbox + /// + [JsonPropertyName("dropbox")] + public string? Dropbox { get; set; } + + /// + /// shared_link + /// + [JsonPropertyName("shared_link")] + public string? SharedLink { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiDriveDefaultLimits.cs b/DriveClient/Models/Generated/KDriveApiDriveDefaultLimits.cs new file mode 100644 index 0000000..acd0fe2 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiDriveDefaultLimits.cs @@ -0,0 +1,108 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Drive Default Limits + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveDefaultLimits + { + /// + /// Number of files/folders in the same folder + /// + [JsonPropertyName("files_by_folders")] + public long? FilesByFolders { get; set; } + + /// + /// Max file size + /// + [JsonPropertyName("files_size")] + public long? FilesSize { get; set; } + + /// + /// Max depth of folder + /// + [JsonPropertyName("sub_folders")] + public long? SubFolders { get; set; } + + /// + /// Number of days a file is conserved when trashed + /// + [JsonPropertyName("empty_trash_days")] + public long? EmptyTrashDays { get; set; } + + /// + /// Number of days a version of a file is conserved + /// + [JsonPropertyName("versioning_days")] + public long? VersioningDays { get; set; } + + /// + /// Number of versions of a file + /// + [JsonPropertyName("versioning")] + public long? Versioning { get; set; } + + /// + /// Max number of file for one user + /// + [JsonPropertyName("files_by_user")] + public long? FilesByUser { get; set; } + + /// + /// Max shared link + /// + [JsonPropertyName("shared_link")] + public long? SharedLink { get; set; } + + /// + /// Bandwidth authorize for a user in 24 hours + /// + [JsonPropertyName("bandwidth")] + public long? Bandwidth { get; set; } + + /// + /// Max files downloadable in a archive + /// + [JsonPropertyName("archive_files_download")] + public long? ArchiveFilesDownload { get; set; } + + /// + /// Max number of comments per file + /// + [JsonPropertyName("comments_per_file")] + public long? CommentsPerFile { get; set; } + + /// + /// Minimum size of a file to be cached on kCache before moving to a "cold" storage + /// + [JsonPropertyName("min_size_for_hotcache")] + public long? MinSizeForHotcache { get; set; } + + /// + /// Maximum number of external imports which may run at the same time + /// + [JsonPropertyName("concurrent_external_imports")] + public long? ConcurrentExternalImports { get; set; } + + /// + /// Maximum number of dropboxes per drive + /// + [JsonPropertyName("dropboxes")] + public long? Dropboxes { get; set; } + + /// + /// Maximum number of days, in past, statistics can be seen - 0 for unlimited + /// + [JsonPropertyName("stats_days")] + public long? StatsDays { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiDriveSettings.cs b/DriveClient/Models/Generated/KDriveApiDriveSettings.cs new file mode 100644 index 0000000..f5e3954 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiDriveSettings.cs @@ -0,0 +1,190 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// DriveSettings + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveSettings + { + /// + /// ai_scan + /// + [JsonPropertyName("ai_scan")] + public KDriveApiDriveSettingsAiScan? AiScan { get; set; } + + /// + /// shared_link + /// + [JsonPropertyName("shared_link")] + public KDriveApiDriveSettingsSharedLink? SharedLink { get; set; } + + /// + /// trash + /// + [JsonPropertyName("trash")] + public KDriveApiDriveSettingsTrash? Trash { get; set; } + + /// + /// office + /// + [JsonPropertyName("office")] + public KDriveApiDriveSettingsOffice? Office { get; set; } + + /// + /// versioning + /// + [JsonPropertyName("versioning")] + public KDriveApiDriveSettingsVersioning? Versioning { get; set; } + + /// + /// Max time the files of an user deleted is kept + /// + [JsonPropertyName("max_keep_deleted_user")] + public string? MaxKeepDeletedUser { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// ai_scan + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveSettingsAiScan + { + /// + /// Has approved the file scan for IA purpose + /// + [JsonPropertyName("has_approved")] + public bool? HasApproved { get; set; } + + /// + /// Has approved automatic `Categories` on `Files` + /// + [JsonPropertyName("has_approved_ai_categories")] + public bool? HasApprovedAiCategories { get; set; } + + /// + /// Has approved file content search + /// + [JsonPropertyName("has_approved_content_search")] + public bool? HasApprovedContentSearch { get; set; } + + /// + /// Approval date + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + } + + /// + /// shared_link + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveSettingsSharedLink + { + /// + /// Images set up for share-link + /// + [JsonPropertyName("images")] + public List? Images { get; set; } + + /// + /// Custom share-link is activate + /// + [JsonPropertyName("activate")] + public bool? Activate { get; set; } + + /// + /// Text color for share-link + /// + [JsonPropertyName("txtColor")] + public string? TxtColor { get; set; } + + /// + /// Background color for share-link + /// + [JsonPropertyName("bgColor")] + public string? BgColor { get; set; } + + } + + /// + /// trash + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveSettingsTrash + { + /// + /// Number of days the files are kept in trash. Unit is in days + /// + [JsonPropertyName("max_duration")] + public long? MaxDuration { get; set; } + + } + + /// + /// office + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveSettingsOffice + { + /// + /// Default current application for presentation document + /// + [JsonPropertyName("presentation")] + public string? Presentation { get; set; } + + /// + /// Default current application for form document + /// + [JsonPropertyName("form")] + public string? Form { get; set; } + + /// + /// Default current application for spreadsheet document + /// + [JsonPropertyName("spreadsheet")] + public string? Spreadsheet { get; set; } + + /// + /// Default current application for text document + /// + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// Application display mode + /// + [JsonPropertyName("default_mode")] + public string? DefaultMode { get; set; } + + } + + /// + /// versioning + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveSettingsVersioning + { + /// + /// Number of versions that can be kept if active + /// + [JsonPropertyName("max_numbers")] + public long? MaxNumbers { get; set; } + + /// + /// Maximum number of days versions are kept + /// + [JsonPropertyName("max_days")] + public long? MaxDays { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiDriveUser.cs b/DriveClient/Models/Generated/KDriveApiDriveUser.cs new file mode 100644 index 0000000..eacbbe7 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiDriveUser.cs @@ -0,0 +1,311 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Drive User + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveUser + { + /// + /// Unique identifier of the resource `Drive User` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Display name + /// + [JsonPropertyName("display_name")] + public string? DisplayName { get; set; } + + /// + /// First name + /// + [JsonPropertyName("first_name")] + public string? FirstName { get; set; } + + /// + /// Last name + /// + [JsonPropertyName("last_name")] + public string? LastName { get; set; } + + /// + /// Email + /// + [JsonPropertyName("email")] + public string? Email { get; set; } + + /// + /// returns true if the user is provided by an external IDP + /// + [JsonPropertyName("is_sso")] + public bool? IsSso { get; set; } + + /// + /// null is returned only when request parameter no_avatar_default=1 and the user has not set an avatar + /// + [JsonPropertyName("avatar")] + public string? Avatar { get; set; } + + /// + /// Type of the access; this field is no longer used and has been replaced by an additional role property `external`. main : User has access to the drive. shared : User has access to a shared file / directory only. + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// Timestamp `Drive User` was deleted at + /// + [JsonPropertyName("deleted_at")] + public long? DeletedAt { get; set; } + + /// + /// List of Team identifiers + /// + [JsonPropertyName("teams")] + public List? Teams { get; set; } + + /// + /// security + /// + [JsonPropertyName("security")] + public KDriveApiDriveUserSecurity? Security { get; set; } + + /// + /// Drive identifier + /// + [JsonPropertyName("drive_id")] + public long? DriveId { get; set; } + + [JsonPropertyName("drive")] + public KDriveApiDrive? Drive { get; set; } + + /// + /// drive_name + /// + [JsonPropertyName("drive_name")] + public string? DriveName { get; set; } + + /// + /// Account identifier of resource `Drive User` + /// + [JsonPropertyName("account_id")] + public long? AccountId { get; set; } + + /// + /// Timestamp `Drive User` was created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Timestamp `Drive User` was updated at + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + /// + /// Timestamp `User` was last connected at + /// + [JsonPropertyName("last_connection_at")] + public long? LastConnectionAt { get; set; } + + /// + /// Unique identifier of the `product` that is related to the resource `Drive User` + /// + [JsonPropertyName("product_id")] + public long? ProductId { get; set; } + + /// + /// Current access status of the user in the drive. active : User has access to the Drive. deleted_kept : User has been removed but his data remain in the drive. deleted_removed : User has been removed. deleted_transferred : User has been removed and his data has been transferred to… + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Administration level of the user. admin : Administrator of the drive, can manage the drive (settings, invitations and users) and the files. external : External user can only access the files given by the others roles. user : Internal user can invite user and manage the files of … + /// + [JsonPropertyName("role")] + public string? Role { get; set; } + + /// + /// preference + /// + [JsonPropertyName("preference")] + public KDriveApiDriveUserPreference? Preference { get; set; } + + /// + /// Get user permissions on categories + /// + [JsonPropertyName("categories_permissions")] + public string? CategoriesPermissions { get; set; } + + /// + /// Accessible features for the Drive User + /// + [JsonPropertyName("capabilities")] + public KDriveApiDriveUserCapabilities? Capabilities { get; set; } + + /// + /// Storage size of private files (bytes) + /// + [JsonPropertyName("private_storage")] + public long? PrivateStorage { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// security + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveUserSecurity + { + /// + /// The last date the assistant was used + /// + [JsonPropertyName("assistant_at")] + public long? AssistantAt { get; set; } + + /// + /// Double authentication method used to log in + /// + [JsonPropertyName("double_auth_method")] + public string? DoubleAuthMethod { get; set; } + + /// + /// Whether the `Drive User` has double authentication enabled + /// + [JsonPropertyName("has_double_auth")] + public bool? HasDoubleAuth { get; set; } + + /// + /// Last time `Drive User`'s password was changed + /// + [JsonPropertyName("last_password_at")] + public long? LastPasswordAt { get; set; } + + /// + /// Security score of the `Drive User` + /// + [JsonPropertyName("score")] + public long? Score { get; set; } + + /// + /// Whether the `Drive User` has a valid email + /// + [JsonPropertyName("has_valid_email")] + public long? HasValidEmail { get; set; } + + /// + /// Whether the `Drive User` has a recovery email + /// + [JsonPropertyName("has_recovery_email")] + public bool? HasRecoveryEmail { get; set; } + + /// + /// Whether the `Drive User` has a valid phone number + /// + [JsonPropertyName("has_valid_phone")] + public bool? HasValidPhone { get; set; } + + } + + /// + /// preference + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveUserPreference + { + /// + /// Default color for drive + /// + [JsonPropertyName("color")] + public string? Color { get; set; } + + /// + /// Is the drive hidden for the current user + /// + [JsonPropertyName("hide")] + public bool? Hide { get; set; } + + /// + /// The default drive chosen by the user, if none the first drive in the list should be considered the default. There should only be one default drive. + /// + [JsonPropertyName("default")] + public bool? Default { get; set; } + + /// + /// User's default landing page + /// + [JsonPropertyName("default_page")] + public string? DefaultPage { get; set; } + + /// + /// User's UI preferences on current drive + /// + [JsonPropertyName("ui")] + public KDriveApiDriveUserPreferenceUi? Ui { get; set; } + + } + + /// + /// User's UI preferences on current drive + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveUserPreferenceUi + { + /// + /// Display an alert when storage limit is about to be reached + /// + [JsonPropertyName("storage_warning_alert")] + public bool? StorageWarningAlert { get; set; } + + /// + /// Display an alert when storage limit has been reached + /// + [JsonPropertyName("storage_limit_alert")] + public bool? StorageLimitAlert { get; set; } + + /// + /// Display a promotion message about the RAG OCR if the user has not seen it yet + /// + [JsonPropertyName("rag_ocr_promotion")] + public bool? RagOcrPromotion { get; set; } + + } + + /// + /// Accessible features for the Drive User + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveUserCapabilities + { + /// + /// can_create_team_directory + /// + [JsonPropertyName("can_create_team_directory")] + public bool? CanCreateTeamDirectory { get; set; } + + /// + /// can_set_trash_duration + /// + [JsonPropertyName("can_set_trash_duration")] + public bool? CanSetTrashDuration { get; set; } + + /// + /// Whether the `Drive User` has the permission to perform technical operations + /// + [JsonPropertyName("has_technical_permission")] + public bool? HasTechnicalPermission { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiDriveUserInvitation.cs b/DriveClient/Models/Generated/KDriveApiDriveUserInvitation.cs new file mode 100644 index 0000000..c7632d9 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiDriveUserInvitation.cs @@ -0,0 +1,141 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Drive User Invitation + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDriveUserInvitation + { + /// + /// Unique identifier of the resource `Drive User Invitation` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Type of `Invitation` + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// is_private + /// + [JsonPropertyName("is_private")] + public bool? IsPrivate { get; set; } + + /// + /// user_exist + /// + [JsonPropertyName("user_exist")] + public bool? UserExist { get; set; } + + /// + /// Random key used to uniquely identify the `Invitation` + /// + [JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// file_id + /// + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + + /// + /// Language to invite the `User` in + /// + [JsonPropertyName("lang")] + public string? Lang { get; set; } + + /// + /// User identifier + /// + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + + [JsonPropertyName("user")] + public KDriveApiAppUser? User { get; set; } + + /// + /// Identifier of `User` that sent the invitation + /// + [JsonPropertyName("invited_by")] + public long? InvitedBy { get; set; } + + [JsonPropertyName("invited")] + public KDriveApiAppUser? Invited { get; set; } + + /// + /// `Invitation` url + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// Whether the `Invitation` is still valid or not + /// + [JsonPropertyName("is_valid")] + public bool? IsValid { get; set; } + + /// + /// Status of the `Invitation` + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Email + /// + [JsonPropertyName("email")] + public string? Email { get; set; } + + /// + /// `Invitation` message + /// + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// + /// When the invitation expire + /// + [JsonPropertyName("expired_at")] + public long? ExpiredAt { get; set; } + + /// + /// When the invitation was created + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// `Drive` name displayed for user + /// + [JsonPropertyName("access_name")] + public string? AccessName { get; set; } + + /// + /// Role that will be assigned to invited `User` + /// + [JsonPropertyName("role")] + public string? Role { get; set; } + + [JsonPropertyName("drive")] + public KDriveApiDrive? Drive { get; set; } + + /// + /// The `File` the `User` is invited to + /// + [JsonPropertyName("file")] + public JsonElement? File { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiDrivepackprice.cs b/DriveClient/Models/Generated/KDriveApiDrivepackprice.cs new file mode 100644 index 0000000..0031b92 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiDrivepackprice.cs @@ -0,0 +1,54 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Drive pack price + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDrivepackprice + { + /// + /// Drive pack price type, Base: standard price, User : Additional user price, Storage_giga : Additional storage price + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// Unity of additional type + /// + [JsonPropertyName("unit")] + public long? Unit { get; set; } + + /// + /// Price by months + /// + [JsonPropertyName("period")] + public long? Period { get; set; } + + /// + /// Currency identifier + /// + [JsonPropertyName("currency_id")] + public long? CurrencyId { get; set; } + + /// + /// Price without the tax + /// + [JsonPropertyName("amount_excl_vat")] + public double? AmountExclVat { get; set; } + + /// + /// Price with the tax + /// + [JsonPropertyName("amount_incl_vat")] + public double? AmountInclVat { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiDropbox.cs b/DriveClient/Models/Generated/KDriveApiDropbox.cs new file mode 100644 index 0000000..bc77cea --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiDropbox.cs @@ -0,0 +1,128 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Dropbox + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDropbox + { + /// + /// Unique identifier of the resource `Dropbox` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Dropbox unique identifier + /// + [JsonPropertyName("uuid")] + public string? Uuid { get; set; } + + /// + /// Name of the dropbox + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Public URL of the dropbox + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + [JsonPropertyName("directory")] + public KDriveApiDirectoryV3? Directory { get; set; } + + /// + /// Number of recorded users that uploaded in the dropbox + /// + [JsonPropertyName("users_count")] + public long? UsersCount { get; set; } + + /// + /// Unique identifier of the creator of the resource `Dropbox` + /// + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + /// + /// Timestamp `Dropbox` was created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Timestamp `Dropbox` was updated at + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + /// + /// Last time someone uploaded a file in the dropbox + /// + [JsonPropertyName("last_uploaded_at")] + public long? LastUploadedAt { get; set; } + + /// + /// capabilities + /// + [JsonPropertyName("capabilities")] + public KDriveApiDropboxCapabilities? Capabilities { get; set; } + + [JsonPropertyName("user")] + public KDriveApiAppUser? User { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// capabilities + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiDropboxCapabilities + { + /// + /// A password was defined to access to the dropbox + /// + [JsonPropertyName("has_password")] + public bool? HasPassword { get; set; } + + /// + /// Notification was enabled on the dropbox, email we be send to dropbox owner when someone upload a file + /// + [JsonPropertyName("has_notification")] + public bool? HasNotification { get; set; } + + /// + /// A validity period was set to the dropbox, after the date define the dropbox is not accessible + /// + [JsonPropertyName("has_validity")] + public bool? HasValidity { get; set; } + + /// + /// A limit size was defined to the dropbox, after the date define the dropbox is not accessible + /// + [JsonPropertyName("has_size_limit")] + public bool? HasSizeLimit { get; set; } + + /// + /// validity + /// + [JsonPropertyName("validity")] + public string? Validity { get; set; } + + /// + /// size + /// + [JsonPropertyName("size")] + public string? Size { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiErrorResponse.cs b/DriveClient/Models/Generated/KDriveApiErrorResponse.cs new file mode 100644 index 0000000..0077654 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiErrorResponse.cs @@ -0,0 +1,24 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Generic error response schema to be reused + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiErrorResponse + { + /// + /// Result of the HTTP request + /// + [JsonPropertyName("result")] + public string? Result { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiExternInvitationFileAccess.cs b/DriveClient/Models/Generated/KDriveApiExternInvitationFileAccess.cs new file mode 100644 index 0000000..ea65594 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiExternInvitationFileAccess.cs @@ -0,0 +1,54 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Extern Invitation File Access + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiExternInvitationFileAccess + { + /// + /// Extern Invitation File Access Identifier, can be team identifier, user identifier, invitation identifier + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Access type + /// + [JsonPropertyName("access")] + public string? Access { get; set; } + + /// + /// Extern Invitation File Access name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Access right + /// + [JsonPropertyName("right")] + public string? Right { get; set; } + + /// + /// Access color + /// + [JsonPropertyName("color")] + public long? Color { get; set; } + + /// + /// Status of access + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiExternalImport.cs b/DriveClient/Models/Generated/KDriveApiExternalImport.cs new file mode 100644 index 0000000..498a734 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiExternalImport.cs @@ -0,0 +1,90 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// External Import + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiExternalImport + { + /// + /// External import identifier + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Service from which the import originates. dropbox : Import from Dropbox. kdrive : Import from another kDrive. kdrive_sharelink : Import from a kDrive sharelink. nextcloud : Import from Nextcloud. onedrive : Import from Microsoft OneDrive. owncloud : Import from ownCloud. webdav … + /// + [JsonPropertyName("application")] + public string? Application { get; set; } + + /// + /// Account imported + /// + [JsonPropertyName("account_name")] + public string? AccountName { get; set; } + + /// + /// External import status. canceled : External import was canceled. canceling : External import is being canceled. done : External import is finished. failed : External import failed. in_progress : External import is currently in progress. queued : External import is waiting for a … + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Give an error code if the failed reason is known. + /// + [JsonPropertyName("error_code")] + public string? ErrorCode { get; set; } + + /// + /// Import path destination + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// Import directory identifier destination (if was not deleted) + /// + [JsonPropertyName("directory_id")] + public long? DirectoryId { get; set; } + + /// + /// Import application has shared files + /// + [JsonPropertyName("has_shared_files")] + public string? HasSharedFiles { get; set; } + + /// + /// Timestamp `External Import` was created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Timestamp `External Import` was updated at + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + /// + /// Number of successfully imported files + /// + [JsonPropertyName("count_success_files")] + public long? CountSuccessFiles { get; set; } + + /// + /// Number of failed imported files + /// + [JsonPropertyName("count_failed_files")] + public long? CountFailedFiles { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiExternalImportFile.cs b/DriveClient/Models/Generated/KDriveApiExternalImportFile.cs new file mode 100644 index 0000000..fa9d3f9 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiExternalImportFile.cs @@ -0,0 +1,48 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// External Import File + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiExternalImportFile + { + /// + /// External file import identifier + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// External file name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// External file import status. error : External file import failed; additional information are available in the message field. finished : External file was imported successfully. + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Message if an error occurred + /// + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// + /// External file creation date + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiFeedbackaccesspendinginvitationresource.cs b/DriveClient/Models/Generated/KDriveApiFeedbackaccesspendinginvitationresource.cs new file mode 100644 index 0000000..e183912 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiFeedbackaccesspendinginvitationresource.cs @@ -0,0 +1,48 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Feedback access pending invitation resource + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFeedbackaccesspendinginvitationresource + { + /// + /// The pending invitation of the file, if any + /// + [JsonPropertyName("invitation_id")] + public long? InvitationId { get; set; } + + /// + /// The pending invitation of the drive if any + /// + [JsonPropertyName("drive_invitation_id")] + public long? DriveInvitationId { get; set; } + + /// + /// If there is at least a file or drive pending invitation on the drive + /// + [JsonPropertyName("has_invitation")] + public string? HasInvitation { get; set; } + + /// + /// The user id asked + /// + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + + /// + /// The email asked + /// + [JsonPropertyName("email")] + public string? Email { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiFeedbackaccessresource.cs b/DriveClient/Models/Generated/KDriveApiFeedbackaccessresource.cs new file mode 100644 index 0000000..1d03900 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiFeedbackaccessresource.cs @@ -0,0 +1,42 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Feedback access resource + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFeedbackaccessresource + { + /// + /// The email,team or user identifier filled in the parameters + /// + [JsonPropertyName("id")] + public JsonElement? Id { get; set; } + + /// + /// The invitation send + /// + [JsonPropertyName("result")] + public bool? Result { get; set; } + + /// + /// The invitation send, null if access was not found + /// + [JsonPropertyName("access")] + public JsonElement? Access { get; set; } + + /// + /// Additional message about why email fail to be sent + /// + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiFeedbackaccessresourceC3fdaa7f.cs b/DriveClient/Models/Generated/KDriveApiFeedbackaccessresourceC3fdaa7f.cs new file mode 100644 index 0000000..c688e35 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiFeedbackaccessresourceC3fdaa7f.cs @@ -0,0 +1,36 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Feedback access resource + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFeedbackaccessresourceC3fdaa7f + { + /// + /// Result of the asked email access + /// + [JsonPropertyName("emails")] + public List? Emails { get; set; } + + /// + /// Result of the asked users access + /// + [JsonPropertyName("users")] + public List? Users { get; set; } + + /// + /// Result of the asked teams access + /// + [JsonPropertyName("teams")] + public List? Teams { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiFeedbackresource.cs b/DriveClient/Models/Generated/KDriveApiFeedbackresource.cs new file mode 100644 index 0000000..237eeb3 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiFeedbackresource.cs @@ -0,0 +1,36 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Feedback resource + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFeedbackresource + { + /// + /// Identifier + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Result of the asking query + /// + [JsonPropertyName("result")] + public bool? Result { get; set; } + + /// + /// Message, additional information usually given when the result is false + /// + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiFile.cs b/DriveClient/Models/Generated/KDriveApiFile.cs new file mode 100644 index 0000000..9929608 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiFile.cs @@ -0,0 +1,421 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// File + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFile + { + /// + /// Unique identifier of the resource `File` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// File name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Specific sortable name + /// + [JsonPropertyName("sorted_name")] + public string? SortedName { get; set; } + + /// + /// Full path of the File + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// Type of returned element either a dir (Directory) or file (File) + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// Current state of File. The state can be null meaning that the File has no specific state. locked : File is currently locked. No action can be made except unlocking by the application which locked the File (such as office, webdav or external import). ok : File is available. trash… + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Visibility of File, empty string if no specific visibility. Add additional information about File to show different icons or more. : Empty visibility mean no special visibility. is_in_team_space_folder : Is a File inside a Common Documents directory. is_root : Is the root direct… + /// + [JsonPropertyName("visibility")] + public string? Visibility { get; set; } + + /// + /// Drive identifier + /// + [JsonPropertyName("drive_id")] + public long? DriveId { get; set; } + + /// + /// Current path depth of File + /// + [JsonPropertyName("depth")] + public long? Depth { get; set; } + + /// + /// The identifier of the user who first uploaded the File + /// + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + /// + /// File creation timestamp (in seconds), if available in its metadata or specified on upload + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// The timestamp (in seconds) at which the File has been uploaded for the first time + /// + [JsonPropertyName("added_at")] + public long? AddedAt { get; set; } + + /// + /// File creation timestamp (in seconds), if available in its metadata or specified on upload + /// + [JsonPropertyName("last_modified_at")] + public long? LastModifiedAt { get; set; } + + /// + /// Parent directory identifier + /// + [JsonPropertyName("parent_id")] + public long? ParentId { get; set; } + + /// + /// Timestamp of deleted resource File, only visible when the File is trashed + /// + [JsonPropertyName("deleted_at")] + public long? DeletedAt { get; set; } + + /// + /// User identifier of deleted resource File, only visible when the File is trashed + /// + [JsonPropertyName("deleted_by")] + public long? DeletedBy { get; set; } + + /// + /// Root Directory identifier, only visible for shared user + /// + [JsonPropertyName("shared_root_id")] + public long? SharedRootId { get; set; } + + /// + /// Get all parents directories + /// + [JsonPropertyName("parents")] + public List? Parents { get; set; } + + /// + /// Array of users identifiers that has access to the File + /// + [JsonPropertyName("users")] + public List? Users { get; set; } + + /// + /// Array of teams identifiers that has access to the File + /// + [JsonPropertyName("teams")] + public List? Teams { get; set; } + + /// + /// Is File pinned as favorite + /// + [JsonPropertyName("is_favorite")] + public bool? IsFavorite { get; set; } + + /// + /// Activities information about the File + /// + [JsonPropertyName("activity")] + public KDriveApiFileActivity? Activity { get; set; } + + [JsonPropertyName("sharelink")] + public KDriveApiShareLink? ShareLink { get; set; } + + /// + /// Capabilities of File + /// + [JsonPropertyName("capabilities")] + public KDriveApiFileCapabilities? Capabilities { get; set; } + + /// + /// When File is locked, locked information + /// + [JsonPropertyName("lock")] + public KDriveApiFileLock? Lock { get; set; } + + /// + /// File categories + /// + [JsonPropertyName("categories")] + public List? Categories { get; set; } + + /// + /// ETag of the file + /// + [JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Size of File The unit of size is defined in Bytes + /// + [JsonPropertyName("size")] + public long? Size { get; set; } + + /// + /// File has thumbnail, if so you can request thumbnail route + /// + [JsonPropertyName("has_thumbnail")] + public bool? HasThumbnail { get; set; } + + /// + /// File can be handled by OnlyOffice + /// + [JsonPropertyName("has_onlyoffice")] + public bool? HasOnlyoffice { get; set; } + + /// + /// Mime-type of file + /// + [JsonPropertyName("mime_type")] + public string? MimeType { get; set; } + + /// + /// Generic file types, matching a known set of extensions and/or mime types. archive : Archive file. audio : Audio only file. code : Text file recognized as code. diagram : Diagram file. dir : Directory. email : Bundled email file. font : Text file recognized as font. form : Form f… + /// + [JsonPropertyName("extension_type")] + public string? ExtensionType { get; set; } + + /// + /// Current state of virus scan for File. cannot_be_scanned : This File cannot be scanned. Possibly because the File is too large. clean : This File has been successfully scanned for known viruses. error : An error occurred while scanning the File. infected : This File has been dete… + /// + [JsonPropertyName("scan_status")] + public string? ScanStatus { get; set; } + + /// + /// Symlink target path if the file was uploaded as a symlink + /// + [JsonPropertyName("symbolic_link")] + public string? SymbolicLink { get; set; } + + /// + /// Information when file has multi-version + /// + [JsonPropertyName("version")] + public KDriveApiFileVersionInline? Version { get; set; } + + /// + /// The available ways to convert the file + /// + [JsonPropertyName("conversion_capabilities")] + public KDriveApiFileConversionCapabilities? ConversionCapabilities { get; set; } + + /// + /// Hash of the file content + /// + [JsonPropertyName("hash")] + public string? Hash { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// Activities information about the File + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileActivity + { + /// + /// Timestamp of the last user access of the File + /// + [JsonPropertyName("last_accessed_at")] + public long? LastAccessedAt { get; set; } + + } + + /// + /// Capabilities of File + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileCapabilities + { + /// + /// Right to set file as favorite + /// + [JsonPropertyName("can_use_favorite")] + public bool? CanUseFavorite { get; set; } + + /// + /// Right to share file by link (share_link) + /// + [JsonPropertyName("can_become_sharelink")] + public bool? CanBecomeSharelink { get; set; } + + /// + /// Right to use and give team access + /// + [JsonPropertyName("can_use_team")] + public bool? CanUseTeam { get; set; } + + /// + /// Right to see File information + /// + [JsonPropertyName("can_show")] + public bool? CanShow { get; set; } + + /// + /// Right to read File content + /// + [JsonPropertyName("can_read")] + public bool? CanRead { get; set; } + + /// + /// Right to write File + /// + [JsonPropertyName("can_write")] + public bool? CanWrite { get; set; } + + /// + /// Right to share File or manage access to File + /// + [JsonPropertyName("can_share")] + public bool? CanShare { get; set; } + + /// + /// Right to leave shared File + /// + [JsonPropertyName("can_leave")] + public bool? CanLeave { get; set; } + + /// + /// Right to delete File + /// + [JsonPropertyName("can_delete")] + public bool? CanDelete { get; set; } + + /// + /// Right to rename File + /// + [JsonPropertyName("can_rename")] + public bool? CanRename { get; set; } + + /// + /// Right to move File + /// + [JsonPropertyName("can_move")] + public bool? CanMove { get; set; } + + } + + /// + /// When File is locked, locked information + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileLock + { + /// + /// When File is locked, locked timestamp + /// + [JsonPropertyName("locked_at")] + public long? LockedAt { get; set; } + + /// + /// When File is locked, automatic lock release timestamp + /// + [JsonPropertyName("unlocked_at")] + public long? UnlockedAt { get; set; } + + /// + /// When File is locked, locked reason + /// + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// When File is locked, locked token + /// + [JsonPropertyName("token")] + public string? Token { get; set; } + + } + + /// + /// Information when file has multi-version + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileVersionInline + { + /// + /// File has multi-version + /// + [JsonPropertyName("is_multiple")] + public bool? IsMultiple { get; set; } + + /// + /// Get number of version + /// + [JsonPropertyName("number")] + public long? Number { get; set; } + + /// + /// Size of the file with all version (byte unit) + /// + [JsonPropertyName("total_size")] + public long? TotalSize { get; set; } + + /// + /// True if the current version of this file should be kept forever, otherwise false or empty + /// + [JsonPropertyName("keep_forever")] + public bool? KeepForever { get; set; } + + } + + /// + /// The available ways to convert the file + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileConversionCapabilities + { + /// + /// Whether the file may be converted upon download + /// + [JsonPropertyName("when_downloading")] + public bool? WhenDownloading { get; set; } + + /// + /// Available extensions to which the file may be converted upon download, if possible + /// + [JsonPropertyName("download_extensions")] + public List? DownloadExtensions { get; set; } + + /// + /// Whether the file may be converted for live edition with OnlyOffice + /// + [JsonPropertyName("when_onlyoffice_opening")] + public bool? WhenOnlyofficeOpening { get; set; } + + /// + /// Available extension to which the file may be converted by OnlyOffice, if possible + /// + [JsonPropertyName("onlyoffice_extension")] + public string? OnlyofficeExtension { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiFileAccess.cs b/DriveClient/Models/Generated/KDriveApiFileAccess.cs new file mode 100644 index 0000000..69b2745 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiFileAccess.cs @@ -0,0 +1,39 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// File Access + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileAccess + { + /// + /// All users that have access to file + /// + [JsonPropertyName("users")] + public List? Users { get; set; } + + /// + /// All teams that has access to file + /// + [JsonPropertyName("teams")] + public List? Teams { get; set; } + + /// + /// All invitation that has access to file + /// + [JsonPropertyName("invitations")] + public List? Invitations { get; set; } + + [JsonPropertyName("parent_access")] + public KDriveApiUserandteamsaccessonparentfile? ParentAccess { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiFileCategory.cs b/DriveClient/Models/Generated/KDriveApiFileCategory.cs new file mode 100644 index 0000000..49b81ee --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiFileCategory.cs @@ -0,0 +1,51 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// File Category + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileCategory + { + /// + /// Category identifier + /// + [JsonPropertyName("category_id")] + public long? CategoryId { get; set; } + + /// + /// Time when the category was added to file + /// + [JsonPropertyName("added_at")] + public long? AddedAt { get; set; } + + /// + /// State of user validation after auto assignment from AI. + /// + [JsonPropertyName("user_validation")] + public string? UserValidation { get; set; } + + /// + /// Whether the Category was generated by an AI or not + /// + [JsonPropertyName("is_generated_by_ai")] + public bool? IsGeneratedByAi { get; set; } + + /// + /// User identifier + /// + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + + [JsonPropertyName("category")] + public KDriveApiCategory? Category { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiFileDeleted.cs b/DriveClient/Models/Generated/KDriveApiFileDeleted.cs new file mode 100644 index 0000000..0ff1aad --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiFileDeleted.cs @@ -0,0 +1,84 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// File Deleted + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileDeleted + { + /// + /// Unique identifier of the resource `File Deleted` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// File name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Type of returned element either a dir (Directory) or file (File) + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// Full path of the File Deleted + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// Visibility of File Deleted, empty string if no specific visibility. Add additional information about File Deleted to show different icons or more. : Empty visibility mean no special visibility. is_in_private_space : Is a File Deleted inside the private directory of the user. is_… + /// + [JsonPropertyName("visibility")] + public string? Visibility { get; set; } + + /// + /// Current path depth of File Deleted + /// + [JsonPropertyName("depth")] + public long? Depth { get; set; } + + /// + /// The identifier of the user who first uploaded the File Deleted + /// + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + /// + /// Parent directory identifier + /// + [JsonPropertyName("parent_id")] + public long? ParentId { get; set; } + + /// + /// Timestamp of deleted resource File Deleted, only visible when the File Deleted is trashed + /// + [JsonPropertyName("deleted_at")] + public long? DeletedAt { get; set; } + + /// + /// User identifier of deleted resource File Deleted, only visible when the File Deleted is trashed + /// + [JsonPropertyName("deleted_by")] + public long? DeletedBy { get; set; } + + /// + /// File type, properties is not returned for directory type + /// + [JsonPropertyName("extension_type")] + public string? ExtensionType { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiFileSystemItem.cs b/DriveClient/Models/Generated/KDriveApiFileSystemItem.cs new file mode 100644 index 0000000..62ae91a --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiFileSystemItem.cs @@ -0,0 +1,484 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Union of OpenAPI FileV3 and DirectoryV3 for endpoints that return either type (discriminator: type = file|dir). + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileSystemItem + { + /// + /// Unique identifier of the resource `Directory V3` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// File name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Specific sortable name + /// + [JsonPropertyName("sorted_name")] + public string? SortedName { get; set; } + + /// + /// Full path of the Directory V3 + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// Type of returned element either a dir (Directory) or file (File) + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// Current state of Directory V3. The state can be null meaning that the Directory V3 has no specific state. locked : Directory V3 is currently locked. No action can be made except unlocking by the application which locked the File (such as office, webdav or external import). ok : … + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Visibility of Directory V3, empty string if no specific visibility. Add additional information about Directory V3 to show different icons or more. : Empty visibility mean no special visibility. is_in_private_space : Is a Directory V3 inside the private directory of the user. is_… + /// + [JsonPropertyName("visibility")] + public string? Visibility { get; set; } + + /// + /// Drive identifier + /// + [JsonPropertyName("drive_id")] + public long? DriveId { get; set; } + + /// + /// Current path depth of Directory V3 + /// + [JsonPropertyName("depth")] + public long? Depth { get; set; } + + /// + /// The identifier of the user who first uploaded the Directory V3 + /// + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + /// + /// Directory V3 creation timestamp (in seconds), if available in its metadata or specified on upload + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// The timestamp (in seconds) at which the Directory V3 has been uploaded for the first time + /// + [JsonPropertyName("added_at")] + public long? AddedAt { get; set; } + + /// + /// Directory V3 creation timestamp (in seconds), if available in its metadata or specified on upload + /// + [JsonPropertyName("last_modified_at")] + public long? LastModifiedAt { get; set; } + + /// + /// Id of the user who last modified the Directory V3 + /// + [JsonPropertyName("last_modified_by")] + public long? LastModifiedBy { get; set; } + + /// + /// The last time the content of the Directory V3 was revised + /// + [JsonPropertyName("revised_at")] + public long? RevisedAt { get; set; } + + /// + /// The last time the Directory V3 was updated + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + /// + /// Parent directory identifier + /// + [JsonPropertyName("parent_id")] + public long? ParentId { get; set; } + + /// + /// Timestamp of deleted resource Directory V3, only visible when the Directory V3 is trashed + /// + [JsonPropertyName("deleted_at")] + public long? DeletedAt { get; set; } + + /// + /// User identifier of deleted resource Directory V3, only visible when the Directory V3 is trashed + /// + [JsonPropertyName("deleted_by")] + public long? DeletedBy { get; set; } + + /// + /// Root Directory identifier, only visible for shared user + /// + [JsonPropertyName("shared_root_id")] + public long? SharedRootId { get; set; } + + /// + /// Get all parents directories + /// + [JsonPropertyName("parents")] + public List? Parents { get; set; } + + /// + /// Array of users identifiers that has access to the Directory V3 + /// + [JsonPropertyName("users")] + public List? Users { get; set; } + + /// + /// Array of teams identifiers that has access to the Directory V3 + /// + [JsonPropertyName("teams")] + public List? Teams { get; set; } + + /// + /// Is Directory V3 pinned as favorite + /// + [JsonPropertyName("is_favorite")] + public bool? IsFavorite { get; set; } + + /// + /// Activities information about the Directory V3 + /// + [JsonPropertyName("activity")] + public KDriveApiFileSystemItemActivity? Activity { get; set; } + + [JsonPropertyName("sharelink")] + public KDriveApiShareLink? ShareLink { get; set; } + + /// + /// Directory rights + /// + [JsonPropertyName("capabilities")] + public KDriveApiFileSystemItemCapabilities? Capabilities { get; set; } + + /// + /// When Directory V3 is locked, locked information + /// + [JsonPropertyName("lock")] + public KDriveApiFileSystemItemLock? Lock { get; set; } + + /// + /// File categories + /// + [JsonPropertyName("categories")] + public List? Categories { get; set; } + + /// + /// ETag of the file + /// + [JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Size of File V3 The unit of size is defined in Bytes + /// + [JsonPropertyName("size")] + public long? Size { get; set; } + + /// + /// Mime-type of file + /// + [JsonPropertyName("mime_type")] + public string? MimeType { get; set; } + + /// + /// Generic file types, matching a known set of extensions and/or mime types. archive : Archive file. audio : Audio only file. code : Text file recognized as code. diagram : Diagram file. dir : Directory. email : Bundled email file. font : Text file recognized as font. form : Form f… + /// + [JsonPropertyName("extension_type")] + public string? ExtensionType { get; set; } + + /// + /// Symlink target path if the file was uploaded as a symlink + /// + [JsonPropertyName("symbolic_link")] + public string? SymbolicLink { get; set; } + + /// + /// Current state of virus scan for File V3. cannot_be_scanned : This File V3 cannot be scanned. Possibly because the File V3 is too large. clean : This File V3 has been successfully scanned for known viruses. error : An error occurred while scanning the File V3. infected : This Fil… + /// + [JsonPropertyName("scan_status")] + public string? ScanStatus { get; set; } + + /// + /// List of applications. 365 : The 365 application. drawio : The drawio application. kmail : The kmail application. onlyoffice : The onlyoffice application. thumbnail : Thumbnail is preview and thumbnail. + /// + [JsonPropertyName("supported_by")] + public JsonElement? SupportedBy { get; set; } + + /// + /// Information when file has multi-version + /// + [JsonPropertyName("version")] + public KDriveApiFileSystemItemVersion? Version { get; set; } + + /// + /// The available ways to convert the file + /// + [JsonPropertyName("conversion_capabilities")] + public KDriveApiFileSystemItemConversionCapabilities? ConversionCapabilities { get; set; } + + /// + /// Hash of the file content + /// + [JsonPropertyName("hash")] + public string? Hash { get; set; } + + /// + /// Color of the directory for the user requesting it + /// + [JsonPropertyName("color")] + public string? Color { get; set; } + + [JsonPropertyName("dropbox")] + public KDriveApiDropbox? Dropbox { get; set; } + + [JsonPropertyName("external_import")] + public KDriveApiExternalImport? ExternalImport { get; set; } + + [JsonPropertyName("rewind")] + public KDriveApiRewindV3? Rewind { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// Activities information about the Directory V3 + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileSystemItemActivity + { + /// + /// Timestamp of the last user access of the Directory V3 + /// + [JsonPropertyName("last_accessed_at")] + public long? LastAccessedAt { get; set; } + + } + + /// + /// Directory rights + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileSystemItemCapabilities + { + /// + /// Right to set file as favorite + /// + [JsonPropertyName("can_use_favorite")] + public bool? CanUseFavorite { get; set; } + + /// + /// Right to share file by link (share_link) + /// + [JsonPropertyName("can_become_sharelink")] + public bool? CanBecomeSharelink { get; set; } + + /// + /// Right to use and give team access + /// + [JsonPropertyName("can_use_team")] + public bool? CanUseTeam { get; set; } + + /// + /// Right to see Directory V3 information + /// + [JsonPropertyName("can_show")] + public bool? CanShow { get; set; } + + /// + /// Right to read Directory V3 content + /// + [JsonPropertyName("can_read")] + public bool? CanRead { get; set; } + + /// + /// Right to write Directory V3 + /// + [JsonPropertyName("can_write")] + public bool? CanWrite { get; set; } + + /// + /// Right to share Directory V3 or manage access to Directory V3 + /// + [JsonPropertyName("can_share")] + public bool? CanShare { get; set; } + + /// + /// Right to leave shared Directory V3 + /// + [JsonPropertyName("can_leave")] + public bool? CanLeave { get; set; } + + /// + /// Right to delete Directory V3 + /// + [JsonPropertyName("can_delete")] + public bool? CanDelete { get; set; } + + /// + /// Right to rename Directory V3 + /// + [JsonPropertyName("can_rename")] + public bool? CanRename { get; set; } + + /// + /// Right to move Directory V3 + /// + [JsonPropertyName("can_move")] + public bool? CanMove { get; set; } + + /// + /// Right to add new child directory + /// + [JsonPropertyName("can_create_directory")] + public bool? CanCreateDirectory { get; set; } + + /// + /// Right to add new child file + /// + [JsonPropertyName("can_create_file")] + public bool? CanCreateFile { get; set; } + + /// + /// Right to upload a child file + /// + [JsonPropertyName("can_upload")] + public bool? CanUpload { get; set; } + + /// + /// right to move directory + /// + [JsonPropertyName("can_move_into")] + public bool? CanMoveInto { get; set; } + + /// + /// Right to use convert directory into collaborative directory + /// + [JsonPropertyName("can_become_dropbox")] + public bool? CanBecomeDropbox { get; set; } + + /// + /// Right to change or add color to the directory + /// + [JsonPropertyName("colorable")] + public bool? Colorable { get; set; } + + } + + /// + /// When Directory V3 is locked, locked information + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileSystemItemLock + { + /// + /// When Directory V3 is locked, locked timestamp + /// + [JsonPropertyName("locked_at")] + public long? LockedAt { get; set; } + + /// + /// When Directory V3 is locked, automatic lock release timestamp + /// + [JsonPropertyName("unlocked_at")] + public long? UnlockedAt { get; set; } + + /// + /// List of applications. 365 : The 365 application. external_import : The external_import application. internal_copy : The internal_copy application. internal_import : The internal_import application. onlyoffice : The onlyoffice application. webdav : The webdav application. + /// + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// When Directory V3 is locked, locked token + /// + [JsonPropertyName("token")] + public string? Token { get; set; } + + } + + /// + /// Information when file has multi-version + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileSystemItemVersion + { + /// + /// File has multi-version + /// + [JsonPropertyName("is_multiple")] + public bool? IsMultiple { get; set; } + + /// + /// Get number of version + /// + [JsonPropertyName("number")] + public long? Number { get; set; } + + /// + /// Size of the file with all version (byte unit) + /// + [JsonPropertyName("total_size")] + public long? TotalSize { get; set; } + + /// + /// True if the current version of this file should be kept forever, otherwise false or empty + /// + [JsonPropertyName("keep_forever")] + public bool? KeepForever { get; set; } + + } + + /// + /// The available ways to convert the file + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileSystemItemConversionCapabilities + { + /// + /// Whether the file may be converted upon download + /// + [JsonPropertyName("when_downloading")] + public bool? WhenDownloading { get; set; } + + /// + /// Available extensions to which the file may be converted upon download, if possible + /// + [JsonPropertyName("download_extensions")] + public List? DownloadExtensions { get; set; } + + /// + /// Whether the file may be converted for live edition with OnlyOffice + /// + [JsonPropertyName("when_onlyoffice_opening")] + public bool? WhenOnlyofficeOpening { get; set; } + + /// + /// Available extension to which the file may be converted by OnlyOffice, if possible + /// + [JsonPropertyName("onlyoffice_extension")] + public string? OnlyofficeExtension { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiFileV3.cs b/DriveClient/Models/Generated/KDriveApiFileV3.cs new file mode 100644 index 0000000..b158689 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiFileV3.cs @@ -0,0 +1,433 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// File V3 + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileV3 + { + /// + /// Unique identifier of the resource `File V3` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// File name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Specific sortable name + /// + [JsonPropertyName("sorted_name")] + public string? SortedName { get; set; } + + /// + /// Full path of the File V3 + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// Type of returned element either a dir (Directory) or file (File) + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// Current state of File V3. The state can be null meaning that the File V3 has no specific state. locked : File V3 is currently locked. No action can be made except unlocking by the application which locked the File (such as office, webdav or external import). ok : File V3 is avai… + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Visibility of File V3, empty string if no specific visibility. Add additional information about File V3 to show different icons or more. : Empty visibility mean no special visibility. is_in_private_space : Is a File V3 inside the private directory of the user. is_in_shared_space… + /// + [JsonPropertyName("visibility")] + public string? Visibility { get; set; } + + /// + /// Drive identifier + /// + [JsonPropertyName("drive_id")] + public long? DriveId { get; set; } + + /// + /// Current path depth of File V3 + /// + [JsonPropertyName("depth")] + public long? Depth { get; set; } + + /// + /// The identifier of the user who first uploaded the File V3 + /// + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + /// + /// File V3 creation timestamp (in seconds), if available in its metadata or specified on upload + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// The timestamp (in seconds) at which the File V3 has been uploaded for the first time + /// + [JsonPropertyName("added_at")] + public long? AddedAt { get; set; } + + /// + /// File V3 creation timestamp (in seconds), if available in its metadata or specified on upload + /// + [JsonPropertyName("last_modified_at")] + public long? LastModifiedAt { get; set; } + + /// + /// Id of the user who last modified the File V3 + /// + [JsonPropertyName("last_modified_by")] + public long? LastModifiedBy { get; set; } + + /// + /// The last time the content of the File V3 was revised + /// + [JsonPropertyName("revised_at")] + public long? RevisedAt { get; set; } + + /// + /// The last time the File V3 was updated + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + /// + /// Parent directory identifier + /// + [JsonPropertyName("parent_id")] + public long? ParentId { get; set; } + + /// + /// Timestamp of deleted resource File V3, only visible when the File V3 is trashed + /// + [JsonPropertyName("deleted_at")] + public long? DeletedAt { get; set; } + + /// + /// User identifier of deleted resource File V3, only visible when the File V3 is trashed + /// + [JsonPropertyName("deleted_by")] + public long? DeletedBy { get; set; } + + /// + /// Root Directory identifier, only visible for shared user + /// + [JsonPropertyName("shared_root_id")] + public long? SharedRootId { get; set; } + + /// + /// Get all parents directories + /// + [JsonPropertyName("parents")] + public List? Parents { get; set; } + + /// + /// Array of users identifiers that has access to the File V3 + /// + [JsonPropertyName("users")] + public List? Users { get; set; } + + /// + /// Array of teams identifiers that has access to the File V3 + /// + [JsonPropertyName("teams")] + public List? Teams { get; set; } + + /// + /// Is File V3 pinned as favorite + /// + [JsonPropertyName("is_favorite")] + public bool? IsFavorite { get; set; } + + /// + /// Activities information about the File V3 + /// + [JsonPropertyName("activity")] + public KDriveApiFileV3Activity? Activity { get; set; } + + [JsonPropertyName("sharelink")] + public KDriveApiShareLink? ShareLink { get; set; } + + /// + /// Capabilities of File V3 + /// + [JsonPropertyName("capabilities")] + public KDriveApiFileV3Capabilities? Capabilities { get; set; } + + /// + /// When File V3 is locked, locked information + /// + [JsonPropertyName("lock")] + public KDriveApiFileV3Lock? Lock { get; set; } + + /// + /// File categories + /// + [JsonPropertyName("categories")] + public List? Categories { get; set; } + + /// + /// ETag of the file + /// + [JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Size of File V3 The unit of size is defined in Bytes + /// + [JsonPropertyName("size")] + public long? Size { get; set; } + + /// + /// Mime-type of file + /// + [JsonPropertyName("mime_type")] + public string? MimeType { get; set; } + + /// + /// Generic file types, matching a known set of extensions and/or mime types. archive : Archive file. audio : Audio only file. code : Text file recognized as code. diagram : Diagram file. dir : Directory. email : Bundled email file. font : Text file recognized as font. form : Form f… + /// + [JsonPropertyName("extension_type")] + public string? ExtensionType { get; set; } + + /// + /// Symlink target path if the file was uploaded as a symlink + /// + [JsonPropertyName("symbolic_link")] + public string? SymbolicLink { get; set; } + + /// + /// Current state of virus scan for File V3. cannot_be_scanned : This File V3 cannot be scanned. Possibly because the File V3 is too large. clean : This File V3 has been successfully scanned for known viruses. error : An error occurred while scanning the File V3. infected : This Fil… + /// + [JsonPropertyName("scan_status")] + public string? ScanStatus { get; set; } + + /// + /// List of applications. 365 : The 365 application. drawio : The drawio application. kmail : The kmail application. onlyoffice : The onlyoffice application. thumbnail : Thumbnail is preview and thumbnail. + /// + [JsonPropertyName("supported_by")] + public JsonElement? SupportedBy { get; set; } + + /// + /// Information when file has multi-version + /// + [JsonPropertyName("version")] + public KDriveApiFileV3Version? Version { get; set; } + + /// + /// The available ways to convert the file + /// + [JsonPropertyName("conversion_capabilities")] + public KDriveApiFileV3ConversionCapabilities? ConversionCapabilities { get; set; } + + /// + /// Hash of the file content + /// + [JsonPropertyName("hash")] + public string? Hash { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// Activities information about the File V3 + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileV3Activity + { + /// + /// Timestamp of the last user access of the File V3 + /// + [JsonPropertyName("last_accessed_at")] + public long? LastAccessedAt { get; set; } + + } + + /// + /// Capabilities of File V3 + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileV3Capabilities + { + /// + /// Right to set file as favorite + /// + [JsonPropertyName("can_use_favorite")] + public bool? CanUseFavorite { get; set; } + + /// + /// Right to share file by link (share_link) + /// + [JsonPropertyName("can_become_sharelink")] + public bool? CanBecomeSharelink { get; set; } + + /// + /// Right to use and give team access + /// + [JsonPropertyName("can_use_team")] + public bool? CanUseTeam { get; set; } + + /// + /// Right to see File V3 information + /// + [JsonPropertyName("can_show")] + public bool? CanShow { get; set; } + + /// + /// Right to read File V3 content + /// + [JsonPropertyName("can_read")] + public bool? CanRead { get; set; } + + /// + /// Right to write File V3 + /// + [JsonPropertyName("can_write")] + public bool? CanWrite { get; set; } + + /// + /// Right to share File V3 or manage access to File V3 + /// + [JsonPropertyName("can_share")] + public bool? CanShare { get; set; } + + /// + /// Right to leave shared File V3 + /// + [JsonPropertyName("can_leave")] + public bool? CanLeave { get; set; } + + /// + /// Right to delete File V3 + /// + [JsonPropertyName("can_delete")] + public bool? CanDelete { get; set; } + + /// + /// Right to rename File V3 + /// + [JsonPropertyName("can_rename")] + public bool? CanRename { get; set; } + + /// + /// Right to move File V3 + /// + [JsonPropertyName("can_move")] + public bool? CanMove { get; set; } + + } + + /// + /// When File V3 is locked, locked information + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileV3Lock + { + /// + /// When File V3 is locked, locked timestamp + /// + [JsonPropertyName("locked_at")] + public long? LockedAt { get; set; } + + /// + /// When File V3 is locked, automatic lock release timestamp + /// + [JsonPropertyName("unlocked_at")] + public long? UnlockedAt { get; set; } + + /// + /// List of applications. 365 : The 365 application. external_import : The external_import application. internal_copy : The internal_copy application. internal_import : The internal_import application. onlyoffice : The onlyoffice application. webdav : The webdav application. + /// + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// When File V3 is locked, locked token + /// + [JsonPropertyName("token")] + public string? Token { get; set; } + + } + + /// + /// Information when file has multi-version + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileV3Version + { + /// + /// File has multi-version + /// + [JsonPropertyName("is_multiple")] + public bool? IsMultiple { get; set; } + + /// + /// Get number of version + /// + [JsonPropertyName("number")] + public long? Number { get; set; } + + /// + /// Size of the file with all version (byte unit) + /// + [JsonPropertyName("total_size")] + public long? TotalSize { get; set; } + + /// + /// True if the current version of this file should be kept forever, otherwise false or empty + /// + [JsonPropertyName("keep_forever")] + public bool? KeepForever { get; set; } + + } + + /// + /// The available ways to convert the file + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileV3ConversionCapabilities + { + /// + /// Whether the file may be converted upon download + /// + [JsonPropertyName("when_downloading")] + public bool? WhenDownloading { get; set; } + + /// + /// Available extensions to which the file may be converted upon download, if possible + /// + [JsonPropertyName("download_extensions")] + public List? DownloadExtensions { get; set; } + + /// + /// Whether the file may be converted for live edition with OnlyOffice + /// + [JsonPropertyName("when_onlyoffice_opening")] + public bool? WhenOnlyofficeOpening { get; set; } + + /// + /// Available extension to which the file may be converted by OnlyOffice, if possible + /// + [JsonPropertyName("onlyoffice_extension")] + public string? OnlyofficeExtension { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiFileVersion.cs b/DriveClient/Models/Generated/KDriveApiFileVersion.cs new file mode 100644 index 0000000..58eb442 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiFileVersion.cs @@ -0,0 +1,69 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// File Version + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileVersion + { + /// + /// Unique identifier of the resource `File Version` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Keep the resource `File Version` forever, otherwise will be delete in 120 days + /// + [JsonPropertyName("keep_forever")] + public bool? KeepForever { get; set; } + + /// + /// Mime type of the resource `File Version` + /// + [JsonPropertyName("mime_type")] + public string? MimeType { get; set; } + + /// + /// Generic file types, matching a known set of extensions and/or mime types. archive : Archive file. audio : Audio only file. code : Text file recognized as code. diagram : Diagram file. dir : Directory. email : Bundled email file. font : Text file recognized as font. form : Form f… + /// + [JsonPropertyName("extension_type")] + public string? ExtensionType { get; set; } + + /// + /// Size of the resource `File Version` + /// + [JsonPropertyName("size")] + public long? Size { get; set; } + + [JsonPropertyName("updated_by")] + public KDriveApiAppUser? UpdatedBy { get; set; } + + /// + /// Timestamp `File Version` was created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Timestamp `File Version` was updated at + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + /// + /// The last modified date of the file version, null if unknown + /// + [JsonPropertyName("last_modified_at")] + public long? LastModifiedAt { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiFileVersionV2.cs b/DriveClient/Models/Generated/KDriveApiFileVersionV2.cs new file mode 100644 index 0000000..64f8bba --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiFileVersionV2.cs @@ -0,0 +1,75 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// File Version V2 + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFileVersionV2 + { + /// + /// Unique identifier of the resource `File Version V2` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Keep the resource `File Version V2` forever, otherwise will be delete in 120 days + /// + [JsonPropertyName("keep_forever")] + public bool? KeepForever { get; set; } + + /// + /// Mime type of the resource `File Version V2` + /// + [JsonPropertyName("mime_type")] + public string? MimeType { get; set; } + + /// + /// Generic file types, matching a known set of extensions and/or mime types. archive : Archive file. audio : Audio only file. code : Text file recognized as code. diagram : Diagram file. dir : Directory. email : Bundled email file. font : Text file recognized as font. form : Form f… + /// + [JsonPropertyName("converted_type")] + public string? ConvertedType { get; set; } + + /// + /// Name of the resource `File Version V2` + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Size of the resource `File Version V2` + /// + [JsonPropertyName("size")] + public long? Size { get; set; } + + [JsonPropertyName("updated_by")] + public KDriveApiAppUser? UpdatedBy { get; set; } + + /// + /// Timestamp `File Version V2` was created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Timestamp `File Version V2` was updated at + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + /// + /// The last modified date of the file version, null if unknown + /// + [JsonPropertyName("last_modified_at")] + public long? LastModifiedAt { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiFilecontenthash.cs b/DriveClient/Models/Generated/KDriveApiFilecontenthash.cs new file mode 100644 index 0000000..0f6e7c3 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiFilecontenthash.cs @@ -0,0 +1,24 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// File content hash + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiFilecontenthash + { + /// + /// The hash of file content + /// + [JsonPropertyName("hash")] + public string? Hash { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiKSuite.cs b/DriveClient/Models/Generated/KDriveApiKSuite.cs new file mode 100644 index 0000000..61a0c16 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiKSuite.cs @@ -0,0 +1,42 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// KSuite + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiKSuite + { + /// + /// Id of the kSuite + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Name of the kSuite + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Id of the type of kSuite + /// + [JsonPropertyName("pack_id")] + public long? PackId { get; set; } + + /// + /// Name of the type of kSuite + /// + [JsonPropertyName("pack")] + public string? Pack { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiMaintenanceType.cs b/DriveClient/Models/Generated/KDriveApiMaintenanceType.cs new file mode 100644 index 0000000..ef37192 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiMaintenanceType.cs @@ -0,0 +1,36 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Maintenance Type + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiMaintenanceType + { + /// + /// Name of active Maintenance Type + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Active Maintenance Type + /// + [JsonPropertyName("code")] + public string? Code { get; set; } + + /// + /// Short explanation of active Maintenance Type + /// + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiNavigatorResponse.cs b/DriveClient/Models/Generated/KDriveApiNavigatorResponse.cs new file mode 100644 index 0000000..0c4794f --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiNavigatorResponse.cs @@ -0,0 +1,36 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Generic success response schema for Navigator + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiNavigatorResponse + { + /// + /// Cursor pagination uses a cursor to track the current position in the dataset. This cursor should be passed back in the subsequent API request in order to retrieve the next set of results or page of the list. + /// + [JsonPropertyName("cursor")] + public string? Cursor { get; set; } + + /// + /// The has_more boolean flag indicates whether additional items are available beyond the current page of results. + /// + [JsonPropertyName("has_more")] + public bool? HasMore { get; set; } + + /// + /// The timestamp, in seconds, indicating when the dataset was generated. + /// + [JsonPropertyName("response_at")] + public long? ResponseAt { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiPagination.cs b/DriveClient/Models/Generated/KDriveApiPagination.cs new file mode 100644 index 0000000..cd24168 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiPagination.cs @@ -0,0 +1,42 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// KDriveApiPagination + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiPagination + { + /// + /// Total number of items Added when using query parameter `page` + /// + [JsonPropertyName("total")] + public long? Total { get; set; } + + /// + /// Number of the current page Added when using query parameter `page` + /// + [JsonPropertyName("page")] + public long? Page { get; set; } + + /// + /// Total number of pages Added when using query parameter `page` + /// + [JsonPropertyName("pages")] + public long? Pages { get; set; } + + /// + /// Number of items per page Added when using query parameter `page` + /// + [JsonPropertyName("items_per_page")] + public long? ItemsPerPage { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiPricingPlan.cs b/DriveClient/Models/Generated/KDriveApiPricingPlan.cs new file mode 100644 index 0000000..6c2457f --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiPricingPlan.cs @@ -0,0 +1,286 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Pricing Plan + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiPricingPlan + { + /// + /// Unique identifier of the resource `Pricing Plan` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Name of the resource `Pricing Plan` + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Display name + /// + [JsonPropertyName("display_name")] + public string? DisplayName { get; set; } + + /// + /// If the pack is free + /// + [JsonPropertyName("is_free")] + public bool? IsFree { get; set; } + + /// + /// Get the users and storage limits of the Pricing Plan + /// + [JsonPropertyName("limits")] + public KDriveApiPricingPlanLimits? Limits { get; set; } + + /// + /// Price of the Pricing Plan, contains basic plan and additional storages and users prices by currency + /// + [JsonPropertyName("prices")] + public List? Prices { get; set; } + + /// + /// Locked/Unlocked features of the Pricing Plan + /// + [JsonPropertyName("capabilities")] + public KDriveApiPricingPlanCapabilities? Capabilities { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// Get the users and storage limits of the Pricing Plan + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiPricingPlanLimits + { + /// + /// Get users number limit of the Pricing Plan + /// + [JsonPropertyName("users")] + public KDriveApiPricingPlanLimitsUsers? Users { get; set; } + + /// + /// Get the drive trash options + /// + [JsonPropertyName("trash")] + public KDriveApiPricingPlanLimitsTrash? Trash { get; set; } + + /// + /// Get the limits of the pricing plan + /// + [JsonPropertyName("storage")] + public KDriveApiPricingPlanLimitsStorage? Storage { get; set; } + + } + + /// + /// Get users number limit of the Pricing Plan + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiPricingPlanLimitsUsers + { + /// + /// Included/Allowed number of user + /// + [JsonPropertyName("base")] + public long? Base { get; set; } + + /// + /// Minimum number of additional user + /// + [JsonPropertyName("min")] + public long? Min { get; set; } + + /// + /// Maximum number of additional user + /// + [JsonPropertyName("max")] + public long? Max { get; set; } + + } + + /// + /// Get the drive trash options + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiPricingPlanLimitsTrash + { + /// + /// Available options for setting trash retention. one_month : 30 days. one_year : A year. six_months : 180 days. three_months : 90 days. two_months : 60 days. + /// + [JsonPropertyName("retention_options")] + public List? RetentionOptions { get; set; } + + } + + /// + /// Get the limits of the pricing plan + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiPricingPlanLimitsStorage + { + /// + /// Included/Allowed storage (in gigabyte) + /// + [JsonPropertyName("giga")] + public long? Giga { get; set; } + + /// + /// Minimum number of additional storage (in gigabyte) + /// + [JsonPropertyName("min")] + public long? Min { get; set; } + + /// + /// Maximum number of additional storage (in gigabyte) + /// + [JsonPropertyName("max")] + public long? Max { get; set; } + + } + + /// + /// Locked/Unlocked features of the Pricing Plan + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiPricingPlanCapabilities + { + /// + /// Vault directory feature + /// + [JsonPropertyName("use_vault")] + public bool? UseVault { get; set; } + + /// + /// Can use additional manage right + /// + [JsonPropertyName("use_manage_right")] + public bool? UseManageRight { get; set; } + + /// + /// Dropboxes feature + /// + [JsonPropertyName("use_dropbox")] + public bool? UseDropbox { get; set; } + + /// + /// Can access/use restoration feature + /// + [JsonPropertyName("can_rewind")] + public bool? CanRewind { get; set; } + + /// + /// Can set a custom color on a folder + /// + [JsonPropertyName("use_folder_custom_color")] + public bool? UseFolderCustomColor { get; set; } + + /// + /// Can access the managing dashboard + /// + [JsonPropertyName("can_access_dashboard")] + public bool? CanAccessDashboard { get; set; } + + /// + /// Public link can be protected by password + /// + [JsonPropertyName("can_set_sharelink_password")] + public bool? CanSetSharelinkPassword { get; set; } + + /// + /// Users with Infomaniak account can ask to join drive via public links + /// + [JsonPropertyName("can_join_sharelink")] + public bool? CanJoinSharelink { get; set; } + + /// + /// Public link can expire + /// + [JsonPropertyName("can_set_sharelink_expiration")] + public bool? CanSetSharelinkExpiration { get; set; } + + /// + /// Public link can have custom theme + /// + [JsonPropertyName("can_set_sharelink_custom_url")] + public bool? CanSetSharelinkCustomUrl { get; set; } + + /// + /// Can activate advanced search functions in file contents + /// + [JsonPropertyName("can_use_content_search")] + public bool? CanUseContentSearch { get; set; } + + /// + /// Can access activity reports + /// + [JsonPropertyName("can_use_activity_reports")] + public bool? CanUseActivityReports { get; set; } + + /// + /// Can sign documents + /// + [JsonPropertyName("can_use_signatures")] + public bool? CanUseSignatures { get; set; } + + /// + /// Can access statistics + /// + [JsonPropertyName("can_use_statistics")] + public bool? CanUseStatistics { get; set; } + + /// + /// Can edit PDFs + /// + [JsonPropertyName("can_edit_pdf")] + public bool? CanEditPdf { get; set; } + + /// + /// Can access to the Microsoft 365 editor + /// + [JsonPropertyName("can_use_office365")] + public bool? CanUseOffice365 { get; set; } + + /// + /// Can change office editor or office related settings + /// + [JsonPropertyName("can_set_office")] + public bool? CanSetOffice { get; set; } + + /// + /// Add the start guide PDF to the private folder for new users + /// + [JsonPropertyName("start_guide_pdf")] + public bool? StartGuidePdf { get; set; } + + /// + /// Can ask AI assistant questions about the content of an open document + /// + [JsonPropertyName("can_use_rag")] + public bool? CanUseRag { get; set; } + + /// + /// Webdav protocol service + /// + [JsonPropertyName("can_use_webdav")] + public bool? CanUseWebdav { get; set; } + + /// + /// Can set trash retention duration + /// + [JsonPropertyName("can_set_trash_duration")] + public bool? CanSetTrashDuration { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiPublicImage.cs b/DriveClient/Models/Generated/KDriveApiPublicImage.cs new file mode 100644 index 0000000..bf4dc54 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiPublicImage.cs @@ -0,0 +1,30 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// PublicImage + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiPublicImage + { + /// + /// Unique identifier of the resource `PublicImage` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// public_url + /// + [JsonPropertyName("public_url")] + public string? PublicUrl { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiResponse.cs b/DriveClient/Models/Generated/KDriveApiResponse.cs new file mode 100644 index 0000000..0918d99 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiResponse.cs @@ -0,0 +1,24 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Generic response schema to be reused + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiResponse + { + /// + /// Result of the HTTP request + /// + [JsonPropertyName("result")] + public string? Result { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiRewindSummaryFileCounter.cs b/DriveClient/Models/Generated/KDriveApiRewindSummaryFileCounter.cs new file mode 100644 index 0000000..aac9aa8 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiRewindSummaryFileCounter.cs @@ -0,0 +1,42 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Rewind Summary File Counter + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiRewindSummaryFileCounter + { + /// + /// User id + /// + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + + /// + /// Total of actions executed + /// + [JsonPropertyName("executed")] + public long? Executed { get; set; } + + /// + /// Total of actions archived + /// + [JsonPropertyName("archived")] + public long? Archived { get; set; } + + /// + /// Total of actions conflicted + /// + [JsonPropertyName("conflicted")] + public long? Conflicted { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiRewindV3.cs b/DriveClient/Models/Generated/KDriveApiRewindV3.cs new file mode 100644 index 0000000..e5ba7f4 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiRewindV3.cs @@ -0,0 +1,511 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Rewind V3 + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiRewindV3 + { + /// + /// Rewind identifier + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Rewind status. canceled : Rewind was canceled by the user and deleted. done : Rewind completed successfully. drive_not_ready : Rewind cannot start because the drive was not ready (uploads or actions in progress). expired : Rewind has expired and deleted. failed : Rewind complete… + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Rewind type. directory : Rewind only a directory. drive : Rewind all the drive. user : Rewind a user's private folder. + /// + [JsonPropertyName("mode")] + public string? Mode { get; set; } + + /// + /// Rewind archive mode, all created files between now and the rewind date will be set to trash or to an archive depending on the mode selected. all : Keep in an archive folder the current or trashed files. current : Keep in an archive folder the current files. none : Don't build an… + /// + [JsonPropertyName("archiving")] + public string? Archiving { get; set; } + + /// + /// The targeted directory of the rewind Filled only in directory and user mode + /// + [JsonPropertyName("directory_id")] + public long? DirectoryId { get; set; } + + [JsonPropertyName("directory")] + public KDriveApiDirectoryV3? Directory { get; set; } + + /// + /// The name of the directory selected when the directory mode is selected + /// + [JsonPropertyName("directory_name")] + public string? DirectoryName { get; set; } + + /// + /// The targeted user of the rewind Filled only in user mode + /// + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + + /// + /// Rewind at + /// + [JsonPropertyName("rewind_at")] + public long? RewindAt { get; set; } + + /// + /// created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// when the rewind is executed the finished process time is save here + /// + [JsonPropertyName("finished_at")] + public long? FinishedAt { get; set; } + + /// + /// Date of the rewind approval + /// + [JsonPropertyName("expires_at")] + public long? ExpiresAt { get; set; } + + /// + /// created by the user + /// + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + /// + /// Rewind approved by the user + /// + [JsonPropertyName("is_approved")] + public bool? IsApproved { get; set; } + + /// + /// Date of the rewind approval + /// + [JsonPropertyName("approval_at")] + public long? ApprovalAt { get; set; } + + /// + /// The name of the directory choose during approval step + /// + [JsonPropertyName("rewind_name")] + public string? RewindName { get; set; } + + /// + /// Sanitizer resume, returned only when the rewind has done the sanitizing process + /// + [JsonPropertyName("sanitizer")] + public KDriveApiRewindV3Sanitizer? Sanitizer { get; set; } + + /// + /// Rewind resume, returned only when the rewind is finished + /// + [JsonPropertyName("summary")] + public KDriveApiRewindV3Summary? Summary { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// Sanitizer resume, returned only when the rewind has done the sanitizing process + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiRewindV3Sanitizer + { + /// + /// sanitized + /// + [JsonPropertyName("sanitized")] + public long? Sanitized { get; set; } + + /// + /// total + /// + [JsonPropertyName("total")] + public KDriveApiRewindV3SanitizerTotal? Total { get; set; } + + /// + /// team + /// + [JsonPropertyName("team")] + public KDriveApiRewindV3SanitizerTeam? Team { get; set; } + + /// + /// me + /// + [JsonPropertyName("me")] + public KDriveApiRewindV3SanitizerMe? Me { get; set; } + + /// + /// others + /// + [JsonPropertyName("others")] + public string? Others { get; set; } + + } + + /// + /// total + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiRewindV3SanitizerTotal + { + /// + /// to_execute + /// + [JsonPropertyName("to_execute")] + public long? ToExecute { get; set; } + + /// + /// files_found + /// + [JsonPropertyName("files_found")] + public long? FilesFound { get; set; } + + /// + /// to_move + /// + [JsonPropertyName("to_move")] + public long? ToMove { get; set; } + + /// + /// to_rename + /// + [JsonPropertyName("to_rename")] + public long? ToRename { get; set; } + + /// + /// to_update + /// + [JsonPropertyName("to_update")] + public long? ToUpdate { get; set; } + + /// + /// to_restore + /// + [JsonPropertyName("to_restore")] + public long? ToRestore { get; set; } + + /// + /// to_trash + /// + [JsonPropertyName("to_trash")] + public long? ToTrash { get; set; } + + /// + /// to_archive + /// + [JsonPropertyName("to_archive")] + public long? ToArchive { get; set; } + + /// + /// not_handled_versions + /// + [JsonPropertyName("not_handled_versions")] + public long? NotHandledVersions { get; set; } + + /// + /// not_handled_files + /// + [JsonPropertyName("not_handled_files")] + public long? NotHandledFiles { get; set; } + + } + + /// + /// team + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiRewindV3SanitizerTeam + { + /// + /// to_execute + /// + [JsonPropertyName("to_execute")] + public long? ToExecute { get; set; } + + /// + /// files_found + /// + [JsonPropertyName("files_found")] + public long? FilesFound { get; set; } + + /// + /// to_move + /// + [JsonPropertyName("to_move")] + public long? ToMove { get; set; } + + /// + /// to_rename + /// + [JsonPropertyName("to_rename")] + public long? ToRename { get; set; } + + /// + /// to_update + /// + [JsonPropertyName("to_update")] + public long? ToUpdate { get; set; } + + /// + /// to_restore + /// + [JsonPropertyName("to_restore")] + public long? ToRestore { get; set; } + + /// + /// to_trash + /// + [JsonPropertyName("to_trash")] + public long? ToTrash { get; set; } + + /// + /// to_archive + /// + [JsonPropertyName("to_archive")] + public long? ToArchive { get; set; } + + /// + /// not_handled_versions + /// + [JsonPropertyName("not_handled_versions")] + public long? NotHandledVersions { get; set; } + + /// + /// not_handled_files + /// + [JsonPropertyName("not_handled_files")] + public long? NotHandledFiles { get; set; } + + } + + /// + /// me + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiRewindV3SanitizerMe + { + /// + /// to_execute + /// + [JsonPropertyName("to_execute")] + public long? ToExecute { get; set; } + + /// + /// files_found + /// + [JsonPropertyName("files_found")] + public long? FilesFound { get; set; } + + /// + /// to_move + /// + [JsonPropertyName("to_move")] + public long? ToMove { get; set; } + + /// + /// to_rename + /// + [JsonPropertyName("to_rename")] + public long? ToRename { get; set; } + + /// + /// to_update + /// + [JsonPropertyName("to_update")] + public long? ToUpdate { get; set; } + + /// + /// to_restore + /// + [JsonPropertyName("to_restore")] + public long? ToRestore { get; set; } + + /// + /// to_trash + /// + [JsonPropertyName("to_trash")] + public long? ToTrash { get; set; } + + /// + /// to_archive + /// + [JsonPropertyName("to_archive")] + public long? ToArchive { get; set; } + + /// + /// not_handled_versions + /// + [JsonPropertyName("not_handled_versions")] + public long? NotHandledVersions { get; set; } + + /// + /// not_handled_files + /// + [JsonPropertyName("not_handled_files")] + public long? NotHandledFiles { get; set; } + + } + + /// + /// Rewind resume, returned only when the rewind is finished + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiRewindV3Summary + { + /// + /// total + /// + [JsonPropertyName("total")] + public KDriveApiRewindV3SummaryTotal? Total { get; set; } + + /// + /// team + /// + [JsonPropertyName("team")] + public KDriveApiRewindV3SummaryTeam? Team { get; set; } + + /// + /// me + /// + [JsonPropertyName("me")] + public KDriveApiRewindV3SummaryMe? Me { get; set; } + + /// + /// others + /// + [JsonPropertyName("others")] + public List? Others { get; set; } + + } + + /// + /// total + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiRewindV3SummaryTotal + { + /// + /// executed + /// + [JsonPropertyName("executed")] + public long? Executed { get; set; } + + /// + /// archived + /// + [JsonPropertyName("archived")] + public long? Archived { get; set; } + + /// + /// conflicted + /// + [JsonPropertyName("conflicted")] + public long? Conflicted { get; set; } + + } + + /// + /// team + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiRewindV3SummaryTeam + { + /// + /// executed + /// + [JsonPropertyName("executed")] + public long? Executed { get; set; } + + /// + /// archived + /// + [JsonPropertyName("archived")] + public long? Archived { get; set; } + + /// + /// conflicted + /// + [JsonPropertyName("conflicted")] + public long? Conflicted { get; set; } + + /// + /// directory_id + /// + [JsonPropertyName("directory_id")] + public long? DirectoryId { get; set; } + + /// + /// directory_archive_id + /// + [JsonPropertyName("directory_archive_id")] + public long? DirectoryArchiveId { get; set; } + + /// + /// directory_conflict_id + /// + [JsonPropertyName("directory_conflict_id")] + public long? DirectoryConflictId { get; set; } + + } + + /// + /// me + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiRewindV3SummaryMe + { + /// + /// executed + /// + [JsonPropertyName("executed")] + public long? Executed { get; set; } + + /// + /// archived + /// + [JsonPropertyName("archived")] + public long? Archived { get; set; } + + /// + /// conflicted + /// + [JsonPropertyName("conflicted")] + public long? Conflicted { get; set; } + + /// + /// directory_id + /// + [JsonPropertyName("directory_id")] + public long? DirectoryId { get; set; } + + /// + /// directory_archive_id + /// + [JsonPropertyName("directory_archive_id")] + public long? DirectoryArchiveId { get; set; } + + /// + /// directory_conflict_id + /// + [JsonPropertyName("directory_conflict_id")] + public long? DirectoryConflictId { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiRight.cs b/DriveClient/Models/Generated/KDriveApiRight.cs new file mode 100644 index 0000000..9a18232 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiRight.cs @@ -0,0 +1,42 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Right + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiRight + { + /// + /// technical + /// + [JsonPropertyName("technical")] + public bool? Technical { get; set; } + + /// + /// statistic + /// + [JsonPropertyName("statistic")] + public bool? Statistic { get; set; } + + /// + /// check + /// + [JsonPropertyName("check")] + public bool? Check { get; set; } + + /// + /// sale + /// + [JsonPropertyName("sale")] + public bool? Sale { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiSanitizedActivity.cs b/DriveClient/Models/Generated/KDriveApiSanitizedActivity.cs new file mode 100644 index 0000000..ede270b --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiSanitizedActivity.cs @@ -0,0 +1,48 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Sanitized Activity + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiSanitizedActivity + { + /// + /// Path of the activity + /// + [JsonPropertyName("target")] + public JsonElement? Target { get; set; } + + /// + /// Target date of the activity + /// + [JsonPropertyName("target_at")] + public JsonElement? TargetAt { get; set; } + + /// + /// Action to do in rewind situation. archive : File needs to be archived in a specific directory. archive_in_trash : File needs to be archived in trash root. exclude : File is excluded. No actions will be performed. file_deleted : File does not exist. move : File needs to be moved.… + /// + [JsonPropertyName("action")] + public string? Action { get; set; } + + /// + /// State one action in the rewind process. not_executed : Action was not executed yet. not_handled : Action cannot be rewound. on_conflict : Action lead to a conflict with another file/directory, this item was moved to a specific directory. on_error : Action lead to a fatal error, … + /// + [JsonPropertyName("state")] + public string? State { get; set; } + + /// + /// special_parent_id + /// + [JsonPropertyName("special_parent_id")] + public long? SpecialParentId { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiSanitizedFileAccessRequest.cs b/DriveClient/Models/Generated/KDriveApiSanitizedFileAccessRequest.cs new file mode 100644 index 0000000..cb06b4f --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiSanitizedFileAccessRequest.cs @@ -0,0 +1,72 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Sanitized File Access Request + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiSanitizedFileAccessRequest + { + /// + /// ID of the request + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Status of the request + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Message to provide to the validator + /// + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// + /// ID of the user requesting access to the file + /// + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + + /// + /// ID of the user whom validate the request + /// + [JsonPropertyName("validated_by")] + public long? ValidatedBy { get; set; } + + /// + /// ID of the file the user request access to + /// + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + + /// + /// Date of the request's validation + /// + [JsonPropertyName("validated_at")] + public long? ValidatedAt { get; set; } + + /// + /// Date of the request's creation + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Date of the request's expiration + /// + [JsonPropertyName("expired_at")] + public long? ExpiredAt { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiShareLink.cs b/DriveClient/Models/Generated/KDriveApiShareLink.cs new file mode 100644 index 0000000..8df7f00 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiShareLink.cs @@ -0,0 +1,122 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Share Link + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiShareLink + { + /// + /// Share link url + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// file_id + /// + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + + /// + /// Rights required to view the share link. inherit : Share link is accessible only by users of the drive. password : Share link is public but protected by a password. public : Share link is public, no restriction set. + /// + [JsonPropertyName("right")] + public string? Right { get; set; } + + /// + /// Until when the share link is valid + /// + [JsonPropertyName("valid_until")] + public long? ValidUntil { get; set; } + + /// + /// Unique identifier of the creator of the resource `Share Link` + /// + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + /// + /// Timestamp `Share Link` was created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Timestamp `Share Link` was updated at + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + /// + /// capabilities + /// + [JsonPropertyName("capabilities")] + public KDriveApiShareLinkCapabilities? Capabilities { get; set; } + + /// + /// If the share link is blocked + /// + [JsonPropertyName("access_blocked")] + public bool? AccessBlocked { get; set; } + + /// + /// Number of views of share link (last 180 days only) + /// + [JsonPropertyName("views")] + public long? Views { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// capabilities + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiShareLinkCapabilities + { + /// + /// Does share link allow editing + /// + [JsonPropertyName("can_edit")] + public bool? CanEdit { get; set; } + + /// + /// Does share link allow stats to be seen + /// + [JsonPropertyName("can_see_stats")] + public bool? CanSeeStats { get; set; } + + /// + /// Does share link allow info to be seen + /// + [JsonPropertyName("can_see_info")] + public bool? CanSeeInfo { get; set; } + + /// + /// Does share link allow download + /// + [JsonPropertyName("can_download")] + public bool? CanDownload { get; set; } + + /// + /// Does share link allow adding comments + /// + [JsonPropertyName("can_comment")] + public bool? CanComment { get; set; } + + /// + /// Does share link allow user to request access to folder + /// + [JsonPropertyName("can_request_access")] + public bool? CanRequestAccess { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiSharedDirectory.cs b/DriveClient/Models/Generated/KDriveApiSharedDirectory.cs new file mode 100644 index 0000000..94d4f6c --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiSharedDirectory.cs @@ -0,0 +1,378 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Shared Directory + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiSharedDirectory + { + /// + /// Unique identifier of the resource `Shared Directory` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// File name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Specific sortable name + /// + [JsonPropertyName("sorted_name")] + public string? SortedName { get; set; } + + /// + /// Full path of the Shared Directory + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// Type of returned element either a dir (Directory) or file (File) + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// Current state of Shared Directory. The state can be null meaning that the Shared Directory has no specific state. locked : Shared Directory is currently locked. No action can be made except unlocking by the application which locked the File (such as office, webdav or external im… + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Visibility of Shared Directory, empty string if no specific visibility. Add additional information about Shared Directory to show different icons or more. : Empty visibility mean no special visibility. is_in_private_space : Is a Shared Directory inside the private directory of t… + /// + [JsonPropertyName("visibility")] + public string? Visibility { get; set; } + + /// + /// Drive identifier + /// + [JsonPropertyName("drive_id")] + public long? DriveId { get; set; } + + /// + /// Current path depth of Shared Directory + /// + [JsonPropertyName("depth")] + public long? Depth { get; set; } + + /// + /// The identifier of the user who first uploaded the Shared Directory + /// + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + /// + /// Shared Directory creation timestamp (in seconds), if available in its metadata or specified on upload + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// The timestamp (in seconds) at which the Shared Directory has been uploaded for the first time + /// + [JsonPropertyName("added_at")] + public long? AddedAt { get; set; } + + /// + /// Shared Directory creation timestamp (in seconds), if available in its metadata or specified on upload + /// + [JsonPropertyName("last_modified_at")] + public long? LastModifiedAt { get; set; } + + /// + /// Id of the user who last modified the Shared Directory + /// + [JsonPropertyName("last_modified_by")] + public long? LastModifiedBy { get; set; } + + /// + /// The last time the content of the Shared Directory was revised + /// + [JsonPropertyName("revised_at")] + public long? RevisedAt { get; set; } + + /// + /// The last time the Shared Directory was updated + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + /// + /// Parent directory identifier + /// + [JsonPropertyName("parent_id")] + public long? ParentId { get; set; } + + /// + /// Timestamp of deleted resource Shared Directory, only visible when the Shared Directory is trashed + /// + [JsonPropertyName("deleted_at")] + public long? DeletedAt { get; set; } + + /// + /// User identifier of deleted resource Shared Directory, only visible when the Shared Directory is trashed + /// + [JsonPropertyName("deleted_by")] + public long? DeletedBy { get; set; } + + /// + /// Root Directory identifier, only visible for shared user + /// + [JsonPropertyName("shared_root_id")] + public long? SharedRootId { get; set; } + + /// + /// Get all parents directories + /// + [JsonPropertyName("parents")] + public List? Parents { get; set; } + + /// + /// Array of users identifiers that has access to the Shared Directory + /// + [JsonPropertyName("users")] + public List? Users { get; set; } + + /// + /// Array of teams identifiers that has access to the Shared Directory + /// + [JsonPropertyName("teams")] + public List? Teams { get; set; } + + /// + /// Is Shared Directory pinned as favorite + /// + [JsonPropertyName("is_favorite")] + public bool? IsFavorite { get; set; } + + /// + /// Activities information about the Shared Directory + /// + [JsonPropertyName("activity")] + public KDriveApiSharedDirectoryActivity? Activity { get; set; } + + [JsonPropertyName("sharelink")] + public KDriveApiShareLink? ShareLink { get; set; } + + /// + /// Directory rights + /// + [JsonPropertyName("capabilities")] + public KDriveApiSharedDirectoryCapabilities? Capabilities { get; set; } + + /// + /// When Shared Directory is locked, locked information + /// + [JsonPropertyName("lock")] + public KDriveApiSharedDirectoryLock? Lock { get; set; } + + /// + /// File categories + /// + [JsonPropertyName("categories")] + public List? Categories { get; set; } + + /// + /// ETag of the file + /// + [JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Color of the directory for the user requesting it + /// + [JsonPropertyName("color")] + public string? Color { get; set; } + + [JsonPropertyName("dropbox")] + public KDriveApiDropbox? Dropbox { get; set; } + + [JsonPropertyName("external_import")] + public KDriveApiExternalImport? ExternalImport { get; set; } + + [JsonPropertyName("rewind")] + public KDriveApiRewindV3? Rewind { get; set; } + + /// + /// user_id who shared the folder + /// + [JsonPropertyName("shared_by")] + public long? SharedBy { get; set; } + + /// + /// the relevance score between 0 and 1 + /// + [JsonPropertyName("relevance")] + public JsonElement? Relevance { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// Activities information about the Shared Directory + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiSharedDirectoryActivity + { + /// + /// Timestamp of the last user access of the Shared Directory + /// + [JsonPropertyName("last_accessed_at")] + public long? LastAccessedAt { get; set; } + + } + + /// + /// Directory rights + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiSharedDirectoryCapabilities + { + /// + /// Right to set file as favorite + /// + [JsonPropertyName("can_use_favorite")] + public bool? CanUseFavorite { get; set; } + + /// + /// Right to share file by link (share_link) + /// + [JsonPropertyName("can_become_sharelink")] + public bool? CanBecomeSharelink { get; set; } + + /// + /// Right to use and give team access + /// + [JsonPropertyName("can_use_team")] + public bool? CanUseTeam { get; set; } + + /// + /// Right to see Shared Directory information + /// + [JsonPropertyName("can_show")] + public bool? CanShow { get; set; } + + /// + /// Right to read Shared Directory content + /// + [JsonPropertyName("can_read")] + public bool? CanRead { get; set; } + + /// + /// Right to write Shared Directory + /// + [JsonPropertyName("can_write")] + public bool? CanWrite { get; set; } + + /// + /// Right to share Shared Directory or manage access to Shared Directory + /// + [JsonPropertyName("can_share")] + public bool? CanShare { get; set; } + + /// + /// Right to leave shared Shared Directory + /// + [JsonPropertyName("can_leave")] + public bool? CanLeave { get; set; } + + /// + /// Right to delete Shared Directory + /// + [JsonPropertyName("can_delete")] + public bool? CanDelete { get; set; } + + /// + /// Right to rename Shared Directory + /// + [JsonPropertyName("can_rename")] + public bool? CanRename { get; set; } + + /// + /// Right to move Shared Directory + /// + [JsonPropertyName("can_move")] + public bool? CanMove { get; set; } + + /// + /// Right to add new child directory + /// + [JsonPropertyName("can_create_directory")] + public bool? CanCreateDirectory { get; set; } + + /// + /// Right to add new child file + /// + [JsonPropertyName("can_create_file")] + public bool? CanCreateFile { get; set; } + + /// + /// Right to upload a child file + /// + [JsonPropertyName("can_upload")] + public bool? CanUpload { get; set; } + + /// + /// right to move directory + /// + [JsonPropertyName("can_move_into")] + public bool? CanMoveInto { get; set; } + + /// + /// Right to use convert directory into collaborative directory + /// + [JsonPropertyName("can_become_dropbox")] + public bool? CanBecomeDropbox { get; set; } + + /// + /// Right to change or add color to the directory + /// + [JsonPropertyName("colorable")] + public bool? Colorable { get; set; } + + } + + /// + /// When Shared Directory is locked, locked information + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiSharedDirectoryLock + { + /// + /// When Shared Directory is locked, locked timestamp + /// + [JsonPropertyName("locked_at")] + public long? LockedAt { get; set; } + + /// + /// When Shared Directory is locked, automatic lock release timestamp + /// + [JsonPropertyName("unlocked_at")] + public long? UnlockedAt { get; set; } + + /// + /// List of applications. 365 : The 365 application. external_import : The external_import application. internal_copy : The internal_copy application. internal_import : The internal_import application. onlyoffice : The onlyoffice application. webdav : The webdav application. + /// + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// When Shared Directory is locked, locked token + /// + [JsonPropertyName("token")] + public string? Token { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiSharedFile.cs b/DriveClient/Models/Generated/KDriveApiSharedFile.cs new file mode 100644 index 0000000..9e2eb1e --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiSharedFile.cs @@ -0,0 +1,445 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Shared File + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiSharedFile + { + /// + /// Unique identifier of the resource `Shared File` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// File name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Specific sortable name + /// + [JsonPropertyName("sorted_name")] + public string? SortedName { get; set; } + + /// + /// Full path of the Shared File + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// Type of returned element either a dir (Directory) or file (File) + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// Current state of Shared File. The state can be null meaning that the Shared File has no specific state. locked : Shared File is currently locked. No action can be made except unlocking by the application which locked the File (such as office, webdav or external import). ok : Sha… + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Visibility of Shared File, empty string if no specific visibility. Add additional information about Shared File to show different icons or more. : Empty visibility mean no special visibility. is_in_private_space : Is a Shared File inside the private directory of the user. is_in_… + /// + [JsonPropertyName("visibility")] + public string? Visibility { get; set; } + + /// + /// Drive identifier + /// + [JsonPropertyName("drive_id")] + public long? DriveId { get; set; } + + /// + /// Current path depth of Shared File + /// + [JsonPropertyName("depth")] + public long? Depth { get; set; } + + /// + /// The identifier of the user who first uploaded the Shared File + /// + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + /// + /// Shared File creation timestamp (in seconds), if available in its metadata or specified on upload + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// The timestamp (in seconds) at which the Shared File has been uploaded for the first time + /// + [JsonPropertyName("added_at")] + public long? AddedAt { get; set; } + + /// + /// Shared File creation timestamp (in seconds), if available in its metadata or specified on upload + /// + [JsonPropertyName("last_modified_at")] + public long? LastModifiedAt { get; set; } + + /// + /// Id of the user who last modified the Shared File + /// + [JsonPropertyName("last_modified_by")] + public long? LastModifiedBy { get; set; } + + /// + /// The last time the content of the Shared File was revised + /// + [JsonPropertyName("revised_at")] + public long? RevisedAt { get; set; } + + /// + /// The last time the Shared File was updated + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + /// + /// Parent directory identifier + /// + [JsonPropertyName("parent_id")] + public long? ParentId { get; set; } + + /// + /// Timestamp of deleted resource Shared File, only visible when the Shared File is trashed + /// + [JsonPropertyName("deleted_at")] + public long? DeletedAt { get; set; } + + /// + /// User identifier of deleted resource Shared File, only visible when the Shared File is trashed + /// + [JsonPropertyName("deleted_by")] + public long? DeletedBy { get; set; } + + /// + /// Root Directory identifier, only visible for shared user + /// + [JsonPropertyName("shared_root_id")] + public long? SharedRootId { get; set; } + + /// + /// Get all parents directories + /// + [JsonPropertyName("parents")] + public List? Parents { get; set; } + + /// + /// Array of users identifiers that has access to the Shared File + /// + [JsonPropertyName("users")] + public List? Users { get; set; } + + /// + /// Array of teams identifiers that has access to the Shared File + /// + [JsonPropertyName("teams")] + public List? Teams { get; set; } + + /// + /// Is Shared File pinned as favorite + /// + [JsonPropertyName("is_favorite")] + public bool? IsFavorite { get; set; } + + /// + /// Activities information about the Shared File + /// + [JsonPropertyName("activity")] + public KDriveApiSharedFileActivity? Activity { get; set; } + + [JsonPropertyName("sharelink")] + public KDriveApiShareLink? ShareLink { get; set; } + + /// + /// Capabilities of Shared File + /// + [JsonPropertyName("capabilities")] + public KDriveApiSharedFileCapabilities? Capabilities { get; set; } + + /// + /// When Shared File is locked, locked information + /// + [JsonPropertyName("lock")] + public KDriveApiSharedFileLock? Lock { get; set; } + + /// + /// File categories + /// + [JsonPropertyName("categories")] + public List? Categories { get; set; } + + /// + /// ETag of the file + /// + [JsonPropertyName("etag")] + public string? Etag { get; set; } + + /// + /// Size of Shared File The unit of size is defined in Bytes + /// + [JsonPropertyName("size")] + public long? Size { get; set; } + + /// + /// Mime-type of file + /// + [JsonPropertyName("mime_type")] + public string? MimeType { get; set; } + + /// + /// Generic file types, matching a known set of extensions and/or mime types. archive : Archive file. audio : Audio only file. code : Text file recognized as code. diagram : Diagram file. dir : Directory. email : Bundled email file. font : Text file recognized as font. form : Form f… + /// + [JsonPropertyName("extension_type")] + public string? ExtensionType { get; set; } + + /// + /// Symlink target path if the file was uploaded as a symlink + /// + [JsonPropertyName("symbolic_link")] + public string? SymbolicLink { get; set; } + + /// + /// Current state of virus scan for Shared File. cannot_be_scanned : This Shared File cannot be scanned. Possibly because the Shared File is too large. clean : This Shared File has been successfully scanned for known viruses. error : An error occurred while scanning the Shared File.… + /// + [JsonPropertyName("scan_status")] + public string? ScanStatus { get; set; } + + /// + /// List of applications. 365 : The 365 application. drawio : The drawio application. kmail : The kmail application. onlyoffice : The onlyoffice application. thumbnail : Thumbnail is preview and thumbnail. + /// + [JsonPropertyName("supported_by")] + public JsonElement? SupportedBy { get; set; } + + /// + /// Information when file has multi-version + /// + [JsonPropertyName("version")] + public KDriveApiSharedFileVersion? Version { get; set; } + + /// + /// The available ways to convert the file + /// + [JsonPropertyName("conversion_capabilities")] + public KDriveApiSharedFileConversionCapabilities? ConversionCapabilities { get; set; } + + /// + /// Hash of the file content + /// + [JsonPropertyName("hash")] + public string? Hash { get; set; } + + /// + /// user_id who shared the file + /// + [JsonPropertyName("shared_by")] + public long? SharedBy { get; set; } + + /// + /// the relevance score between 0 and 1 or date + /// + [JsonPropertyName("relevance")] + public JsonElement? Relevance { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// Activities information about the Shared File + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiSharedFileActivity + { + /// + /// Timestamp of the last user access of the Shared File + /// + [JsonPropertyName("last_accessed_at")] + public long? LastAccessedAt { get; set; } + + } + + /// + /// Capabilities of Shared File + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiSharedFileCapabilities + { + /// + /// Right to set file as favorite + /// + [JsonPropertyName("can_use_favorite")] + public bool? CanUseFavorite { get; set; } + + /// + /// Right to share file by link (share_link) + /// + [JsonPropertyName("can_become_sharelink")] + public bool? CanBecomeSharelink { get; set; } + + /// + /// Right to use and give team access + /// + [JsonPropertyName("can_use_team")] + public bool? CanUseTeam { get; set; } + + /// + /// Right to see Shared File information + /// + [JsonPropertyName("can_show")] + public bool? CanShow { get; set; } + + /// + /// Right to read Shared File content + /// + [JsonPropertyName("can_read")] + public bool? CanRead { get; set; } + + /// + /// Right to write Shared File + /// + [JsonPropertyName("can_write")] + public bool? CanWrite { get; set; } + + /// + /// Right to share Shared File or manage access to Shared File + /// + [JsonPropertyName("can_share")] + public bool? CanShare { get; set; } + + /// + /// Right to leave shared Shared File + /// + [JsonPropertyName("can_leave")] + public bool? CanLeave { get; set; } + + /// + /// Right to delete Shared File + /// + [JsonPropertyName("can_delete")] + public bool? CanDelete { get; set; } + + /// + /// Right to rename Shared File + /// + [JsonPropertyName("can_rename")] + public bool? CanRename { get; set; } + + /// + /// Right to move Shared File + /// + [JsonPropertyName("can_move")] + public bool? CanMove { get; set; } + + } + + /// + /// When Shared File is locked, locked information + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiSharedFileLock + { + /// + /// When Shared File is locked, locked timestamp + /// + [JsonPropertyName("locked_at")] + public long? LockedAt { get; set; } + + /// + /// When Shared File is locked, automatic lock release timestamp + /// + [JsonPropertyName("unlocked_at")] + public long? UnlockedAt { get; set; } + + /// + /// List of applications. 365 : The 365 application. external_import : The external_import application. internal_copy : The internal_copy application. internal_import : The internal_import application. onlyoffice : The onlyoffice application. webdav : The webdav application. + /// + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// When Shared File is locked, locked token + /// + [JsonPropertyName("token")] + public string? Token { get; set; } + + } + + /// + /// Information when file has multi-version + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiSharedFileVersion + { + /// + /// File has multi-version + /// + [JsonPropertyName("is_multiple")] + public bool? IsMultiple { get; set; } + + /// + /// Get number of version + /// + [JsonPropertyName("number")] + public long? Number { get; set; } + + /// + /// Size of the file with all version (byte unit) + /// + [JsonPropertyName("total_size")] + public long? TotalSize { get; set; } + + /// + /// True if the current version of this file should be kept forever, otherwise false or empty + /// + [JsonPropertyName("keep_forever")] + public bool? KeepForever { get; set; } + + } + + /// + /// The available ways to convert the file + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiSharedFileConversionCapabilities + { + /// + /// Whether the file may be converted upon download + /// + [JsonPropertyName("when_downloading")] + public bool? WhenDownloading { get; set; } + + /// + /// Available extensions to which the file may be converted upon download, if possible + /// + [JsonPropertyName("download_extensions")] + public List? DownloadExtensions { get; set; } + + /// + /// Whether the file may be converted for live edition with OnlyOffice + /// + [JsonPropertyName("when_onlyoffice_opening")] + public bool? WhenOnlyofficeOpening { get; set; } + + /// + /// Available extension to which the file may be converted by OnlyOffice, if possible + /// + [JsonPropertyName("onlyoffice_extension")] + public string? OnlyofficeExtension { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiSharefile.cs b/DriveClient/Models/Generated/KDriveApiSharefile.cs new file mode 100644 index 0000000..14abd75 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiSharefile.cs @@ -0,0 +1,42 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Share file + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiSharefile + { + /// + /// Shared file identifier + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// File name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// update_at + /// + [JsonPropertyName("update_at")] + public long? UpdateAt { get; set; } + + /// + /// Number of active users on file + /// + [JsonPropertyName("users")] + public long? Users { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiStatisticSharelink.cs b/DriveClient/Models/Generated/KDriveApiStatisticSharelink.cs new file mode 100644 index 0000000..eda0a3a --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiStatisticSharelink.cs @@ -0,0 +1,134 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Statistic Share link + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiStatisticSharelink + { + /// + /// Share link url + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// file_id + /// + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + + /// + /// Rights required to view the share link. inherit : Share link is accessible only by users of the drive. password : Share link is public but protected by a password. public : Share link is public, no restriction set. + /// + [JsonPropertyName("right")] + public string? Right { get; set; } + + /// + /// Until when the share link is valid + /// + [JsonPropertyName("valid_until")] + public long? ValidUntil { get; set; } + + /// + /// Unique identifier of the creator of the resource `Statistic Share link` + /// + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + /// + /// Timestamp `Statistic Share link` was created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Timestamp `Statistic Share link` was updated at + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + /// + /// capabilities + /// + [JsonPropertyName("capabilities")] + public KDriveApiStatisticSharelinkCapabilities? Capabilities { get; set; } + + /// + /// If the share link is blocked + /// + [JsonPropertyName("access_blocked")] + public bool? AccessBlocked { get; set; } + + /// + /// Number of view on share link + /// + [JsonPropertyName("views")] + public long? Views { get; set; } + + /// + /// File information if the user has right to see the file. + /// + [JsonPropertyName("file")] + public JsonElement? File { get; set; } + + /// + /// Number of unique views on share link + /// + [JsonPropertyName("unique_views")] + public long? UniqueViews { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// capabilities + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiStatisticSharelinkCapabilities + { + /// + /// Does share link allow editing + /// + [JsonPropertyName("can_edit")] + public bool? CanEdit { get; set; } + + /// + /// Does share link allow stats to be seen + /// + [JsonPropertyName("can_see_stats")] + public bool? CanSeeStats { get; set; } + + /// + /// Does share link allow info to be seen + /// + [JsonPropertyName("can_see_info")] + public bool? CanSeeInfo { get; set; } + + /// + /// Does share link allow download + /// + [JsonPropertyName("can_download")] + public bool? CanDownload { get; set; } + + /// + /// Does share link allow adding comments + /// + [JsonPropertyName("can_comment")] + public bool? CanComment { get; set; } + + /// + /// Does share link allow user to request access to folder + /// + [JsonPropertyName("can_request_access")] + public bool? CanRequestAccess { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiStream.cs b/DriveClient/Models/Generated/KDriveApiStream.cs new file mode 100644 index 0000000..5893fd5 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiStream.cs @@ -0,0 +1,18 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Stream + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiStream + { + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiTag.cs b/DriveClient/Models/Generated/KDriveApiTag.cs new file mode 100644 index 0000000..2e62b1d --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiTag.cs @@ -0,0 +1,42 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Tag + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiTag + { + /// + /// Unique identifier of the resource `Tag` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Name of the resource `Tag` + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// color + /// + [JsonPropertyName("color")] + public long? Color { get; set; } + + /// + /// Product count related to the resource `Tag` + /// + [JsonPropertyName("product_count")] + public long? ProductCount { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiTeam.cs b/DriveClient/Models/Generated/KDriveApiTeam.cs new file mode 100644 index 0000000..c111f9d --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiTeam.cs @@ -0,0 +1,84 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Team + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiTeam + { + /// + /// Unique identifier of the resource `Team` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Name of the resource `Team` + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Unique identifier of the `color` of the resource `Team` + /// + [JsonPropertyName("color_id")] + public long? ColorId { get; set; } + + /// + /// Unique identifier of the `user` that owned the resource `Team` + /// + [JsonPropertyName("owned_by_id")] + public long? OwnedById { get; set; } + + /// + /// Unique identifier of the `user` that created the resource `Team` + /// + [JsonPropertyName("created_by_id")] + public long? CreatedById { get; set; } + + /// + /// Timestamp `Team` was created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Timestamp `Team` was updated at + /// + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + [JsonPropertyName("created_by")] + public KDriveApiAppUser? CreatedBy { get; set; } + + [JsonPropertyName("owned_by")] + public KDriveApiAppUser? OwnedBy { get; set; } + + /// + /// User count related to the resource `Team` + /// + [JsonPropertyName("user_count")] + public long? UserCount { get; set; } + + /// + /// Product count related to the resource `Team` + /// + [JsonPropertyName("product_count")] + public long? ProductCount { get; set; } + + /// + /// Product by service count related to the resource `Team` + /// + [JsonPropertyName("product_by_service_count")] + public long? ProductByServiceCount { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiTeamFileAccess.cs b/DriveClient/Models/Generated/KDriveApiTeamFileAccess.cs new file mode 100644 index 0000000..8a4accc --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiTeamFileAccess.cs @@ -0,0 +1,54 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Team File Access + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiTeamFileAccess + { + /// + /// Team File Access Identifier, can be team identifier, user identifier, invitation identifier + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Access type + /// + [JsonPropertyName("access")] + public string? Access { get; set; } + + /// + /// Team File Access name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Access right + /// + [JsonPropertyName("right")] + public string? Right { get; set; } + + /// + /// Access color + /// + [JsonPropertyName("color")] + public long? Color { get; set; } + + /// + /// Status of access + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiTemporaryURL.cs b/DriveClient/Models/Generated/KDriveApiTemporaryURL.cs new file mode 100644 index 0000000..eabbd33 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiTemporaryURL.cs @@ -0,0 +1,24 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Temporary URL + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiTemporaryURL + { + /// + /// The temporary URL for a file + /// + [JsonPropertyName("temporary_url")] + public string? TemporaryUrl { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiThirdpartydrive.cs b/DriveClient/Models/Generated/KDriveApiThirdpartydrive.cs new file mode 100644 index 0000000..e3e8ae7 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiThirdpartydrive.cs @@ -0,0 +1,30 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// A third party drive which may be eligible for external import + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiThirdpartydrive + { + /// + /// Drive identifier + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// Drive name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiThirdpartydriveslist.cs b/DriveClient/Models/Generated/KDriveApiThirdpartydriveslist.cs new file mode 100644 index 0000000..a34dc69 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiThirdpartydriveslist.cs @@ -0,0 +1,30 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// List of third party drives eligible to perform an external import + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiThirdpartydriveslist + { + /// + /// All the suitable drives + /// + [JsonPropertyName("drives")] + public List? Drives { get; set; } + + /// + /// The access token identifier built for future requests for the suitable drives + /// + [JsonPropertyName("access_token_id")] + public long? AccessTokenId { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiUUIDFeedbackresource.cs b/DriveClient/Models/Generated/KDriveApiUUIDFeedbackresource.cs new file mode 100644 index 0000000..c5cc179 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiUUIDFeedbackresource.cs @@ -0,0 +1,36 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// UUID Feedback resource + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUUIDFeedbackresource + { + /// + /// Identifier + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// Result of the asking query + /// + [JsonPropertyName("result")] + public bool? Result { get; set; } + + /// + /// Message, additional information usually given when the result is false + /// + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiUUIDResource.cs b/DriveClient/Models/Generated/KDriveApiUUIDResource.cs new file mode 100644 index 0000000..9975ce8 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiUUIDResource.cs @@ -0,0 +1,24 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// UUID Resource + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUUIDResource + { + /// + /// Universally unique identifier of the resource `UUID Resource` + /// + [JsonPropertyName("uuid")] + public string? Uuid { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiUploadSessionFeedback.cs b/DriveClient/Models/Generated/KDriveApiUploadSessionFeedback.cs new file mode 100644 index 0000000..846ed18 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiUploadSessionFeedback.cs @@ -0,0 +1,69 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Upload Session Feedback + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUploadSessionFeedback + { + /// + /// Directory destination identifier requested on upload + /// + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + + /// + /// Directory destination identifier requested on upload + /// + [JsonPropertyName("directory_id")] + public long? DirectoryId { get; set; } + + /// + /// Directory destination path requested on upload + /// + [JsonPropertyName("directory_path")] + public string? DirectoryPath { get; set; } + + /// + /// File name requested on upload + /// + [JsonPropertyName("file_name")] + public string? FileName { get; set; } + + [JsonPropertyName("file")] + public KDriveApiFileV3? File { get; set; } + + /// + /// New upload session token + /// + [JsonPropertyName("token")] + public string? Token { get; set; } + + /// + /// Upload session was created + /// + [JsonPropertyName("result")] + public bool? Result { get; set; } + + /// + /// The error code returned, null if no error happens. conflict_error : Conflict detected. In the upload another conflict mode can be used to handle it. file_already_exists_error : Action impossible. The file already exist. forbidden_error : Triggered when user does not have the fil… + /// + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// + /// Upload url to use for uploading chunks. + /// + [JsonPropertyName("upload_url")] + public string? UploadUrl { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiUploadsegment.cs b/DriveClient/Models/Generated/KDriveApiUploadsegment.cs new file mode 100644 index 0000000..8076470 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiUploadsegment.cs @@ -0,0 +1,48 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// Upload segment + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUploadsegment + { + /// + /// Index of the chunk to compute the final object correctly + /// + [JsonPropertyName("number")] + public long? Number { get; set; } + + /// + /// The chunk status during the upload. error : Something was wrong chunk was not correctly received, retried to send the same chunk. ok : Chunk has been received. uploading : Chunks still uploading. + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Timestamp `Upload segment` was created at + /// + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + /// + /// Chunk uploaded size, computed + /// + [JsonPropertyName("size")] + public long? Size { get; set; } + + /// + /// Chunk uploaded hash, computed + /// + [JsonPropertyName("hash")] + public string? Hash { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiUserSignatureStroke.cs b/DriveClient/Models/Generated/KDriveApiUserSignatureStroke.cs new file mode 100644 index 0000000..ac4ec5d --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiUserSignatureStroke.cs @@ -0,0 +1,60 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// UserSignatureStroke + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUserSignatureStroke + { + /// + /// Color of the signature stroke, in hex format + /// + [JsonPropertyName("penColor")] + public string? PenColor { get; set; } + + /// + /// Stroke thickness + /// + [JsonPropertyName("dotSize")] + public string? DotSize { get; set; } + + /// + /// minWidth + /// + [JsonPropertyName("minWidth")] + public string? MinWidth { get; set; } + + /// + /// maxWidth + /// + [JsonPropertyName("maxWidth")] + public string? MaxWidth { get; set; } + + /// + /// velocityFilterWeight + /// + [JsonPropertyName("velocityFilterWeight")] + public string? VelocityFilterWeight { get; set; } + + /// + /// compositeOperation + /// + [JsonPropertyName("compositeOperation")] + public string? CompositeOperation { get; set; } + + /// + /// points + /// + [JsonPropertyName("points")] + public List? Points { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiUserSignatureStrokePoint.cs b/DriveClient/Models/Generated/KDriveApiUserSignatureStrokePoint.cs new file mode 100644 index 0000000..0890d92 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiUserSignatureStrokePoint.cs @@ -0,0 +1,42 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// UserSignatureStrokePoint + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUserSignatureStrokePoint + { + /// + /// Point creation integer timestamp in milliseconds + /// + [JsonPropertyName("time")] + public long? Time { get; set; } + + /// + /// Point abscissa + /// + [JsonPropertyName("x")] + public string? X { get; set; } + + /// + /// Point ordinate + /// + [JsonPropertyName("y")] + public string? Y { get; set; } + + /// + /// Outline thickness + /// + [JsonPropertyName("pressure")] + public string? Pressure { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiUserUuid.cs b/DriveClient/Models/Generated/KDriveApiUserUuid.cs new file mode 100644 index 0000000..249c90f --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiUserUuid.cs @@ -0,0 +1,30 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// User Uuid + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUserUuid + { + /// + /// Uuid v4 + /// + [JsonPropertyName("uuid")] + public string? Uuid { get; set; } + + /// + /// Validity of the Uuid + /// + [JsonPropertyName("valid_until")] + public long? ValidUntil { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiUserV3.cs b/DriveClient/Models/Generated/KDriveApiUserV3.cs new file mode 100644 index 0000000..3a94ad3 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiUserV3.cs @@ -0,0 +1,143 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// User V3 + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUserV3 + { + /// + /// Unique identifier of the resource `User V3` + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Display name + /// + [JsonPropertyName("display_name")] + public string? DisplayName { get; set; } + + /// + /// First name + /// + [JsonPropertyName("first_name")] + public string? FirstName { get; set; } + + /// + /// Last name + /// + [JsonPropertyName("last_name")] + public string? LastName { get; set; } + + /// + /// returns true if the user is provided by an external IDP + /// + [JsonPropertyName("is_sso")] + public bool? IsSso { get; set; } + + /// + /// null is returned only when request parameter no_avatar_default=1 and the user has not set an avatar + /// + [JsonPropertyName("avatar")] + public string? Avatar { get; set; } + + /// + /// role + /// + [JsonPropertyName("role")] + public string? Role { get; set; } + + /// + /// Email + /// + [JsonPropertyName("email")] + public string? Email { get; set; } + + /// + /// Timestamp `User V3` was deleted at + /// + [JsonPropertyName("deleted_at")] + public long? DeletedAt { get; set; } + + /// + /// List of Team identifiers + /// + [JsonPropertyName("teams")] + public List? Teams { get; set; } + + /// + /// security + /// + [JsonPropertyName("security")] + public KDriveApiUserV3Security? Security { get; set; } + + [JsonPropertyName("drive_user")] + public KDriveApiDriveUser? DriveUser { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// security + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUserV3Security + { + /// + /// The last date the assistant was used + /// + [JsonPropertyName("assistant_at")] + public long? AssistantAt { get; set; } + + /// + /// Double authentication method used to log in + /// + [JsonPropertyName("double_auth_method")] + public string? DoubleAuthMethod { get; set; } + + /// + /// Whether the `User V3` has double authentication enabled + /// + [JsonPropertyName("has_double_auth")] + public bool? HasDoubleAuth { get; set; } + + /// + /// Last time `User V3`'s password was changed + /// + [JsonPropertyName("last_password_at")] + public long? LastPasswordAt { get; set; } + + /// + /// Security score of the `User V3` + /// + [JsonPropertyName("score")] + public long? Score { get; set; } + + /// + /// Whether the `User V3` has a valid email + /// + [JsonPropertyName("has_valid_email")] + public long? HasValidEmail { get; set; } + + /// + /// Whether the `User V3` has a recovery email + /// + [JsonPropertyName("has_recovery_email")] + public bool? HasRecoveryEmail { get; set; } + + /// + /// Whether the `User V3` has a valid phone number + /// + [JsonPropertyName("has_valid_phone")] + public bool? HasValidPhone { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiUserandteamsaccessonparentfile.cs b/DriveClient/Models/Generated/KDriveApiUserandteamsaccessonparentfile.cs new file mode 100644 index 0000000..4dbd8df --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiUserandteamsaccessonparentfile.cs @@ -0,0 +1,42 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// User and teams access on parent file + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUserandteamsaccessonparentfile + { + /// + /// Whether this file inherits the same or higher access permissions as its parent, with no downgrades. + /// + [JsonPropertyName("mismatch")] + public bool? Mismatch { get; set; } + + /// + /// All users that have access to the parent file + /// + [JsonPropertyName("users")] + public List? Users { get; set; } + + /// + /// All teams that have access to the parent file + /// + [JsonPropertyName("teams")] + public List? Teams { get; set; } + + /// + /// Current file's parent name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiUserfileaccess.cs b/DriveClient/Models/Generated/KDriveApiUserfileaccess.cs new file mode 100644 index 0000000..600b2bf --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiUserfileaccess.cs @@ -0,0 +1,54 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// User file access + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUserfileaccess + { + /// + /// User file access Identifier, can be team identifier, user identifier, invitation identifier + /// + [JsonPropertyName("id")] + public long? Id { get; set; } + + /// + /// Access type + /// + [JsonPropertyName("access")] + public string? Access { get; set; } + + /// + /// User file access name + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Access right + /// + [JsonPropertyName("right")] + public string? Right { get; set; } + + /// + /// Access color + /// + [JsonPropertyName("color")] + public long? Color { get; set; } + + /// + /// Status of access + /// + [JsonPropertyName("status")] + public string? Status { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } diff --git a/DriveClient/Models/Generated/KDriveApiUserpreference.cs b/DriveClient/Models/Generated/KDriveApiUserpreference.cs new file mode 100644 index 0000000..37cdb61 --- /dev/null +++ b/DriveClient/Models/Generated/KDriveApiUserpreference.cs @@ -0,0 +1,184 @@ +// +#nullable enable +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace kDriveClient.Models.Generated; + + /// + /// User preference + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUserpreference + { + /// + /// Layout density of user interface elements + /// + [JsonPropertyName("density")] + public string? Density { get; set; } + + /// + /// Should lists sort by recent + /// + [JsonPropertyName("sort_recent_file")] + public bool? SortRecentFile { get; set; } + + /// + /// Date format + /// + [JsonPropertyName("date_format")] + public string? DateFormat { get; set; } + + /// + /// use_shortcut + /// + [JsonPropertyName("use_shortcut")] + public bool? UseShortcut { get; set; } + + /// + /// Drive identifier of default drive to open when none is explicitly chosen in url + /// + [JsonPropertyName("default_drive")] + public long? DefaultDrive { get; set; } + + /// + /// Identifiers of tutorials that were already played + /// + [JsonPropertyName("tutorials")] + public List? Tutorials { get; set; } + + /// + /// connected_app + /// + [JsonPropertyName("connected_app")] + public List? ConnectedApp { get; set; } + + /// + /// list + /// + [JsonPropertyName("list")] + public KDriveApiUserpreferenceList? List { get; set; } + + /// Undocumented / include-only fields. + [JsonExtensionData] + public Dictionary? ExtraData { get; set; } + + } + + /// + /// list + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUserpreferenceList + { + /// + /// Layout for the list view + /// + [JsonPropertyName("view")] + public string? View { get; set; } + + /// + /// files + /// + [JsonPropertyName("files")] + public KDriveApiUserpreferenceListFiles? Files { get; set; } + + /// + /// trash + /// + [JsonPropertyName("trash")] + public KDriveApiUserpreferenceListTrash? Trash { get; set; } + + /// + /// storage_largest + /// + [JsonPropertyName("storage_largest")] + public KDriveApiUserpreferenceListStorageLargest? StorageLargest { get; set; } + + /// + /// storage_versions + /// + [JsonPropertyName("storage_versions")] + public KDriveApiUserpreferenceListStorageVersions? StorageVersions { get; set; } + + } + + /// + /// files + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUserpreferenceListFiles + { + /// + /// Default property to sort file list + /// + [JsonPropertyName("property")] + public string? Property { get; set; } + + /// + /// Default sort ordering of file list + /// + [JsonPropertyName("direction")] + public string? Direction { get; set; } + + } + + /// + /// trash + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUserpreferenceListTrash + { + /// + /// Default property to sort trash + /// + [JsonPropertyName("property")] + public string? Property { get; set; } + + /// + /// Default sort ordering of trash + /// + [JsonPropertyName("direction")] + public string? Direction { get; set; } + + } + + /// + /// storage_largest + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUserpreferenceListStorageLargest + { + /// + /// Default property to sort largest items list + /// + [JsonPropertyName("property")] + public string? Property { get; set; } + + /// + /// Default sort ordering of largest items list + /// + [JsonPropertyName("direction")] + public string? Direction { get; set; } + + } + + /// + /// storage_versions + /// + /// Generated from OpenAPI kDrive schema (91ac10ff_* / common envelopes). + public partial class KDriveApiUserpreferenceListStorageVersions + { + /// + /// Default property to sort list of file versions + /// + [JsonPropertyName("property")] + public string? Property { get; set; } + + /// + /// Default sort ordering of list of file versions + /// + [JsonPropertyName("direction")] + public string? Direction { get; set; } + + } diff --git a/DriveClient/Models/KDriveChunk.cs b/DriveClient/Models/KDriveChunk.cs index e153bef..8740cc5 100644 --- a/DriveClient/Models/KDriveChunk.cs +++ b/DriveClient/Models/KDriveChunk.cs @@ -1,14 +1,19 @@ -namespace kDriveClient.Models +using System.IO.Hashing; + +namespace kDriveClient.Models { /// /// kDriveChunk represents a chunk of Data in a kDrive file. /// - public class KDriveChunk(byte[] content, int chunkNumber, byte[] hash) : IDisposable + public class KDriveChunk(Memory content, int chunkNumber, string hash, KDriveUploadHashAlgorithm algorithm = KDriveUploadHashAlgorithm.Sha256) : IDisposable { /// - /// ChunkHash is the SHA-256 hash of the chunk content. + /// ChunkHash is the hex digest of the chunk content (without algo prefix). /// - public string ChunkHash { get; init; } = Convert.ToHexString(hash); + public string ChunkHash { get; init; } = hash.ToLowerInvariant(); + + /// Hash algorithm used for . + public KDriveUploadHashAlgorithm HashAlgorithm { get; init; } = algorithm; /// /// ChunkNumber is the sequential number of the chunk in the file. @@ -23,7 +28,10 @@ public class KDriveChunk(byte[] content, int chunkNumber, byte[] hash) : IDispos /// /// Content is the actual byte content of the chunk. /// - public byte[]? Content { get; private set; } = content; + public Memory Content { get; private set; } = content; + + /// API form algo:hex. + public string ApiChunkHash => $"{ToApiPrefix(HashAlgorithm)}:{ChunkHash}"; /// /// Frees resources used by the KDriveChunk. @@ -38,8 +46,34 @@ public void Dispose() /// internal void Clean() { - this.Content = null; + this.Content = Memory.Empty; GC.Collect(); } + + /// + /// Hashes content with the given algorithm. + /// + public static string GetChunkHash(byte[] content, KDriveUploadHashAlgorithm algorithm = KDriveUploadHashAlgorithm.Sha256) + { + return algorithm switch + { + KDriveUploadHashAlgorithm.XxHash3 => Convert.ToHexString(XxHash3.Hash(content)).ToLowerInvariant(), + _ => Convert.ToHexString(SHA256.HashData(content)).ToLowerInvariant() + }; + } + + /// Gets the SHA-256 hash of the given content. + public static string GetChunkHash(byte[] content) => GetChunkHash(content, KDriveUploadHashAlgorithm.Sha256); + + public static string ToApiPrefix(KDriveUploadHashAlgorithm algorithm) => algorithm switch + { + KDriveUploadHashAlgorithm.XxHash3 => "xxh3", + _ => "sha256" + }; + + public override string ToString() + { + return $"ChunkNumber={ChunkNumber}, ChunkSize={ChunkSize}, Hash={ApiChunkHash}"; + } } -} \ No newline at end of file +} diff --git a/DriveClient/Models/KDriveClientOptions.cs b/DriveClient/Models/KDriveClientOptions.cs deleted file mode 100644 index 279034c..0000000 --- a/DriveClient/Models/KDriveClientOptions.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace kDriveClient.Models -{ - /// - /// KDriveClientOptions holds configuration options for the KDriveClient. - /// - public class KDriveClientOptions - { - /// - /// Number of parallel chunk to upload. - /// - public int Parallelism { get; set; } = 4; - - /// - /// Size of each chunk in bytes when performing chunked uploads. - /// - public int? ChunkSize { get; set; } - - /// - /// Threshold in bytes to decide between direct upload and chunked upload. - /// - public long DirectUploadThresholdBytes { get; set; } = 1L * 1024 * 1024; - - /// - /// Use automatic chunk size adjustment based on bandwidth. - /// - public bool UseAutoChunkSize { get; set; } = true; - } -} \ No newline at end of file diff --git a/DriveClient/Models/KDriveDownloadOptions.cs b/DriveClient/Models/KDriveDownloadOptions.cs new file mode 100644 index 0000000..c005497 --- /dev/null +++ b/DriveClient/Models/KDriveDownloadOptions.cs @@ -0,0 +1,28 @@ +namespace kDriveClient.Models +{ + /// + /// Options for file download requests (conversion, password-protected files). + /// + public sealed class KDriveDownloadOptions + { + /// + /// On-the-fly conversion via the as query parameter (pdf or text). + /// + public string? ConvertAs { get; set; } + + /// + /// Password for protected files (x-kdrive-file-password header). + /// + public string? Password { get; set; } + + /// + /// When true, obtain a temporary URL first then download from it (files only). + /// + public bool UseTemporaryUrl { get; set; } + + /// + /// Temporary URL lifetime in seconds (60–86400). Used when is true. + /// + public int? TemporaryUrlDurationSeconds { get; set; } + } +} diff --git a/DriveClient/Models/KDriveEndpointModels.cs b/DriveClient/Models/KDriveEndpointModels.cs new file mode 100644 index 0000000..3bb8ace --- /dev/null +++ b/DriveClient/Models/KDriveEndpointModels.cs @@ -0,0 +1,362 @@ +using kDriveClient.Models.Generated; + +namespace kDriveClient.Models +{ + /// + /// Generic response wrapper with a single data payload. + /// + public class KDriveResourceResponse : ApiResultBase + { + public string Result { get; set; } = string.Empty; + + public TData? Data { get; set; } + + public override string ToString() + { + return $"Result={Result}, DataType={typeof(TData).Name}, HasData={Data is not null}, ExtraDataCount={ExtraDataCount}"; + } + } + + /// + /// Generic paginated response wrapper. + /// + public class KDrivePagedResponse : ApiResultBase + { + public string Result { get; set; } = string.Empty; + + public List Data { get; set; } = []; + + [JsonPropertyName("total")] + public int? Total { get; set; } + + [JsonPropertyName("page")] + public int? Page { get; set; } + + [JsonPropertyName("pages")] + public int? Pages { get; set; } + + [JsonPropertyName("items_per_page")] + public int? ItemsPerPage { get; set; } + + public override string ToString() + { + return $"Result={Result}, ItemType={typeof(TItem).Name}, DataCount={Data.Count}, Page={Page}, Pages={Pages}, Total={Total}, ItemsPerPage={ItemsPerPage}, ExtraDataCount={ExtraDataCount}"; + } + } + + /// + /// Generic cursor-based response wrapper. + /// + public class KDriveNavigatorResponse : ApiResultBase + { + public string Result { get; set; } = string.Empty; + + public List Data { get; set; } = []; + + [JsonPropertyName("cursor")] + public string? Cursor { get; set; } + + [JsonPropertyName("has_more")] + public bool? HasMore { get; set; } + + [JsonPropertyName("response_at")] + public long? ResponseAt { get; set; } + + public override string ToString() + { + return $"Result={Result}, ItemType={typeof(TItem).Name}, DataCount={Data.Count}, Cursor={Cursor}, HasMore={HasMore}, ResponseAt={ResponseAt}, ExtraDataCount={ExtraDataCount}"; + } + } + + /// + /// Drive summary model. + /// + public class KDriveDriveSummary : ApiResultBase + { + public long Id { get; set; } + + public string? Name { get; set; } + + public long? Size { get; set; } + + [JsonPropertyName("used_size")] + public long? UsedSize { get; set; } + + [JsonPropertyName("account_id")] + public long? AccountId { get; set; } + + [JsonPropertyName("product_id")] + public long? ProductId { get; set; } + + [JsonPropertyName("users_count")] + public int? UsersCount { get; set; } + + [JsonPropertyName("users_quota")] + public int? UsersQuota { get; set; } + + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + [JsonPropertyName("expired_at")] + public long? ExpiredAt { get; set; } + + [JsonPropertyName("is_locked")] + public bool? IsLocked { get; set; } + + [JsonPropertyName("is_demo")] + public bool? IsDemo { get; set; } + + [JsonPropertyName("in_maintenance")] + public bool? InMaintenance { get; set; } + + public string? Role { get; set; } + + public string? Status { get; set; } + + public override string ToString() + { + return $"Id={Id}, Name={Name}, UsedSize={UsedSize}, Size={Size}, Users={UsersCount}/{UsersQuota}, Role={Role}, Status={Status}, IsLocked={IsLocked}, InMaintenance={InMaintenance}, ExtraDataCount={ExtraDataCount}"; + } + } + + /// + /// User summary model. + /// + public class KDriveUserSummary : ApiResultBase + { + public long Id { get; set; } + + [JsonPropertyName("display_name")] + public string? DisplayName { get; set; } + + [JsonPropertyName("first_name")] + public string? FirstName { get; set; } + + [JsonPropertyName("last_name")] + public string? LastName { get; set; } + + public string? Email { get; set; } + + [JsonPropertyName("is_sso")] + public bool? IsSso { get; set; } + + public string? Avatar { get; set; } + + public string? Type { get; set; } + + [JsonPropertyName("deleted_at")] + public long? DeletedAt { get; set; } + + public override string ToString() + { + return $"Id={Id}, DisplayName={DisplayName}, Email={Email}, Type={Type}, IsSso={IsSso}, DeletedAt={DeletedAt}, ExtraDataCount={ExtraDataCount}"; + } + } + + /// + /// Drive user summary model. + /// + public class KDriveDriveUserSummary : KDriveUserSummary + { + [JsonPropertyName("drive_id")] + public long? DriveId { get; set; } + + [JsonPropertyName("drive_name")] + public string? DriveName { get; set; } + + [JsonPropertyName("account_id")] + public long? AccountId { get; set; } + + [JsonPropertyName("product_id")] + public long? ProductId { get; set; } + + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + [JsonPropertyName("last_connection_at")] + public long? LastConnectionAt { get; set; } + + public string? Status { get; set; } + + public string? Role { get; set; } + + public override string ToString() + { + return $"{base.ToString()}, DriveId={DriveId}, DriveName={DriveName}, AccountId={AccountId}, ProductId={ProductId}, Status={Status}, Role={Role}, LastConnectionAt={LastConnectionAt}"; + } + } + + /// + /// Transport DTO for a unified file/directory payload from v3 endpoints. + /// + /// + /// Inherits OpenAPI FileV3/DirectoryV3 union properties + /// (), including typed + /// , + /// , and + /// . + /// Prefer mapping to in application code. + /// + /// + /// + /// + public class KDriveFileSystemItem : KDriveApiFileSystemItem + { + /// Number of extension fields returned by the API. + protected int ExtraDataCount => ExtraData?.Count ?? 0; + + /// + public override string ToString() + { + return $"Id={Id}, Name={Name}, Path={Path}, Type={Type}, Status={Status}, Visibility={Visibility}, ParentId={ParentId}, DriveId={DriveId}, Size={Size}, MimeType={MimeType}, Hash={Hash}, IsFavorite={IsFavorite}, LastModifiedAt={LastModifiedAt}, DeletedAt={DeletedAt}, Capabilities={Capabilities is not null}, ShareLink={ShareLink is not null}, Categories={Categories?.Count}, ExtraDataCount={ExtraDataCount}"; + } + } + + /// + /// Cancel resource model used by async-like operations. + /// + public class KDriveCancelResource : ApiResultBase + { + [JsonPropertyName("cancel_id")] + public string? CancelId { get; set; } + + [JsonPropertyName("valid_until")] + public long? ValidUntil { get; set; } + + public override string ToString() + { + return $"CancelId={CancelId}, ValidUntil={ValidUntil}, ExtraDataCount={ExtraDataCount}"; + } + } + + /// + /// Directory count summary model. + /// + public class KDriveDirectoryCount : ApiResultBase + { + [JsonPropertyName("files")] + public long? Files { get; set; } + + [JsonPropertyName("directories")] + public long? Directories { get; set; } + + [JsonPropertyName("total")] + public long? Total { get; set; } + + public override string ToString() + { + return $"Files={Files}, Directories={Directories}, Total={Total}, ExtraDataCount={ExtraDataCount}"; + } + } + + /// + /// File version summary model. + /// + public class KDriveFileVersion : ApiResultBase + { + [JsonPropertyName("id")] + public long? Id { get; set; } + + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + + [JsonPropertyName("name")] + public string? Name { get; set; } + + [JsonPropertyName("size")] + public long? Size { get; set; } + + [JsonPropertyName("hash")] + public string? Hash { get; set; } + + [JsonPropertyName("mime_type")] + public string? MimeType { get; set; } + + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + [JsonPropertyName("last_modified_at")] + public long? LastModifiedAt { get; set; } + + public override string ToString() + { + return $"Id={Id}, FileId={FileId}, Name={Name}, Size={Size}, Hash={Hash}, LastModifiedAt={LastModifiedAt}, ExtraDataCount={ExtraDataCount}"; + } + } + + /// + /// File activity summary model. + /// + public class KDriveFileActivity : ApiResultBase + { + [JsonPropertyName("id")] + public long? Id { get; set; } + + [JsonPropertyName("type")] + public string? Type { get; set; } + + [JsonPropertyName("action")] + public string? Action { get; set; } + + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + + public override string ToString() + { + return $"Id={Id}, Type={Type}, Action={Action}, UserId={UserId}, CreatedAt={CreatedAt}, ExtraDataCount={ExtraDataCount}"; + } + } + + /// + /// v3 drive user model (cursor-based users endpoint). + /// + public class KDriveUserV3 : ApiResultBase + { + [JsonPropertyName("id")] + public long Id { get; set; } + + [JsonPropertyName("display_name")] + public string? DisplayName { get; set; } + + [JsonPropertyName("first_name")] + public string? FirstName { get; set; } + + [JsonPropertyName("last_name")] + public string? LastName { get; set; } + + [JsonPropertyName("email")] + public string? Email { get; set; } + + [JsonPropertyName("status")] + public string? Status { get; set; } + + [JsonPropertyName("type")] + public string? Type { get; set; } + + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + public override string ToString() + { + return $"Id={Id}, DisplayName={DisplayName}, Email={Email}, Status={Status}, Type={Type}, ExtraDataCount={ExtraDataCount}"; + } + } +} diff --git a/DriveClient/Models/KDriveExtendedModels.cs b/DriveClient/Models/KDriveExtendedModels.cs new file mode 100644 index 0000000..caa7875 --- /dev/null +++ b/DriveClient/Models/KDriveExtendedModels.cs @@ -0,0 +1,419 @@ +namespace kDriveClient.Models +{ + public class KDriveUuidResource : ApiResultBase + { + public string? Uuid { get; set; } + + public override string ToString() => $"Uuid={Uuid}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveFeedbackResource : ApiResultBase + { + public long? Id { get; set; } + + public string? Result { get; set; } + + public string? Message { get; set; } + + public override string ToString() => $"Id={Id}, Result={Result}, Message={Message}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveFileHash : ApiResultBase + { + public string? Hash { get; set; } + + public override string ToString() => $"Hash={Hash}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveFileSizeInfo : ApiResultBase + { + public long? Size { get; set; } + + [JsonPropertyName("storage_size")] + public long? StorageSize { get; set; } + + public override string ToString() => $"Size={Size}, StorageSize={StorageSize}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveTemporaryUrl : ApiResultBase + { + [JsonPropertyName("temporary_url")] + public string? TemporaryUrl { get; set; } + + public override string ToString() => $"TemporaryUrl={TemporaryUrl}, ExtraDataCount={ExtraDataCount}"; + } + + /// + /// Public share link on a file or directory (API v2). + /// + /// + /// A share link is a URL outsiders can open. It is different from collaborative ACL + /// () and from a dropbox (upload inbox). + /// + /// + /// + public class KDriveShareLink : ApiResultBase + { + public string? Url { get; set; } + + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + + /// Raw API right string. + public string? Right { get; set; } + + /// Typed access right when the API value is recognized. + [JsonIgnore] + public Domain.KDriveRight AccessRight + { + get => Domain.KDriveEnumFormatting.ParseRight(Right); + set => Right = Domain.KDriveEnumFormatting.FormatRight(value); + } + + [JsonPropertyName("valid_until")] + public long? ValidUntil { get; set; } + + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + [JsonPropertyName("access_blocked")] + public bool? AccessBlocked { get; set; } + + public override string ToString() => + $"Url={Url}, FileId={FileId}, Right={Right}, ValidUntil={ValidUntil}, ExtraDataCount={ExtraDataCount}"; + } + + /// Request body for creating or updating a share link (API v2). + public class KDriveShareLinkRequest + { + /// Raw API right string (e.g. public). Prefer . + [JsonPropertyName("right")] + public string? Right { get; set; } + + /// + /// Typed access right for the link (required on create for most drives). + /// Typical value: . + /// + [JsonIgnore] + public Domain.KDriveRight? AccessRight + { + get => Right is null ? null : Domain.KDriveEnumFormatting.ParseRight(Right); + set => Right = value is null ? null : Domain.KDriveEnumFormatting.FormatRight(value.Value); + } + + [JsonPropertyName("can_comment")] + public bool? CanComment { get; set; } + + [JsonPropertyName("can_download")] + public bool? CanDownload { get; set; } + + [JsonPropertyName("can_edit")] + public bool? CanEdit { get; set; } + + [JsonPropertyName("can_request_access")] + public bool? CanRequestAccess { get; set; } + + [JsonPropertyName("can_see_info")] + public bool? CanSeeInfo { get; set; } + + [JsonPropertyName("can_see_stats")] + public bool? CanSeeStats { get; set; } + + [JsonPropertyName("password")] + public string? Password { get; set; } + + [JsonPropertyName("valid_until")] + public long? ValidUntil { get; set; } + } + + + public class KDriveExternalImport : ApiResultBase + { + public long? Id { get; set; } + + public string? Application { get; set; } + + [JsonPropertyName("account_name")] + public string? AccountName { get; set; } + + public string? Status { get; set; } + + [JsonPropertyName("error_code")] + public string? ErrorCode { get; set; } + + public string? Path { get; set; } + + [JsonPropertyName("directory_id")] + public long? DirectoryId { get; set; } + + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + public override string ToString() => $"Id={Id}, Status={Status}, Path={Path}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveCategory : ApiResultBase + { + public long? Id { get; set; } + + public string? Name { get; set; } + + public string? Color { get; set; } + + [JsonPropertyName("is_predefined")] + public bool? IsPredefined { get; set; } + + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + public override string ToString() => $"Id={Id}, Name={Name}, Color={Color}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveCategoryPermission : ApiResultBase + { + [JsonPropertyName("can_create")] + public bool? CanCreate { get; set; } + + [JsonPropertyName("can_edit")] + public bool? CanEdit { get; set; } + + [JsonPropertyName("can_delete")] + public bool? CanDelete { get; set; } + + [JsonPropertyName("can_read_on_file")] + public bool? CanReadOnFile { get; set; } + + [JsonPropertyName("can_put_on_file")] + public bool? CanPutOnFile { get; set; } + + public override string ToString() => $"CanCreate={CanCreate}, CanEdit={CanEdit}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveComment : ApiResultBase + { + public long? Id { get; set; } + + [JsonPropertyName("parent_id")] + public long? ParentId { get; set; } + + public string? Body { get; set; } + + [JsonPropertyName("is_resolved")] + public bool? IsResolved { get; set; } + + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + public bool? Liked { get; set; } + + [JsonPropertyName("likes_count")] + public int? LikesCount { get; set; } + + [JsonPropertyName("responses_count")] + public int? ResponsesCount { get; set; } + + public override string ToString() => $"Id={Id}, Body={Body}, IsResolved={IsResolved}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveDropbox : ApiResultBase + { + public long? Id { get; set; } + + public string? Uuid { get; set; } + + public string? Name { get; set; } + + public string? Url { get; set; } + + public string? Directory { get; set; } + + [JsonPropertyName("users_count")] + public int? UsersCount { get; set; } + + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + public override string ToString() => $"Id={Id}, Name={Name}, Url={Url}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveDriveDetail : ApiResultBase + { + public long Id { get; set; } + + public string? Name { get; set; } + + public long? Size { get; set; } + + [JsonPropertyName("used_size")] + public long? UsedSize { get; set; } + + [JsonPropertyName("account_id")] + public long? AccountId { get; set; } + + public string? Role { get; set; } + + public string? Status { get; set; } + + public override string ToString() => $"Id={Id}, Name={Name}, UsedSize={UsedSize}, Role={Role}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveDriveSettings : ApiResultBase + { + [JsonPropertyName("trash_delay")] + public int? TrashDelay { get; set; } + + public override string ToString() => $"TrashDelay={TrashDelay}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveDriveInvitation : ApiResultBase + { + public long? Id { get; set; } + + public string? Email { get; set; } + + public string? Role { get; set; } + + public string? Status { get; set; } + + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + public override string ToString() => $"Id={Id}, Email={Email}, Role={Role}, Status={Status}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveUserPreference : ApiResultBase + { + public string? Density { get; set; } + + [JsonPropertyName("sort_recent_file")] + public bool? SortRecentFile { get; set; } + + [JsonPropertyName("date_format")] + public string? DateFormat { get; set; } + + [JsonPropertyName("use_shortcut")] + public bool? UseShortcut { get; set; } + + [JsonPropertyName("default_drive")] + public long? DefaultDrive { get; set; } + + public override string ToString() => $"DefaultDrive={DefaultDrive}, Density={Density}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveActivityReport : ApiResultBase + { + public long? Id { get; set; } + + public string? Status { get; set; } + + public string? Size { get; set; } + + [JsonPropertyName("download_url")] + public string? DownloadUrl { get; set; } + + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + public override string ToString() => $"Id={Id}, Status={Status}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveActivityV2 : ApiResultBase + { + public string? Action { get; set; } + + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + + [JsonPropertyName("parent_id")] + public long? ParentId { get; set; } + + [JsonPropertyName("file_type")] + public string? FileType { get; set; } + + public long? Size { get; set; } + + public string? Path { get; set; } + + public long? Timestamp { get; set; } + + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + public override string ToString() => $"Action={Action}, FileId={FileId}, Path={Path}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveFileAccessUser : ApiResultBase + { + public long? Id { get; set; } + + public string? Access { get; set; } + + public string? Name { get; set; } + + public string? Right { get; set; } + + public int? Color { get; set; } + + public string? Status { get; set; } + + public override string ToString() => $"Id={Id}, Name={Name}, Right={Right}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveFileAccessTeam : ApiResultBase + { + public long? Id { get; set; } + + public string? Access { get; set; } + + public string? Name { get; set; } + + public string? Right { get; set; } + + public int? Color { get; set; } + + public string? Status { get; set; } + + public override string ToString() => $"Id={Id}, Name={Name}, Right={Right}, ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveFileAccessRequest : ApiResultBase + { + public long? Id { get; set; } + + public string? Status { get; set; } + + public string? Message { get; set; } + + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + public override string ToString() => $"Id={Id}, Status={Status}, UserId={UserId}, ExtraDataCount={ExtraDataCount}"; + } +} diff --git a/DriveClient/Models/KDriveFile.cs b/DriveClient/Models/KDriveFile.cs index d20b04a..b680096 100644 --- a/DriveClient/Models/KDriveFile.cs +++ b/DriveClient/Models/KDriveFile.cs @@ -1,19 +1,25 @@ -using System.Buffers; using System.Text; namespace kDriveClient.Models { /// - /// KDriveFile represents a file in the kDrive system. + /// Local upload payload: the file content and metadata to upload to kDrive. /// + /// + /// This is not a remote file-system resource. After a successful upload, use the + /// returned (and/or fetch a + /// via browse/get APIs). + /// For remote files and directories already stored on the drive, see + /// , , and + /// . + /// + /// public class KDriveFile : IDisposable { - private Int64 totalSize; - /// /// CreatedAt is the timestamp when the file was created. /// - public int CreatedAt { get; set; } + public long CreatedAt { get; set; } /// /// DirectoryId is the unique identifier for the directory containing this file. @@ -33,7 +39,7 @@ public class KDriveFile : IDisposable /// /// LastModifiedAt is the timestamp when the file was last modified. /// - public int LastModifiedAt { get; set; } + public long LastModifiedAt { get; set; } /// /// In case of a symbolic link, this is the target of the link. @@ -46,70 +52,57 @@ public class KDriveFile : IDisposable public string TotalChunkHash { get; set; } = string.Empty; /// - /// TotalSize is the total size of the file in bytes, calculated as the sum of all chunk sizes. + /// TotalSize is the total size of the file in bytes. /// - public long TotalSize - { - get - { - if (totalSize == 0) - { - totalSize = this.Chunks.Sum(c => (long)c.ChunkSize); - } - return totalSize; - } - } + public long TotalSize { get; set; } /// - /// Chunks is a list of KDriveChunk objects representing the file's content split into chunks. + /// In case of conflict with an existing file, it defines how to manage the conflict. /// - public List Chunks { get; set; } = []; + public ConflictChoice ConflictChoice { get; set; } = ConflictChoice.Version; /// - /// Content is a stream representing the file's content. + /// LocalPath is the local file system path to the file. /// - public Stream? Content { get; init; } + public string LocalPath { get; set; } = string.Empty; /// - /// In case of conflict with an existing file, it define how to manage the conflict + /// Optional in-memory content stream. /// - public ConflictChoice ConflictChoice { get; set; } = ConflictChoice.Version; + public Stream? Content { get; set; } /// - /// Splits the file content into chunks of the specified size. + /// File chunks used for chunked upload. /// - /// Define the size of each chunk (except the last one) - public void SplitIntoChunks(int chunkSize) - { - if (this.Content == null) - { - throw new InvalidOperationException("Content stream is null."); - } - - var pool = ArrayPool.Shared; - var buffer = pool.Rent(chunkSize); - int chunkNumber = 0; - int bytesRead; - - this.Content.Position = 0; - using var fileSha256 = IncrementalHash.CreateHash(HashAlgorithmName.SHA256); - while ((bytesRead = this.Content.Read(buffer, 0, chunkSize)) > 0) - { - var chunkData = new byte[bytesRead]; - Array.Copy(buffer, chunkData, bytesRead); - var chunkHash = SHA256.HashData(chunkData); - this.Chunks.Add(new KDriveChunk(chunkData, chunkNumber++, chunkHash)); - fileSha256.AppendData(Encoding.UTF8.GetBytes(Convert.ToHexString(chunkHash).ToLowerInvariant())); - } - - pool.Return(buffer); + public List Chunks { get; set; } = []; - this.Content.Dispose(); - GC.Collect(); + /// + /// Constructs an empty file model. + /// + public KDriveFile() + { + } - this.TotalChunkHash = this.Chunks.Count > 1 ? - this.TotalChunkHash = Convert.ToHexString(fileSha256.GetHashAndReset()) - : this.Chunks.First().ChunkHash; + /// + /// Constructs a KDriveFile instance from a local file path and drive path. + /// + /// Local file system path to the file. + /// Drive path where the file will be uploaded. + /// Conflict resolution strategy. + /// Argument is null or whitespace. + public KDriveFile(string localPath, string drivePath, ConflictChoice conflictChoice = ConflictChoice.Rename) + { + if (string.IsNullOrWhiteSpace(localPath)) + throw new ArgumentException("Value cannot be null or whitespace.", nameof(localPath)); + + var fileInfo = new FileInfo(localPath); + Name = fileInfo.Name; + LocalPath = localPath; + DirectoryPath = drivePath; + TotalSize = fileInfo.Length; + ConflictChoice = conflictChoice; + LastModifiedAt = new DateTimeOffset(fileInfo.LastWriteTimeUtc).ToUnixTimeSeconds(); + CreatedAt = new DateTimeOffset(fileInfo.CreationTimeUtc).ToUnixTimeSeconds(); } /// @@ -122,12 +115,12 @@ public string GetEscapedFileName() } /// - /// Convert enum to string for api + /// Convert enum to string for API. /// - /// String representation of + /// String representation of the conflict mode. public string ConvertConflictChoice() { - return this.ConflictChoice switch + return ConflictChoice switch { ConflictChoice.Version => "version", ConflictChoice.Error => "error", @@ -136,14 +129,101 @@ public string ConvertConflictChoice() }; } + /// + /// Hash algorithm used when splitting into chunks. + /// + public KDriveUploadHashAlgorithm HashAlgorithm { get; set; } = KDriveUploadHashAlgorithm.Sha256; + + /// + /// Split file content into chunks and compute chunk hashes. + /// + /// Target chunk size in bytes. + public void SplitIntoChunks(int chunkSize) + => SplitIntoChunks(chunkSize, HashAlgorithm); + + /// + /// Split file content into chunks and compute chunk hashes. + /// + public void SplitIntoChunks(int chunkSize, KDriveUploadHashAlgorithm algorithm) + { + if (chunkSize <= 0) + throw new ArgumentOutOfRangeException(nameof(chunkSize), "Chunk size must be greater than zero."); + + HashAlgorithm = algorithm; + Chunks.Clear(); + using var source = OpenReadableStream(); + var buffer = new byte[chunkSize]; + var index = 0; + int bytesRead; + using var totalHasher = IncrementalHash.CreateHash(HashAlgorithmName.SHA256); + + while ((bytesRead = source.Read(buffer, 0, buffer.Length)) > 0) + { + var chunkData = bytesRead == buffer.Length ? [.. buffer] : buffer[..bytesRead]; + var chunkHash = KDriveChunk.GetChunkHash(chunkData, algorithm); + totalHasher.AppendData(Encoding.UTF8.GetBytes(chunkHash)); + Chunks.Add(new KDriveChunk(chunkData, index++, chunkHash, algorithm)); + } + + TotalSize = source.Length; + TotalChunkHash = Convert.ToHexString(totalHasher.GetHashAndReset()).ToLowerInvariant(); + } + + /// + /// Create an in-memory virtual file. + /// + internal static KDriveFile CreateVirtualFile(string name, Memory buffer, string drivePath) + { + var now = DateTimeOffset.UtcNow.ToUnixTimeSeconds(); + return new KDriveFile + { + Name = name, + DirectoryPath = drivePath, + Content = new MemoryStream(buffer.ToArray(), writable: false), + TotalSize = buffer.Length, + CreatedAt = now, + LastModifiedAt = now, + LocalPath = string.Empty + }; + } + /// /// Frees resources used by the KDriveFile instance. /// public void Dispose() { - this.Chunks.ForEach(c => c.Dispose()); - + Content?.Dispose(); + foreach (var chunk in Chunks) + { + chunk.Dispose(); + } GC.SuppressFinalize(this); } + + private Stream OpenReadableStream() + { + if (!string.IsNullOrWhiteSpace(LocalPath)) + { + return new FileStream(LocalPath, FileMode.Open, FileAccess.Read, FileShare.Read); + } + + if (Content is null) + { + throw new InvalidOperationException("Either LocalPath or Content must be provided."); + } + + if (Content.CanSeek) + { + Content.Position = 0; + } + + return Content; + } + + public override string ToString() + { + var source = !string.IsNullOrWhiteSpace(LocalPath) ? "LocalPath" : (Content is not null ? "Content" : "None"); + return $"Name={Name}, DirectoryId={DirectoryId}, DirectoryPath={DirectoryPath}, TotalSize={TotalSize}, Chunks={Chunks.Count}, Conflict={ConflictChoice}, Source={source}, LastModifiedAt={LastModifiedAt}, CreatedAt={CreatedAt}"; + } } -} \ No newline at end of file +} diff --git a/DriveClient/Models/KDriveFinishRequest.cs b/DriveClient/Models/KDriveFinishRequest.cs index 834c794..d29f1e1 100644 --- a/DriveClient/Models/KDriveFinishRequest.cs +++ b/DriveClient/Models/KDriveFinishRequest.cs @@ -10,5 +10,10 @@ public class KDriveFinishRequest /// [JsonPropertyName("total_chunk_hash")] public string TotalChunkHash { get; set; } = string.Empty; + + public override string ToString() + { + return $"TotalChunkHash={TotalChunkHash}"; + } } -} \ No newline at end of file +} diff --git a/DriveClient/Models/KDriveQueryModels.cs b/DriveClient/Models/KDriveQueryModels.cs new file mode 100644 index 0000000..62b48a1 --- /dev/null +++ b/DriveClient/Models/KDriveQueryModels.cs @@ -0,0 +1,159 @@ +using kDriveClient.Models.Domain; + +namespace kDriveClient.Models +{ + /// + /// Typed cursor/list query parameters for navigator and list endpoints. + /// + /// + /// Prefer this over a raw IDictionary<string, string?>. Properties map to + /// well-known Infomaniak query parameters (cursor, limit, with, + /// order_by, order). + /// + public class KDriveListQuery + { + /// Pagination cursor from a previous navigator response. + public string? Cursor { get; set; } + + /// Maximum number of items to return. + public int? Limit { get; set; } + + /// + /// Typed with includes (path, users, capabilities, …). + /// Combined with when both are set. + /// + public KDriveItemIncludes Includes { get; set; } = KDriveItemIncludes.None; + + /// + /// Optional raw with value for advanced / undocumented includes. + /// Prefer when possible. + /// + public string? With { get; set; } + + /// Sort field (API order_by), e.g. name, last_modified_at. + public string? OrderBy { get; set; } + + /// Typed sort direction (API order). + public KDriveSortOrder? SortOrder { get; set; } + + /// + /// Optional raw order value. Used when is null. + /// + public string? Order { get; set; } + + /// + /// Extra raw query parameters for endpoint-specific keys not covered by typed properties. + /// Prefer typed properties when available. + /// + public Dictionary Extra { get; set; } = new(); + + /// Creates a shallow copy suitable for pagination loops. + public KDriveListQuery Clone() => new() + { + Cursor = Cursor, + Limit = Limit, + Includes = Includes, + With = With, + OrderBy = OrderBy, + SortOrder = SortOrder, + Order = Order, + Extra = new Dictionary(Extra) + }; + + /// Converts this query to a dictionary for the HTTP layer. + public virtual IDictionary ToDictionary() + { + var query = new Dictionary(); + if (!string.IsNullOrWhiteSpace(Cursor)) + query["cursor"] = Cursor; + if (Limit.HasValue) + query["limit"] = Limit.Value.ToString(); + + var includes = KDriveEnumFormatting.FormatIncludes(Includes); + var withValue = MergeWith(includes, With); + if (!string.IsNullOrWhiteSpace(withValue)) + query["with"] = withValue; + + if (!string.IsNullOrWhiteSpace(OrderBy)) + query["order_by"] = OrderBy; + + var order = SortOrder is { } sort + ? KDriveEnumFormatting.FormatSortOrder(sort) + : Order; + if (!string.IsNullOrWhiteSpace(order)) + query["order"] = order; + + foreach (var kv in Extra) + { + if (!string.IsNullOrWhiteSpace(kv.Value)) + query[kv.Key] = kv.Value; + } + + return query; + } + + /// Returns a dictionary, or null when is null. + public static IDictionary? ToDictionaryOrNull(KDriveListQuery? query) + => query?.ToDictionary(); + + private static string? MergeWith(string? includes, string? raw) + { + if (string.IsNullOrWhiteSpace(includes)) + return string.IsNullOrWhiteSpace(raw) ? null : raw; + if (string.IsNullOrWhiteSpace(raw)) + return includes; + return $"{includes},{raw}"; + } + } + + /// + /// Typed search query parameters for file/item search endpoints. + /// + public class KDriveSearchQuery : KDriveListQuery + { + /// Free-text search string (API query). + public string? Query { get; set; } + + /// Optional directory id that scopes the search. + public long? DirectoryId { get; set; } + + /// Converts this search query to a dictionary for the HTTP layer. + public override IDictionary ToDictionary() + { + var query = new Dictionary(base.ToDictionary()); + if (!string.IsNullOrWhiteSpace(Query)) + query["query"] = Query; + if (DirectoryId.HasValue) + query["directory_id"] = DirectoryId.Value.ToString(); + return query; + } + } + + /// + /// Typed query for paged (page/pages) list endpoints that are not cursor-based. + /// + public class KDrivePagedQuery : KDriveListQuery + { + /// 1-based page index (API page). + public int? Page { get; set; } + + /// Items per page when the endpoint uses items_per_page. + public int? ItemsPerPage { get; set; } + + /// Items per page when the endpoint uses per_page (versions, comments, …). + public int? PerPage { get; set; } + + /// Converts this paged query to a dictionary for the HTTP layer. + public override IDictionary ToDictionary() + { + var query = new Dictionary(base.ToDictionary()); + if (Page.HasValue) + query["page"] = Page.Value.ToString(); + if (ItemsPerPage.HasValue) + query["items_per_page"] = ItemsPerPage.Value.ToString(); + if (PerPage.HasValue) + query["per_page"] = PerPage.Value.ToString(); + return query; + } + } +} diff --git a/DriveClient/Models/KDriveRequestModels.cs b/DriveClient/Models/KDriveRequestModels.cs new file mode 100644 index 0000000..27770ab --- /dev/null +++ b/DriveClient/Models/KDriveRequestModels.cs @@ -0,0 +1,60 @@ +namespace kDriveClient.Models +{ + /// Body for archive creation (drive files or share-link archive). + public class KDriveArchiveRequest + { + /// File ids to include (required without parent_id). + [JsonPropertyName("file_ids")] + public long[]? FileIds { get; set; } + + /// Parent directory id when archiving a whole folder. + [JsonPropertyName("parent_id")] + public long? ParentId { get; set; } + + /// File ids to exclude when parent_id is set. + [JsonPropertyName("except_file_ids")] + public long[]? ExceptFileIds { get; set; } + + /// Builds a request from optional archive selectors. + public static KDriveArchiveRequest? From(IEnumerable? fileIds, long? parentId, IEnumerable? exceptFileIds) + { + if (fileIds is null && !parentId.HasValue && exceptFileIds is null) + return null; + return new KDriveArchiveRequest + { + FileIds = fileIds?.ToArray(), + ParentId = parentId, + ExceptFileIds = exceptFileIds?.ToArray(), + }; + } + } + + /// Body for creating/updating a dropbox (API v2 file dropbox, or v3 create). + public class KDriveDropboxRequest + { + /// Dropbox display name. + public string? Name { get; set; } + + /// Optional directory path (v2). + public string? Directory { get; set; } + + /// Parent directory id when creating via POST /3/.../files/dropboxes. + [JsonPropertyName("parent_directory_id")] + public long? ParentDirectoryId { get; set; } + + /// Whether uploads are allowed. + [JsonPropertyName("can_upload")] + public bool? CanUpload { get; set; } + } + + /// Body for canceling an upload by path (API v2). + public class KDriveCancelUploadByPathRequest + { + /// Remote path of the upload to cancel. + public string? Path { get; set; } + + /// Optional file id. + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + } +} diff --git a/DriveClient/Models/KDriveResponse.cs b/DriveClient/Models/KDriveResponse.cs index 4caf74c..fcd83ad 100644 --- a/DriveClient/Models/KDriveResponse.cs +++ b/DriveClient/Models/KDriveResponse.cs @@ -14,5 +14,10 @@ public class KDriveResponse : ApiResultBase /// Data contains the actual response data, which can vary based on the API endpoint. /// public Dictionary Data { get; set; } = []; + + public override string ToString() + { + return $"Result={Result}, DataCount={Data.Count}, ExtraDataCount={ExtraDataCount}"; + } } -} \ No newline at end of file +} diff --git a/DriveClient/Models/KDriveStrictDtos.cs b/DriveClient/Models/KDriveStrictDtos.cs new file mode 100644 index 0000000..bc21099 --- /dev/null +++ b/DriveClient/Models/KDriveStrictDtos.cs @@ -0,0 +1,419 @@ +using System.Text.Json.Serialization; + +namespace kDriveClient.Models +{ + // --- Response DTOs replacing KDriveStatisticsData --- + + public class KDriveFileAccess : ApiResultBase + { + public List Users { get; set; } = []; + public List Teams { get; set; } = []; + public List Invitations { get; set; } = []; + + [JsonPropertyName("parent_access")] + public KDriveParentFileAccess? ParentAccess { get; set; } + } + + public class KDriveFileAccessInvitation : ApiResultBase + { + public long? Id { get; set; } + public string? Access { get; set; } + public string? Name { get; set; } + public string? Right { get; set; } + public int? Color { get; set; } + public string? Status { get; set; } + } + + public class KDriveParentFileAccess : ApiResultBase + { + public List? Users { get; set; } + public List? Teams { get; set; } + } + + public class KDriveStatisticShareLink : ApiResultBase + { + public string? Url { get; set; } + + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + + public string? Right { get; set; } + + [JsonPropertyName("valid_until")] + public long? ValidUntil { get; set; } + + [JsonPropertyName("created_by")] + public long? CreatedBy { get; set; } + + [JsonPropertyName("created_at")] + public long? CreatedAt { get; set; } + + [JsonPropertyName("updated_at")] + public long? UpdatedAt { get; set; } + + public int? Views { get; set; } + + [JsonPropertyName("unique_views")] + public int? UniqueViews { get; set; } + + [JsonPropertyName("access_blocked")] + public bool? AccessBlocked { get; set; } + } + + /// Open-ended statistics payload (known fields + extension data). + public class KDriveStatisticsData : ApiResultBase + { + public override string ToString() => $"ExtraDataCount={ExtraDataCount}"; + } + + public class KDriveOAuthImportDrive : ApiResultBase + { + public long? Id { get; set; } + public string? Name { get; set; } + public string? Type { get; set; } + } + + public class KDrivePendingAccessInvitation : ApiResultBase + { + [JsonPropertyName("invitation_id")] + public long? InvitationId { get; set; } + + [JsonPropertyName("drive_invitation_id")] + public long? DriveInvitationId { get; set; } + + [JsonPropertyName("has_invitation")] + public string? HasInvitation { get; set; } + + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + + public string? Email { get; set; } + } + + public class KDriveExportData : ApiResultBase + { + public string? Url { get; set; } + public string? Status { get; set; } + public override string ToString() => $"Url={Url}, Status={Status}, ExtraDataCount={ExtraDataCount}"; + } + + // --- Request DTOs --- + + public class KDriveSetFileAccessRequest + { + public bool? Inherit { get; set; } + public string? Right { get; set; } + [JsonPropertyName("user_ids")] + public long[]? UserIds { get; set; } + [JsonPropertyName("team_ids")] + public long[]? TeamIds { get; set; } + [JsonPropertyName("emails")] + public string[]? Emails { get; set; } + public string? Message { get; set; } + } + + /// Request body to grant users access to a file or directory. + public class KDriveFileAccessUsersRequest + { + [JsonPropertyName("user_ids")] + public long[]? UserIds { get; set; } + + /// Raw API right string. Prefer . + public string? Right { get; set; } + + /// Typed access right (e.g. ). + [JsonIgnore] + public Domain.KDriveRight? AccessRight + { + get => Right is null ? null : Domain.KDriveEnumFormatting.ParseRight(Right); + set => Right = value is null ? null : Domain.KDriveEnumFormatting.FormatRight(value.Value); + } + + public string? Message { get; set; } + } + + /// Request body to update a user's access right on an item. + public class KDriveFileAccessUserUpdateRequest + { + /// Raw API right string. Prefer . + public string? Right { get; set; } + + /// Typed access right. + [JsonIgnore] + public Domain.KDriveRight? AccessRight + { + get => Right is null ? null : Domain.KDriveEnumFormatting.ParseRight(Right); + set => Right = value is null ? null : Domain.KDriveEnumFormatting.FormatRight(value.Value); + } + } + + /// Request body to grant teams access to a file or directory. + public class KDriveFileAccessTeamsRequest + { + [JsonPropertyName("team_ids")] + public long[]? TeamIds { get; set; } + + /// Raw API right string. Prefer . + public string? Right { get; set; } + + /// Typed access right. + [JsonIgnore] + public Domain.KDriveRight? AccessRight + { + get => Right is null ? null : Domain.KDriveEnumFormatting.ParseRight(Right); + set => Right = value is null ? null : Domain.KDriveEnumFormatting.FormatRight(value.Value); + } + + public string? Message { get; set; } + } + + /// Request body to update a team's access right on an item. + public class KDriveFileAccessTeamUpdateRequest + { + /// Raw API right string. Prefer . + public string? Right { get; set; } + + /// Typed access right. + [JsonIgnore] + public Domain.KDriveRight? AccessRight + { + get => Right is null ? null : Domain.KDriveEnumFormatting.ParseRight(Right); + set => Right = value is null ? null : Domain.KDriveEnumFormatting.FormatRight(value.Value); + } + } + + public class KDriveFileAccessInvitationsRequest + { + public string[]? Emails { get; set; } + public string? Right { get; set; } + public string? Message { get; set; } + public string? Lang { get; set; } + } + + public class KDriveFileAccessInvitationsCheckRequest + { + public string[]? Emails { get; set; } + [JsonPropertyName("user_ids")] + public long[]? UserIds { get; set; } + } + + public class KDriveCreateFileAccessRequestBody + { + public string? Message { get; set; } + public string? Right { get; set; } + } + + public class KDriveFileAccessApplicationsRequest + { + [JsonPropertyName("application_ids")] + public long[]? ApplicationIds { get; set; } + public string? Right { get; set; } + } + + public class KDriveFileAccessCheckRequest + { + [JsonPropertyName("user_id")] + public long? UserId { get; set; } + public string? Email { get; set; } + } + + public class KDriveFileAccessForceRequest + { + [JsonPropertyName("user_ids")] + public long[]? UserIds { get; set; } + [JsonPropertyName("team_ids")] + public long[]? TeamIds { get; set; } + public string[]? Emails { get; set; } + public string? Right { get; set; } + } + + public class KDriveCreateUserRequest + { + public string? Role { get; set; } + public string[]? Emails { get; set; } + [JsonPropertyName("file_id")] + public long? FileId { get; set; } + public string? Lang { get; set; } + public string? Message { get; set; } + } + + public class KDriveUpdateUserRequest + { + public string? Role { get; set; } + public string? Status { get; set; } + } + + public class KDrivePatchUserManagerRequest + { + [JsonPropertyName("manager_id")] + public long? ManagerId { get; set; } + } + + public class KDriveUpdateDriveRequest + { + public string? Name { get; set; } + public string? Description { get; set; } + } + + public class KDriveDriveSettingsAiRequest + { + [JsonPropertyName("ai_enabled")] + public bool? AiEnabled { get; set; } + } + + public class KDriveDriveSettingsLinkRequest + { + [JsonPropertyName("default_right")] + public string? DefaultRight { get; set; } + [JsonPropertyName("can_edit")] + public bool? CanEdit { get; set; } + [JsonPropertyName("can_download")] + public bool? CanDownload { get; set; } + } + + public class KDriveDriveSettingsOfficeRequest + { + [JsonPropertyName("onlyoffice_enabled")] + public bool? OnlyOfficeEnabled { get; set; } + } + + public class KDriveDriveSettingsTrashRequest + { + [JsonPropertyName("purge_after_days")] + public int? PurgeAfterDays { get; set; } + } + + public class KDriveUserPreferencesRequest + { + public string? Density { get; set; } + [JsonPropertyName("sort_recent_file")] + public bool? SortRecentFile { get; set; } + [JsonPropertyName("date_format")] + public string? DateFormat { get; set; } + [JsonPropertyName("use_shortcut")] + public bool? UseShortcut { get; set; } + [JsonPropertyName("default_drive")] + public long? DefaultDrive { get; set; } + } + + public class KDriveUpdateInvitationRequest + { + public string? Role { get; set; } + public string? Status { get; set; } + } + + public class KDriveStartOAuthImportRequest + { + public string? Provider { get; set; } + [JsonPropertyName("remote_drive_id")] + public string? RemoteDriveId { get; set; } + [JsonPropertyName("destination_directory_id")] + public long? DestinationDirectoryId { get; set; } + public string? Code { get; set; } + } + + public class KDriveStartKdriveImportRequest + { + [JsonPropertyName("source_drive_id")] + public long? SourceDriveId { get; set; } + [JsonPropertyName("source_file_id")] + public long? SourceFileId { get; set; } + [JsonPropertyName("destination_directory_id")] + public long? DestinationDirectoryId { get; set; } + } + + public class KDriveStartWebdavImportRequest + { + public string? Url { get; set; } + public string? Login { get; set; } + public string? Password { get; set; } + [JsonPropertyName("destination_directory_id")] + public long? DestinationDirectoryId { get; set; } + } + + public class KDriveStartSharelinkImportRequest + { + public string? Url { get; set; } + public string? Password { get; set; } + [JsonPropertyName("destination_directory_id")] + public long? DestinationDirectoryId { get; set; } + } + + public class KDriveCategoryFilesRequest + { + [JsonPropertyName("file_ids")] + public long[]? FileIds { get; set; } + } + + public class KDriveCategoryRightsRequest + { + [JsonPropertyName("can_create")] + public bool? CanCreate { get; set; } + [JsonPropertyName("can_edit")] + public bool? CanEdit { get; set; } + } + + public class KDriveCreateActivityReportRequest + { + public string? Name { get; set; } + [JsonPropertyName("from_date")] + public long? FromDate { get; set; } + [JsonPropertyName("to_date")] + public long? ToDate { get; set; } + public string[]? Actions { get; set; } + } + + public class KDriveDropboxInviteRequest + { + public string[]? Emails { get; set; } + public string? Message { get; set; } + public string? Lang { get; set; } + } + + public class KDriveCategoryAiFeedbackRequest + { + public string? Feedback { get; set; } + public bool? Useful { get; set; } + } + + public class KDriveSetCurrentVersionRequest + { + [JsonPropertyName("version_id")] + public long? VersionId { get; set; } + } + + public class KDriveUpdateFileVersionRequest + { + public string? Name { get; set; } + [JsonPropertyName("keep_forever")] + public bool? KeepForever { get; set; } + } + + public class KDriveUploadSessionBatchFile + { + public string? Name { get; set; } + public long? Size { get; set; } + [JsonPropertyName("total_size")] + public long? TotalSize { get; set; } + [JsonPropertyName("directory_id")] + public long? DirectoryId { get; set; } + [JsonPropertyName("directory_path")] + public string? DirectoryPath { get; set; } + public string? Hash { get; set; } + } + + public class KDriveUploadSessionBatchRequest + { + public KDriveUploadSessionBatchFile[]? Files { get; set; } + public string? Conflict { get; set; } + [JsonPropertyName("directory_id")] + public long? DirectoryId { get; set; } + } + + public class KDriveFinishUploadSessionBatchRequest + { + public string[]? Tokens { get; set; } + [JsonPropertyName("total_chunk_hash")] + public string? TotalChunkHash { get; set; } + } +} diff --git a/DriveClient/Models/KDriveUploadOptions.cs b/DriveClient/Models/KDriveUploadOptions.cs new file mode 100644 index 0000000..3cde47e --- /dev/null +++ b/DriveClient/Models/KDriveUploadOptions.cs @@ -0,0 +1,48 @@ +namespace kDriveClient.Models +{ + /// + /// KDriveUploadOptions holds configuration options for the KDriveClient. + /// + public sealed class KDriveUploadOptions + { + /// + /// Number of parallel chunk to upload. + /// + public int Parallelism { get; set; } = 4; + + /// + /// Size of each chunk in bytes when performing chunked uploads. + /// + public int ChunkSize { get; set; } + + /// + /// Threshold in bytes to decide between direct upload and chunked upload. + /// + public long DirectUploadThresholdBytes { get; set; } = 1L * 1024 * 1024; + + /// + /// Use automatic chunk size adjustment based on bandwidth. + /// + public bool UseAutoChunkSize { get; set; } = true; + + /// + /// Hash algorithm used for chunked uploads (sha256 or xxh3). Default: sha256. + /// + public KDriveUploadHashAlgorithm HashAlgorithm { get; set; } = KDriveUploadHashAlgorithm.Sha256; + + public override string ToString() + { + return $"Parallelism={Parallelism}, ChunkSize={ChunkSize}, DirectUploadThresholdBytes={DirectUploadThresholdBytes}, UseAutoChunkSize={UseAutoChunkSize}, HashAlgorithm={HashAlgorithm}"; + } + } + + /// Supported upload content-hash algorithms (API algo:hex form). + public enum KDriveUploadHashAlgorithm + { + /// SHA-256 (default, widely supported). + Sha256 = 0, + + /// XXH3 — faster for large files when the API accepts it. + XxHash3 = 1 + } +} diff --git a/DriveClient/Models/KDriveUploadResponse.cs b/DriveClient/Models/KDriveUploadResponse.cs index 5c606fa..94ebfc2 100644 --- a/DriveClient/Models/KDriveUploadResponse.cs +++ b/DriveClient/Models/KDriveUploadResponse.cs @@ -3,7 +3,7 @@ /// /// KDrive upload response wrapper. /// - public class KDriveUploadResponseWraper : ApiResultBase + public class KDriveUploadResponseWrapper : ApiResultBase { /// /// Result of the upload operation. ("success" or "error") @@ -14,6 +14,11 @@ public class KDriveUploadResponseWraper : ApiResultBase /// Data containing the details of the uploaded file. /// public KDriveUploadDataResponse? Data { get; set; } + + public override string ToString() + { + return $"Result={Result}, HasData={Data is not null}, ExtraDataCount={ExtraDataCount}"; + } } /// @@ -40,6 +45,11 @@ public class KDriveUploadDataResponse : ApiResultBase /// Additional message regarding the upload operation. /// public string? Message { get; set; } + + public override string ToString() + { + return $"Result={Result}, Token={Token}, Message={Message}, File={File?.Name ?? ""}, ExtraDataCount={ExtraDataCount}"; + } } /// @@ -166,5 +176,10 @@ public class KDriveUploadResponse : ApiResultBase /// Antivirus scan status of the file. /// public string? Scan_status { get; set; } + + public override string ToString() + { + return $"Id={Id}, Name={Name}, Path={Path}, DirectoryId={DirectoryId}, ParentId={Parent_id}, Size={Size}, Type={Type}, Status={Status}, Visibility={Visibility}, MimeType={Mime_Type}, Hash={Hash}, ScanStatus={Scan_status}, ExtraDataCount={ExtraDataCount}"; + } } -} \ No newline at end of file +} diff --git a/DriveClient/infomaniak_api_kdrive.json b/DriveClient/infomaniak_api_kdrive.json new file mode 100644 index 0000000..64be67d --- /dev/null +++ b/DriveClient/infomaniak_api_kdrive.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","info":{"title":"API Reference - Developer tools","termsOfService":"https:\/\/www.infomaniak.com\/en\/legal\/general-terms-and-conditions","contact":{"name":"Infomaniak Support","url":"https:\/\/developer.infomaniak.com\/","email":"support@infomaniak.com"},"license":{"name":"MIT License","url":"https:\/\/developer.infomaniak.com\/license"},"version":"1.0.0"},"servers":[{"url":"https:\/\/api.infomaniak.com"}],"paths":{"\/2\/drive":{"get":{"tags":["Drive"],"summary":"Accessibles drives","description":"List of accessible drive for the current connected user","operationId":"kDriveAccessiblesDrivesV2","parameters":[{"description":"Account identifier","required":true,"style":"form","explode":true,"schema":{"title":"account_id","type":"integer","description":"Account identifier"},"name":"account_id","in":"query"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"style":"form","explode":true,"schema":{"title":"in_maintenance","type":"boolean","description":"True for any maintenance, False for no maintenance."},"name":"in_maintenance","in":"query"},{"style":"form","explode":true,"schema":{"title":"maintenance_reasons","type":"array","items":{"title":"item","enum":["demo_end","invoice_overdue","not_renew","technical"],"type":"string","description":"Reason of {name} maintenance.demo_end<\/strong>: The demonstration period of the {name} has come to an end.<\/note>invoice_overdue<\/strong>: An invoice for this {name} is currently unpaid.<\/note>not_renew<\/strong>: This {name} has expired and must be renewed.<\/note>","example":"demo_end"},"description":"Array of maintenance reasons. Ignored if `in_maintenance` is set."},"name":"maintenance_reasons","in":"query"},{"style":"form","explode":true,"schema":{"title":"tags","type":"array","items":{"title":"item","minimum":1,"type":"integer","description":"Id of a tag"},"description":"Array of tag id"},"name":"tags","in":"query"},{"$ref":"#\/components\/parameters\/Page","schema":{"type":"integer","default":1}},{"$ref":"#\/components\/parameters\/PerPage","schema":{"maximum":1000,"minimum":1,"type":"integer","default":"10"}},{"$ref":"#\/components\/parameters\/Total"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_Drive"}}}},{"$ref":"#\/components\/schemas\/Pagination"}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/users":{"get":{"tags":["Users"],"summary":"Get users","description":"Get all the users of each drive","operationId":"kDriveGetUsersV2","parameters":[{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"style":"form","explode":true,"schema":{"title":"search","type":"string","description":"Search a user by his firstname, lastname or email"},"name":"search","in":"query"},{"style":"form","explode":true,"schema":{"title":"user_ids","type":"array","items":{"title":"item","type":"integer"},"description":"User identifier"},"name":"user_ids","in":"query"},{"$ref":"#\/components\/parameters\/Page","schema":{"type":"integer","default":1}},{"$ref":"#\/components\/parameters\/PerPage","schema":{"maximum":1000,"minimum":1,"type":"integer","default":"10"}},{"$ref":"#\/components\/parameters\/Total"},{"$ref":"#\/components\/parameters\/OrderBy","schema":{"enum":["display_name","first_name","last_name"]}},{"$ref":"#\/components\/parameters\/Order"},{"$ref":"#\/components\/parameters\/OrderFor","schema":{"enum":["asc","desc"],"example":"order_for[display_name]=asc"}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_AppUser"}}}},{"$ref":"#\/components\/schemas\/Pagination"}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/users\/{user_id}\/drives":{"get":{"tags":["Users"],"summary":"Get Drives","description":"List of accessible drive of a specific user","operationId":"kDriveGetDrivesV2","parameters":[{"description":"User identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"user_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"description":"The account identifier","required":true,"style":"form","explode":true,"schema":{"title":"account_id","type":"integer","description":"Filter result by account identifier"},"name":"account_id","in":"query"},{"style":"form","explode":true,"schema":{"title":"roles","type":"array","items":{"title":"item","enum":["admin","external","user"],"type":"string","description":"Administration level of the user.admin<\/strong>: Administrator of the drive, can manage the drive (settings, invitations and users) and the files.<\/note>external<\/strong>: External user can only access the files given by the others roles.<\/note>user<\/strong>: Internal user can invite user and manage the files of his private directory and other directories with manage file access.<\/note>","example":"admin"}},"name":"roles","in":"query"},{"style":"form","explode":true,"schema":{"title":"status","type":"array","items":{"title":"item","enum":["active","deleted_kept","deleted_removed","deleted_transferred","deleted_transferring","locked","pending"],"type":"string","description":"Current access status of the user in the drive.active<\/strong>: User has access to the Drive.<\/note>deleted_kept<\/strong>: User has been removed but his data remain in the drive.<\/note>deleted_removed<\/strong>: User has been removed.<\/note>deleted_transferred<\/strong>: User has been removed and his data has been transferred to another user.<\/note>deleted_transferring<\/strong>: User has been removed and is being transferred to another user.<\/note>locked<\/strong>: User has been locked, user can no longer access to the drive.<\/note>pending<\/strong>: User has not accepted the invitation request.<\/note>","example":"active"},"description":"Filter by status, if nothing provided active status is chosen"},"name":"status","in":"query"},{"$ref":"#\/components\/parameters\/Page","schema":{"type":"integer","default":1}},{"$ref":"#\/components\/parameters\/PerPage","schema":{"maximum":1000,"minimum":1,"type":"integer","default":"10"}},{"$ref":"#\/components\/parameters\/Total"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_DriveUser"}}}},{"$ref":"#\/components\/schemas\/Pagination"}]}}}},"401":{"description":"Unauthorized","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 401","type":"object","properties":{"code":{"enum":["not_authorized"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.not_authorized<\/strong>: Triggered when the user is not authorized to access this resource.<\/note>","example":"not_authorized"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"404":{"description":"Not Found","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 404","type":"object","properties":{"code":{"enum":["object_not_found"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.object_not_found<\/strong>: Triggered when the asked entity is not accessible.<\/note>","example":"object_not_found"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/preferences":{"get":{"tags":["Users"],"summary":"Get user's preference","description":"Get the user drive preference ex: notification, date-format, list order etc...","operationId":"kDriveGetUsersPreferenceV2","parameters":[{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Userpreference"}}}]}}}}},"security":[{"bearerAuth":[]}]},"patch":{"tags":["Users"],"summary":"Set user's preference","description":"Update the user drive preference ex: notification, date-format, list order etc...","operationId":"kDriveSetUsersPreferenceV2","requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"date_format":{"title":"date_format","enum":["d F Y","d\/m\/Y","m\/d\/Y"],"type":"string"},"default_drive":{"title":"default_drive","type":"integer"},"density":{"title":"density","enum":["compact","large","normal"],"type":"string"},"list":{"title":"list","type":"object","properties":{"files":{"title":"files","type":"object","properties":{"direction":{"title":"direction","enum":["asc","desc"],"type":"string"},"property":{"title":"property","enum":["last_modified_at","path","size"],"type":"string"}}},"storage_largest":{"title":"storage_largest","type":"object","properties":{"direction":{"title":"direction","enum":["asc","desc"],"type":"string"},"property":{"title":"property","enum":["deleted_at","last_modified_at","path","size"],"type":"string"}}},"storage_versions":{"title":"storage_versions","type":"object","properties":{"direction":{"title":"direction","enum":["asc","desc"],"type":"string"},"property":{"title":"property","enum":["deleted_at","last_modified_at","nb_version","path","size"],"type":"string"}}},"trash":{"title":"trash","type":"object","properties":{"direction":{"title":"direction","enum":["asc","desc"],"type":"string"},"property":{"title":"property","enum":["deleted_at","last_modified_at","path","size"],"type":"string"}}},"view":{"title":"view","enum":["largeGrid","medGrid","smallGrid","table"],"type":"string"}}},"sort_recent_file":{"title":"sort_recent_file","type":"boolean"},"tutorials":{"title":"tutorials","type":"array","items":{"title":"item","maximum":1000,"minimum":15,"type":"integer"}},"use_shortcut":{"title":"use_shortcut","type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/categories\/rights":{"get":{"tags":["Drive > Files > Category > Right"],"summary":"Get","description":"Returns all rights related to categories on drive","operationId":"kDriveGetV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_Categorypermission"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","category_right_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.category_right_error<\/strong>: Action impossible. No permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"category_right_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Drive > Files > Category > Right"],"summary":"Update\/Create","description":"Update or Create rights for categories","operationId":"kDriveUpdateCreateV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"can_create_category":{"title":"can_create_category","type":"boolean"},"can_delete_category":{"title":"can_delete_category","type":"boolean"},"can_edit_category":{"title":"can_edit_category","type":"boolean"},"can_put_category_on_file":{"title":"can_put_category_on_file","type":"boolean"},"can_read_category_on_file":{"title":"can_read_category_on_file","type":"boolean"},"team_id":{"title":"team_id","type":"integer"},"user_id":{"title":"user_id","type":"integer","description":"User identifier"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Categorypermission"}}}]}}}},"400":{"description":"Bad Request","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 400","type":"object","properties":{"code":{"enum":["category_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.category_error<\/strong>: Action impossible, request invalid.<\/note>","example":"category_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","category_right_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.category_right_error<\/strong>: Action impossible. No permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"category_right_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/categories":{"get":{"tags":["Drive > Files > Category"],"summary":"Get All Categories","description":"Return a list of all categories","operationId":"kDriveGetAllCategoriesV2","parameters":[{"description":"Drive Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_Category"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Drive > Files > Category"],"summary":"Create Category","description":"Creates a new category with name and color","operationId":"kDriveCreateCategoryV2","parameters":[{"description":"Drive Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["name"],"type":"object","properties":{"color":{"title":"color","pattern":"^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$","type":"string","example":"#FF1493"},"name":{"title":"name","type":"string","description":"Name of the Category","example":"Invoice"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Category"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/categories\/{category_id}":{"put":{"tags":["Drive > Files > Category"],"summary":"Edit Category","description":"Edits the name and color of a category by identifier","operationId":"kDriveEditCategoryV2","parameters":[{"description":"Drive Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Category Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"category_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"color":{"title":"color","pattern":"^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$","type":"string","example":"#FF1493"},"name":{"title":"name","type":"string","description":"Name of the Category","example":"Invoice"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Category"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Files > Category"],"summary":"Delete Category","description":"Deletes a category by identifier","operationId":"kDriveDeleteCategoryV2","parameters":[{"description":"Drive Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Category Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"category_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/categories\/{category_id}":{"post":{"tags":["Drive > Files > Category"],"summary":"Add category on files","description":"Adds an existing category on a set of files","operationId":"kDriveAddCategoryOnFilesV2","parameters":[{"description":"Drive Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Category Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"category_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["file_ids"],"type":"object","properties":{"file_ids":{"title":"file_ids","type":"array","items":{"title":"item","type":"integer"},"description":"List of files to act upon"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_Feedbackresource"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Files > Category"],"summary":"Remove Category on Files","description":"Removes a category on a set of files","operationId":"kDriveRemoveCategoryOnFilesV2","parameters":[{"description":"Drive Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Category Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"category_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["file_ids"],"type":"object","properties":{"file_ids":{"title":"file_ids","type":"array","items":{"title":"item","type":"integer"},"description":"List of files to act upon"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_Feedbackresource"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/categories\/{category_id}":{"post":{"tags":["Drive > Files > Category"],"summary":"Add Category on File","description":"Add an existing Category on a file","operationId":"kDriveAddCategoryOnFileV2","parameters":[{"description":"Drive Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"Category Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"category_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Feedbackresource"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Files > Category"],"summary":"Remove Category on File","description":"Remove a category on a file","operationId":"kDriveRemoveCategoryOnFileV2","parameters":[{"description":"Drive Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"Category Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"category_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/categories":{"delete":{"tags":["Drive > Files > Category"],"summary":"Remove Categories on File","description":"Removes all categories on a file","operationId":"kDriveRemoveCategoriesOnFileV2","parameters":[{"description":"Drive Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/categories\/{category_id}\/ai-feedback":{"post":{"tags":["Drive > Files > Category"],"summary":"Validates an AI generated Category","description":"Validates the category as correct or incorrect, according to `valid` parameter.","operationId":"kDriveValidatesAnAIGeneratedCategoryV2","parameters":[{"description":"Drive Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"Category Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"category_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["valid"],"type":"object","properties":{"valid":{"title":"valid","type":"boolean","description":"True if category is correct, False if incorrect. Removes category if False."}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/settings":{"get":{"tags":["Drive > Settings"],"summary":"Get drive's settings","description":"Get drive's settings","operationId":"kDriveGetDrivesSettingsV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_DriveSettings"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/settings\/ai":{"put":{"tags":["Drive > Settings"],"summary":"Update IA settings","operationId":"kDriveUpdateIASettingsV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"has_approved":{"title":"has_approved","type":"boolean","description":"If the `User` consents to the AI scan."},"has_approved_ai_categories":{"title":"has_approved_ai_categories","type":"boolean","description":"If the `User` consents to automatic `Categories` on `Files`."},"has_approved_content_search":{"title":"has_approved_content_search","type":"boolean","description":"If the `User` consents to search in `Files` contents."}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"400":{"description":"Bad Request","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 400","type":"object","properties":{"code":{"enum":["content_advanced_search_currently_being_activated_error","content_advanced_search_currently_being_deactivated_error","content_advanced_search_require_base_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.content_advanced_search_require_base_error<\/strong>: Unable to activate document search as this drive does not yet have the new search engine.<\/note>content_advanced_search_currently_being_activated_error<\/strong>: Unable to deactivate document search as it is already being activated.<\/note>content_advanced_search_currently_being_deactivated_error<\/strong>: Unable to activate document search as it is already being deactivated.<\/note>","example":"content_advanced_search_currently_being_deactivated_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"401":{"description":"Unauthorized","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 401","type":"object","properties":{"code":{"enum":["not_authorized"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.not_authorized<\/strong>: Triggered when the user is not authorized to access this resource.<\/note>","example":"not_authorized"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"404":{"description":"Not Found","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 404","type":"object","properties":{"code":{"enum":["object_not_found"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.object_not_found<\/strong>: Triggered when the asked entity is not accessible.<\/note>","example":"object_not_found"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"417":{"description":"Response","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 417","type":"object","properties":{"code":{"enum":["content_advanced_search_not_compatible_with_this_offer_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.content_advanced_search_not_compatible_with_this_offer_error<\/strong>: Unable to activate document search as current kDrive offering is not compatible.<\/note>","example":"content_advanced_search_not_compatible_with_this_offer_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"500":{"description":"Internal Server Error","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 500","type":"object","properties":{"code":{"enum":["cannot_update_object"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.cannot_update_object<\/strong>: Triggered when the entity cannot be updated.<\/note>","example":"cannot_update_object"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/settings\/link":{"put":{"tags":["Drive > Settings"],"summary":"Update ShareLink settings","operationId":"kDriveUpdateShareLinkSettingsV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["activate","bgColor","txtColor"],"type":"object","properties":{"activate":{"title":"activate","type":"boolean"},"bgColor":{"title":"bgColor","pattern":"#[0-9a-fA-F]{3,6}","type":"string"},"images":{"title":"images","type":"array","items":{"title":"item","type":"integer"}},"txtColor":{"title":"txtColor","pattern":"#[0-9a-fA-F]{3,6}","type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"401":{"description":"Unauthorized","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 401","type":"object","properties":{"code":{"enum":["not_authorized"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.not_authorized<\/strong>: Triggered when the user is not authorized to access this resource.<\/note>","example":"not_authorized"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"404":{"description":"Not Found","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 404","type":"object","properties":{"code":{"enum":["object_not_found"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.object_not_found<\/strong>: Triggered when the asked entity is not accessible.<\/note>","example":"object_not_found"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"500":{"description":"Internal Server Error","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 500","type":"object","properties":{"code":{"enum":["cannot_update_object"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.cannot_update_object<\/strong>: Triggered when the entity cannot be updated.<\/note>","example":"cannot_update_object"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/settings\/trash":{"put":{"tags":["Drive > Settings"],"summary":"Update trash settings","description":"Update the trash settings, including the retention period of trashed files","operationId":"kDriveUpdateTrashSettingsV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["max_duration"],"type":"object","properties":{"max_duration":{"title":"max_duration","maximum":365,"minimum":1,"type":"integer","description":"Number of days to keep file in trash. The unit is in days, and the available values depend on your offer.<\/note> check pack.limit.trash.options<\/strong>: \/drive\/{drive_id}<\/a>"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"401":{"description":"Unauthorized","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 401","type":"object","properties":{"code":{"enum":["not_authorized"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.not_authorized<\/strong>: Triggered when the user is not authorized to access this resource.<\/note>","example":"not_authorized"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"404":{"description":"Not Found","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 404","type":"object","properties":{"code":{"enum":["object_not_found"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.object_not_found<\/strong>: Triggered when the asked entity is not accessible.<\/note>","example":"object_not_found"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"500":{"description":"Internal Server Error","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 500","type":"object","properties":{"code":{"enum":["cannot_update_object"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.cannot_update_object<\/strong>: Triggered when the entity cannot be updated.<\/note>","example":"cannot_update_object"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/settings\/office":{"put":{"tags":["Drive > Settings"],"summary":"Update Office settings","description":"Update the office settings, the default opening office editor","operationId":"kDriveUpdateOfficeSettingsV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"form":{"title":"form","enum":["365","onlyoffice"],"type":"string","description":"List of applications.365<\/strong>: The 365 application.<\/note>onlyoffice<\/strong>: The onlyoffice application.<\/note>","example":"365"},"presentation":{"title":"presentation","enum":["365","onlyoffice"],"type":"string","description":"List of applications.365<\/strong>: The 365 application.<\/note>onlyoffice<\/strong>: The onlyoffice application.<\/note>","example":"365"},"spreadsheet":{"title":"spreadsheet","enum":["365","onlyoffice"],"type":"string","description":"List of applications.365<\/strong>: The 365 application.<\/note>onlyoffice<\/strong>: The onlyoffice application.<\/note>","example":"365"},"text":{"title":"text","enum":["365","onlyoffice"],"type":"string","description":"List of applications.365<\/strong>: The 365 application.<\/note>onlyoffice<\/strong>: The onlyoffice application.<\/note>","example":"365"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"401":{"description":"Unauthorized","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 401","type":"object","properties":{"code":{"enum":["not_authorized"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.not_authorized<\/strong>: Triggered when the user is not authorized to access this resource.<\/note>","example":"not_authorized"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"404":{"description":"Not Found","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 404","type":"object","properties":{"code":{"enum":["object_not_found"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.object_not_found<\/strong>: Triggered when the asked entity is not accessible.<\/note>","example":"object_not_found"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"500":{"description":"Internal Server Error","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 500","type":"object","properties":{"code":{"enum":["cannot_update_object"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.cannot_update_object<\/strong>: Triggered when the entity cannot be updated.<\/note>","example":"cannot_update_object"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}":{"get":{"tags":["Drive"],"summary":"Get drive information","description":"Get the drive information","operationId":"kDriveGetDriveInformationV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Drive"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["Drive"],"summary":"Update Drive","description":"Update Drive from a Drive identifier","operationId":"kDriveUpdateDriveV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"bill_reference":{"title":"bill_reference","minLength":2,"type":"string","nullable":true},"customer_name":{"title":"customer_name","maxLength":200,"minLength":2,"type":"string"},"description":{"title":"description","minLength":2,"type":"string","description":"Description of the resource `{name}`","nullable":true}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Drive"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/users":{"get":{"tags":["Drive > Users"],"summary":"Get users","description":"Get all users in a drive","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"style":"form","explode":true,"schema":{"title":"search","type":"string","description":"Search user by his first name, last name or email"},"name":"search","in":"query"},{"style":"form","explode":true,"schema":{"title":"status","type":"array","items":{"title":"item","enum":["active","deleted","locked","pending","withdrawn"],"type":"string"},"description":"Status of the resource `{name}`"},"name":"status","in":"query"},{"style":"form","explode":true,"schema":{"title":"types","type":"array","items":{"title":"item","enum":["admin","external","user"],"type":"string"}},"name":"types","in":"query"},{"style":"form","explode":true,"schema":{"title":"user_ids","maxItems":100,"type":"array","items":{"title":"item","minimum":1,"type":"integer"},"description":"User identifiers"},"name":"user_ids","in":"query"},{"$ref":"#\/components\/parameters\/Page","schema":{"type":"integer","default":1}},{"$ref":"#\/components\/parameters\/PerPage","schema":{"maximum":1000,"minimum":1,"type":"integer","default":"10"}},{"$ref":"#\/components\/parameters\/Total"},{"$ref":"#\/components\/parameters\/OrderBy","schema":{"enum":["display_name","first_name","last_name"]}},{"$ref":"#\/components\/parameters\/Order"},{"$ref":"#\/components\/parameters\/OrderFor","schema":{"enum":["asc","desc"],"example":"order_for[display_name]=asc"}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_DriveUser"}}}},{"$ref":"#\/components\/schemas\/Pagination"}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"deprecated":true,"security":[{"bearerAuth":[]}]},"post":{"tags":["Drive > Users"],"summary":"Create user","description":"Create a new user resource","operationId":"kDriveCreateUserV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["role"],"type":"object","properties":{"emails":{"title":"emails","maxItems":100,"type":"array","items":{"title":"item","type":"string"}},"file_id":{"title":"file_id","type":"integer","description":"For adding a file shared along the invitation.","nullable":true},"lang":{"title":"lang","enum":["de","en","es","fr","it"],"type":"string","description":"Invitation language fallback if user's preference is not found","nullable":true},"message":{"title":"message","type":"string","nullable":true},"name":{"title":"name","maxLength":128,"type":"string","description":"Name of the resource `{name}`","nullable":true},"right":{"title":"right","enum":["manage","none","read","write"],"type":"string","description":"Access level of {name}.manage<\/strong>: Can share, write and read the file.<\/note>none<\/strong>: Can not act on the file.<\/note>read<\/strong>: Can only read the file.<\/note>write<\/strong>: Can write and read the file.<\/note>","nullable":true,"example":"manage"},"role":{"title":"role","enum":["admin","external","user"],"type":"string","description":"Administration level of the user.admin<\/strong>: Administrator of the drive, can manage the drive (settings, invitations and users) and the files.<\/note>external<\/strong>: External user can only access the files given by the others roles.<\/note>user<\/strong>: Internal user can invite user and manage the files of his private directory and other directories with manage file access.<\/note>","example":"admin"},"send_email":{"title":"send_email","type":"boolean"},"team_ids":{"title":"team_ids","maxItems":40,"type":"array","items":{"title":"item","type":"integer"}},"type":{"title":"type","enum":["main","shared"],"type":"string","description":"Type of the access; this field is no longer used and has been replaced by an additional role property `external`.main<\/strong>: User has access to the drive.<\/note>shared<\/strong>: User has access to a shared file \/ directory only.<\/note>","example":"main"},"user_ids":{"title":"user_ids","maxItems":100,"type":"array","items":{"title":"item","type":"integer"}}}}}}},"responses":{"201":{"description":"Created","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_CreateDriveUserResponse"}}}}]}}}},"400":{"description":"One email or user at least required","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["drive_user_quota_reached","one_email_or_user_at_least_required"],"type":"string","description":"Error code","example":"one_email_or_user_at_least_required"},"description":{"enum":["Drive user quota reached","One email or user at least required"],"type":"string","description":"Description of the error","example":"One email or user at least required"}},"description":"Error object"}}}]},"examples":{"One email or user at least required":{"summary":"Example","value":{"result":"error","error":{"code":"one_email_or_user_at_least_required","description":"One email or user at least required","errors":[]}}},"Drive user quota reached":{"summary":"Example","value":{"result":"error","error":{"code":"drive_user_quota_reached","description":"Drive user quota reached","errors":[]}}}}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/users\/invitation":{"get":{"tags":["Drive > Invitations"],"summary":"Get user invitation","description":"List pending user's invitation","operationId":"kDriveGetUserInvitationV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"style":"form","explode":true,"schema":{"title":"emails","type":"array","items":{"title":"item","type":"string"}},"name":"emails","in":"query"},{"style":"form","explode":true,"schema":{"title":"status","type":"array","items":{"title":"item","enum":["accepted","cancelled","expired","pending","rejected"],"type":"string","description":"External file import status.accepted<\/strong>: Invitation has been accepted.<\/note>cancelled<\/strong>: Invitation has been cancelled.<\/note>expired<\/strong>: Invitation is expired.<\/note>pending<\/strong>: Invitation still pending.<\/note>rejected<\/strong>: Invitation has been rejected.<\/note>","example":"accepted"},"description":"Status of the resource `{name}`"},"name":"status","in":"query"},{"style":"form","explode":true,"schema":{"title":"user_ids","type":"array","items":{"title":"item","minimum":1,"type":"integer"}},"name":"user_ids","in":"query"},{"$ref":"#\/components\/parameters\/Page","schema":{"type":"integer","default":1}},{"$ref":"#\/components\/parameters\/PerPage","schema":{"maximum":1000,"minimum":1,"type":"integer","default":10}},{"$ref":"#\/components\/parameters\/Total"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_DriveUserInvitation"}}}},{"$ref":"#\/components\/schemas\/Pagination"}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/users\/invitation\/{invitation_id}":{"get":{"tags":["Drive > Invitations"],"summary":"Get invitation information","description":"Get all invitation information from invitation id","operationId":"kDriveGetInvitationInformationV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Invitation identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"invitation_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_DriveUserInvitation"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["Drive > Invitations"],"summary":"Update an invitation","description":"Update information pertaining to an invitation identified by its invitation id","operationId":"kDriveUpdateAnInvitationV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Invitation identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"invitation_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"email":{"title":"email","type":"string","description":"Email"},"message":{"title":"message","type":"string"},"name":{"title":"name","type":"string","description":"Name of the resource `{name}`"},"right":{"title":"right","enum":["manage","none","read","write"],"type":"string","description":"Access level of {name}.manage<\/strong>: Can share, write and read the file.<\/note>none<\/strong>: Can not act on the file.<\/note>read<\/strong>: Can only read the file.<\/note>write<\/strong>: Can write and read the file.<\/note>","example":"manage"},"role":{"title":"role","enum":["admin","user"],"type":"string","description":"Administration level of the user.admin<\/strong>: Administrator of the drive, can manage the drive (settings, invitations and users) and the files.<\/note>user<\/strong>: Internal user can invite user and manage the files of his private directory and other directories with manage file access.<\/note>","example":"admin"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"400":{"description":"Invitation is already accepted","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["invitation_already_exists_with_this_email","invitation_is_already_accepted"],"type":"string","description":"Error code","example":"invitation_is_already_accepted"},"description":{"enum":["Invitation already exists with this email","Invitation is already accepted"],"type":"string","description":"Description of the error","example":"Invitation is already accepted"}},"description":"Error object"}}}]},"examples":{"Invitation is already accepted":{"summary":"Example","value":{"result":"error","error":{"code":"invitation_is_already_accepted","description":"Invitation is already accepted","errors":[]}}},"Invitation already exists with this email":{"summary":"Example","value":{"result":"error","error":{"code":"invitation_already_exists_with_this_email","description":"Invitation already exists with this email","errors":[]}}}}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Invitations"],"summary":"Delete invitation","description":"Delete an invitation by its invitation id","operationId":"kDriveDeleteInvitationV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Invitation identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"invitation_id","in":"path"},{"style":"form","explode":true,"schema":{"title":"send_email","type":"boolean"},"name":"send_email","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/users\/invitation\/{invitation_id}\/send":{"post":{"tags":["Drive > Invitations"],"summary":"Send invitation","description":"Refresh invitation validity and send email according to invitation type.","operationId":"kDriveSendInvitationV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Invitation identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"invitation_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/users\/{user_id}":{"get":{"tags":["Drive > Users"],"summary":"Get user","description":"Returns a user resource. When no resource is found, the data is empty.","operationId":"kDriveGetUserV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"User Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"user_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_DriveUser"}}}]}}}},"400":{"description":"User not associated with drive","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["user_not_associated_with_drive"],"type":"string","description":"Error code","example":"user_not_associated_with_drive"},"description":{"enum":["User not associated with drive"],"type":"string","description":"Description of the error","example":"User not associated with drive"}},"description":"Error object"}}}]},"examples":{"User not associated with drive":{"summary":"Example","value":{"result":"error","error":{"code":"user_not_associated_with_drive","description":"User not associated with drive","errors":[]}}}}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["Drive > Users"],"summary":"Update user","description":"Update an existing user resource","operationId":"kDriveUpdateUserV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"User Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"user_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"name":{"title":"name","type":"string","description":"Name of the resource `{name}`"},"role":{"title":"role","enum":["admin","user"],"type":"string","description":"Administration level of the user.admin<\/strong>: Administrator of the drive, can manage the drive (settings, invitations and users) and the files.<\/note>user<\/strong>: Internal user can invite user and manage the files of his private directory and other directories with manage file access.<\/note>","example":"admin"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"400":{"description":"Bad Request","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 400","type":"object","properties":{"code":{"enum":["can_not_update_role_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.can_not_update_role_error<\/strong>: User is not allowed to update someone's role.<\/note>","example":"can_not_update_role_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"409":{"description":"Conflict","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 409","type":"object","properties":{"code":{"enum":["drive_user_name_already_exists_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_user_name_already_exists_error<\/strong>: Drive username already exists.<\/note>","example":"drive_user_name_already_exists_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Users"],"summary":"Delete user","description":"Deletes a drive user resource. Also removes all access, share links and invitations associated with the user.","operationId":"kDriveDeleteUserV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"User Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"user_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"notify":{"title":"notify","type":"boolean","description":"Whether the deleted user should be notified by email, false by default."}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/users\/{user_id}\/manager":{"patch":{"tags":["Drive > Users"],"summary":"Update user manager right","description":"Update the role in the manager","operationId":"kDriveUpdateUserManagerRightV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"User Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"user_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["roles"],"type":"object","properties":{"roles":{"title":"roles","type":"array","items":{"title":"item","enum":["statistic","technical"],"type":"string"}}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/users\/{user_id}\/lock":{"post":{"tags":["Drive > Users"],"summary":"Lock user","description":"Sets status to locked, preventing access to drive.","operationId":"kDriveLockUserV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"User Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"user_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"400":{"description":"User not associated with drive","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["user_not_associated_with_drive"],"type":"string","description":"Error code","example":"user_not_associated_with_drive"},"description":{"enum":["User not associated with drive"],"type":"string","description":"Description of the error","example":"User not associated with drive"}},"description":"Error object"}}}]},"examples":{"User not associated with drive":{"summary":"Example","value":{"result":"error","error":{"code":"user_not_associated_with_drive","description":"User not associated with drive","errors":[]}}}}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/users\/{user_id}\/unlock":{"post":{"tags":["Drive > Users"],"summary":"Unlock user","description":"Sets status to active, restoring access to drive.","operationId":"kDriveUnlockUserV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"User Identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"user_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"400":{"description":"User not associated with drive","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["user_not_associated_with_drive"],"type":"string","description":"Error code","example":"user_not_associated_with_drive"},"description":{"enum":["User not associated with drive"],"type":"string","description":"Description of the error","example":"User not associated with drive"}},"description":"Error object"}}}]},"examples":{"User not associated with drive":{"summary":"Example","value":{"result":"error","error":{"code":"user_not_associated_with_drive","description":"User not associated with drive","errors":[]}}}}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/activities":{"get":{"tags":["Drive > Activity"],"summary":"Get drive activities of all the users.","description":"Get all activities from drive as defined in options","operationId":"kDriveGetDriveActivitiesOfAllTheUsersV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"description":"Override the language of the request, in most cases when an e-mail is triggered in the request.","style":"form","explode":true,"schema":{"enum":["de","en","es","fr","it"],"type":"string"},"name":"lang","in":"query"},{"style":"form","explode":true,"schema":{"title":"actions","type":"array","items":{"title":"item","enum":["acl_insert","acl_main_users_insert","acl_main_users_remove","acl_main_users_update","acl_remove","acl_team_insert","acl_team_remove","acl_team_update","acl_update","acl_user_insert","acl_user_remove","acl_user_update","category_create","category_delete","category_update","collaborative_folder_access","collaborative_folder_create","collaborative_folder_delete","collaborative_folder_update","collaborative_user_access","collaborative_user_create","collaborative_user_delete","comment_create","comment_delete","comment_like","comment_resolve","comment_unlike","comment_update","exchange_pro_create","file_access","file_categorize","file_color_delete","file_color_update","file_create","file_delete","file_favorite_create","file_favorite_remove","file_ia_categorize","file_move","file_move_out","file_rename","file_rename_alias","file_restore","file_restore_inherited","file_share_create","file_share_delete","file_share_update","file_trash","file_trash_inherited","file_uncategorize","file_update","file_update_mime_type","maintenance_added","maintenance_removed","rewind_ended","rewind_started","share_link_create","share_link_delete","share_link_show","share_link_update","trash_empty","trash_empty_auto","update_trash_settings","user_connected","user_create","user_delete","user_restore","user_update"],"type":"string","description":"Logged interaction type of activities on the drive or file.acl_insert<\/strong>: Technical: when a new group access to a file\/directory is create.<\/note>acl_main_users_insert<\/strong>: Logged when the main kDrive team access to a file\/directory is created.<\/note>acl_main_users_remove<\/strong>: Logged when the main kDrive team to a file\/directory is removed.<\/note>acl_main_users_update<\/strong>: Logged when the main kDrive team to a file\/directory is modified.<\/note>acl_remove<\/strong>: Technical: when a group access to a file\/directory is removed.<\/note>acl_team_insert<\/strong>: Logged when a team access to a file\/directory is created.<\/note>acl_team_remove<\/strong>: Logged when a team access to a file\/directory is removed.<\/note>acl_team_update<\/strong>: Logged when a team access to a file\/directory is modified.<\/note>acl_update<\/strong>: Technical: when a group access to a file\/directory is modified.<\/note>acl_user_insert<\/strong>: Logged when an user\/admin access to a file\/directory is created.<\/note>acl_user_remove<\/strong>: Logged when an user\/admin access to a file\/directory is removed.<\/note>acl_user_update<\/strong>: Logged when an user\/admin access to a file\/directory is modified.<\/note>category_create<\/strong>: Logged when a new category is added.<\/note>category_delete<\/strong>: Logged when a category is deleted.<\/note>category_update<\/strong>: Logged when a category is renamed.<\/note>collaborative_folder_access<\/strong>: Logged when an user\/guest access to the dropbox.<\/note>collaborative_folder_create<\/strong>: Logged when an user create a dropbox.<\/note>collaborative_folder_delete<\/strong>: Logged when an user delete the dropbox.<\/note>collaborative_folder_update<\/strong>: Logged when an user update settings of the dropbox.<\/note>collaborative_user_access<\/strong>: Logged when an user\/guest upload to the dropbox.<\/note>collaborative_user_create<\/strong>: Logged when an user\/guest add his information before uploading to the dropbox.<\/note>collaborative_user_delete<\/strong>: Logged when an user remove the directory to the dropbox.<\/note>comment_create<\/strong>: Logged when an user\/admin add a comment on a file.<\/note>comment_delete<\/strong>: Logged when an user\/admin delete a comment on a file.<\/note>comment_like<\/strong>: Logged when an user\/admin like a comment on a file.<\/note>comment_resolve<\/strong>: Logged when an user\/admin resolve a comment on a file.<\/note>comment_unlike<\/strong>: Logged when an user\/admin unlike a comment on a file.<\/note>comment_update<\/strong>: Logged when an user\/admin update a comment on a file.<\/note>exchange_pro_create<\/strong>: Technical: no used.<\/note>file_access<\/strong>: Logged when an user\/guest access to the file.<\/note>file_categorize<\/strong>: Logged when a category is added to the file\/directory.<\/note>file_color_delete<\/strong>: Logged when a directory color is removed.<\/note>file_color_update<\/strong>: Logged when a directory color changed.<\/note>file_create<\/strong>: Logged when on the first file creation.<\/note>file_delete<\/strong>: Logged when the file is deleted.<\/note>file_favorite_create<\/strong>: Logged when a file\/directory is flagged as favorites.<\/note>file_favorite_remove<\/strong>: Logged when a file\/directory is unflagged from favorites.<\/note>file_ia_categorize<\/strong>: Logged when a file is categorized by the ia.<\/note>file_move<\/strong>: Logged when the file is added inside a directory.<\/note>file_move_out<\/strong>: Logged when the file is removed from a directory.<\/note>file_rename<\/strong>: Logged when the file is renamed.<\/note>file_rename_alias<\/strong>: Logged when a root file is renamed by an external user (only visible for the external user).<\/note>file_restore<\/strong>: Logged when the file is restored from the trash.<\/note>file_share_create<\/strong>: Logged when an external user access to a file\/directory is created.<\/note>file_share_delete<\/strong>: Logged when an external user access to a file\/directory is removed.<\/note>file_share_update<\/strong>: Logged when an external user access to a file\/directory is modified to another permission.<\/note>file_trash<\/strong>: Logged when the file is sent to trash.<\/note>file_uncategorize<\/strong>: Logged when a category is removed to the file\/directory.<\/note>file_update<\/strong>: Logged when the file is updated.<\/note>file_update_mime_type<\/strong>: Logged when a file mime_type is updated.<\/note>rewind_ended<\/strong>: Logged when the user ended a rewind.<\/note>rewind_started<\/strong>: Logged when the user started a rewind.<\/note>share_link_create<\/strong>: Logged when a public share link to a file\/directory is created.<\/note>share_link_delete<\/strong>: Logged when a public share link to a file\/directory is deleted.<\/note>share_link_show<\/strong>: Logged when a public share link to a file\/directory is seen by someone else.<\/note>share_link_update<\/strong>: Logged when a public share link to a file\/directory is modified.<\/note>trash_empty<\/strong>: Logged when the user empties the trash.<\/note>trash_empty_auto<\/strong>: Logged when the trash empties old files automatically.<\/note>update_trash_settings<\/strong>: Logged when the user changes trash the settings.<\/note>user_connected<\/strong>: Logged when an user is connected to the drive.<\/note>user_create<\/strong>: Logged when an user\/admin is added to the drive.<\/note>user_delete<\/strong>: Logged when an user\/admin has been removed of the drive.<\/note>user_restore<\/strong>: Logged when an user\/admin has been restored of the drive.<\/note>user_update<\/strong>: Logged when an user\/admin information has changed.<\/note>","example":"acl_insert"}},"name":"actions","in":"query"},{"style":"form","explode":true,"schema":{"title":"depth","enum":["children","file","folder","unlimited"],"type":"string"},"name":"depth","in":"query"},{"style":"form","explode":true,"schema":{"title":"files","maxItems":500,"minItems":1,"type":"array","items":{"title":"item","minimum":1,"type":"integer"},"description":"List of files for which to retrieve activities"},"name":"files","in":"query"},{"style":"form","explode":true,"schema":{"title":"from","type":"integer"},"name":"from","in":"query"},{"style":"form","explode":true,"schema":{"title":"terms","minLength":3,"type":"string"},"name":"terms","in":"query"},{"style":"form","explode":true,"schema":{"title":"until","type":"integer"},"name":"until","in":"query"},{"style":"form","explode":true,"schema":{"title":"users","type":"array","items":{"title":"item","type":"integer"}},"name":"users","in":"query"},{"$ref":"#\/components\/parameters\/Page","schema":{"type":"integer","default":1}},{"$ref":"#\/components\/parameters\/PerPage","schema":{"maximum":1000,"minimum":1,"type":"integer","default":10}},{"$ref":"#\/components\/parameters\/Total"},{"$ref":"#\/components\/parameters\/OrderBy","schema":{"enum":["created_at"]}},{"$ref":"#\/components\/parameters\/Order"},{"$ref":"#\/components\/parameters\/OrderFor","schema":{"enum":["asc","desc"],"example":"order_for[created_at]=asc"}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_ActivityFile"}}}},{"$ref":"#\/components\/schemas\/Pagination"}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"deprecated":true,"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/activities\/reports":{"get":{"tags":["Drive > Activity > Report"],"summary":"List reports","description":"List of activity reports.","operationId":"kDriveListReportsV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"style":"form","explode":true,"schema":{"title":"users","type":"array","items":{"title":"item","type":"integer"}},"name":"users","in":"query"},{"$ref":"#\/components\/parameters\/Page","schema":{"type":"integer","default":1}},{"$ref":"#\/components\/parameters\/PerPage","schema":{"maximum":1000,"minimum":1,"type":"integer","default":10}},{"$ref":"#\/components\/parameters\/Total"},{"$ref":"#\/components\/parameters\/OrderBy","schema":{"enum":["created_at","start_at","end_at","status","size"]}},{"$ref":"#\/components\/parameters\/Order"},{"$ref":"#\/components\/parameters\/OrderFor","schema":{"enum":["asc","desc"],"example":"order_for[created_at]=asc"}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_ActivityReport"}}}},{"$ref":"#\/components\/schemas\/Pagination"}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Drive > Activity > Report"],"summary":"Create report","description":"Create a new report.","operationId":"kDriveCreateReportV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Override the language of the request, in most cases when an e-mail is triggered in the request.","style":"form","explode":true,"schema":{"enum":["de","en","es","fr","it"],"type":"string"},"name":"lang","in":"query"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"actions":{"title":"actions","type":"array","items":{"title":"item","enum":["acl_insert","acl_main_users_insert","acl_main_users_remove","acl_main_users_update","acl_remove","acl_team_insert","acl_team_remove","acl_team_update","acl_update","acl_user_insert","acl_user_remove","acl_user_update","category_create","category_delete","category_update","collaborative_folder_access","collaborative_folder_create","collaborative_folder_delete","collaborative_folder_update","collaborative_user_access","collaborative_user_create","collaborative_user_delete","comment_create","comment_delete","comment_like","comment_resolve","comment_unlike","comment_update","exchange_pro_create","file_access","file_categorize","file_color_delete","file_color_update","file_create","file_delete","file_favorite_create","file_favorite_remove","file_ia_categorize","file_move","file_move_out","file_rename","file_rename_alias","file_restore","file_restore_inherited","file_share_create","file_share_delete","file_share_update","file_trash","file_trash_inherited","file_uncategorize","file_update","file_update_mime_type","maintenance_added","maintenance_removed","rewind_ended","rewind_started","share_link_create","share_link_delete","share_link_show","share_link_update","trash_empty","trash_empty_auto","update_trash_settings","user_connected","user_create","user_delete","user_restore","user_update"],"type":"string","description":"Logged interaction type of activities on the drive or file.acl_insert<\/strong>: Technical: when a new group access to a file\/directory is create.<\/note>acl_main_users_insert<\/strong>: Logged when the main kDrive team access to a file\/directory is created.<\/note>acl_main_users_remove<\/strong>: Logged when the main kDrive team to a file\/directory is removed.<\/note>acl_main_users_update<\/strong>: Logged when the main kDrive team to a file\/directory is modified.<\/note>acl_remove<\/strong>: Technical: when a group access to a file\/directory is removed.<\/note>acl_team_insert<\/strong>: Logged when a team access to a file\/directory is created.<\/note>acl_team_remove<\/strong>: Logged when a team access to a file\/directory is removed.<\/note>acl_team_update<\/strong>: Logged when a team access to a file\/directory is modified.<\/note>acl_update<\/strong>: Technical: when a group access to a file\/directory is modified.<\/note>acl_user_insert<\/strong>: Logged when an user\/admin access to a file\/directory is created.<\/note>acl_user_remove<\/strong>: Logged when an user\/admin access to a file\/directory is removed.<\/note>acl_user_update<\/strong>: Logged when an user\/admin access to a file\/directory is modified.<\/note>category_create<\/strong>: Logged when a new category is added.<\/note>category_delete<\/strong>: Logged when a category is deleted.<\/note>category_update<\/strong>: Logged when a category is renamed.<\/note>collaborative_folder_access<\/strong>: Logged when an user\/guest access to the dropbox.<\/note>collaborative_folder_create<\/strong>: Logged when an user create a dropbox.<\/note>collaborative_folder_delete<\/strong>: Logged when an user delete the dropbox.<\/note>collaborative_folder_update<\/strong>: Logged when an user update settings of the dropbox.<\/note>collaborative_user_access<\/strong>: Logged when an user\/guest upload to the dropbox.<\/note>collaborative_user_create<\/strong>: Logged when an user\/guest add his information before uploading to the dropbox.<\/note>collaborative_user_delete<\/strong>: Logged when an user remove the directory to the dropbox.<\/note>comment_create<\/strong>: Logged when an user\/admin add a comment on a file.<\/note>comment_delete<\/strong>: Logged when an user\/admin delete a comment on a file.<\/note>comment_like<\/strong>: Logged when an user\/admin like a comment on a file.<\/note>comment_resolve<\/strong>: Logged when an user\/admin resolve a comment on a file.<\/note>comment_unlike<\/strong>: Logged when an user\/admin unlike a comment on a file.<\/note>comment_update<\/strong>: Logged when an user\/admin update a comment on a file.<\/note>exchange_pro_create<\/strong>: Technical: no used.<\/note>file_access<\/strong>: Logged when an user\/guest access to the file.<\/note>file_categorize<\/strong>: Logged when a category is added to the file\/directory.<\/note>file_color_delete<\/strong>: Logged when a directory color is removed.<\/note>file_color_update<\/strong>: Logged when a directory color changed.<\/note>file_create<\/strong>: Logged when on the first file creation.<\/note>file_delete<\/strong>: Logged when the file is deleted.<\/note>file_favorite_create<\/strong>: Logged when a file\/directory is flagged as favorites.<\/note>file_favorite_remove<\/strong>: Logged when a file\/directory is unflagged from favorites.<\/note>file_ia_categorize<\/strong>: Logged when a file is categorized by the ia.<\/note>file_move<\/strong>: Logged when the file is added inside a directory.<\/note>file_move_out<\/strong>: Logged when the file is removed from a directory.<\/note>file_rename<\/strong>: Logged when the file is renamed.<\/note>file_rename_alias<\/strong>: Logged when a root file is renamed by an external user (only visible for the external user).<\/note>file_restore<\/strong>: Logged when the file is restored from the trash.<\/note>file_share_create<\/strong>: Logged when an external user access to a file\/directory is created.<\/note>file_share_delete<\/strong>: Logged when an external user access to a file\/directory is removed.<\/note>file_share_update<\/strong>: Logged when an external user access to a file\/directory is modified to another permission.<\/note>file_trash<\/strong>: Logged when the file is sent to trash.<\/note>file_uncategorize<\/strong>: Logged when a category is removed to the file\/directory.<\/note>file_update<\/strong>: Logged when the file is updated.<\/note>file_update_mime_type<\/strong>: Logged when a file mime_type is updated.<\/note>rewind_ended<\/strong>: Logged when the user ended a rewind.<\/note>rewind_started<\/strong>: Logged when the user started a rewind.<\/note>share_link_create<\/strong>: Logged when a public share link to a file\/directory is created.<\/note>share_link_delete<\/strong>: Logged when a public share link to a file\/directory is deleted.<\/note>share_link_show<\/strong>: Logged when a public share link to a file\/directory is seen by someone else.<\/note>share_link_update<\/strong>: Logged when a public share link to a file\/directory is modified.<\/note>trash_empty<\/strong>: Logged when the user empties the trash.<\/note>trash_empty_auto<\/strong>: Logged when the trash empties old files automatically.<\/note>update_trash_settings<\/strong>: Logged when the user changes trash the settings.<\/note>user_connected<\/strong>: Logged when an user is connected to the drive.<\/note>user_create<\/strong>: Logged when an user\/admin is added to the drive.<\/note>user_delete<\/strong>: Logged when an user\/admin has been removed of the drive.<\/note>user_restore<\/strong>: Logged when an user\/admin has been restored of the drive.<\/note>user_update<\/strong>: Logged when an user\/admin information has changed.<\/note>","example":"acl_insert"}},"depth":{"title":"depth","enum":["children","file","folder","unlimited"],"type":"string"},"files":{"title":"files","maxItems":500,"minItems":1,"type":"array","items":{"title":"item","minimum":1,"type":"integer"},"description":"List of files for which to retrieve activities"},"from":{"title":"from","type":"integer"},"lang":{"title":"lang","enum":["de","en","es","fr","it"],"type":"string","description":"Invitation language fallback if user's preference is not found","nullable":true},"terms":{"title":"terms","minLength":3,"type":"string"},"until":{"title":"until","type":"integer"},"user_id":{"title":"user_id","type":"integer","description":"User identifier","nullable":true},"users":{"title":"users","type":"array","items":{"title":"item","type":"integer"}}}}}}},"responses":{"201":{"description":"Created","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"integer"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/activities\/reports\/{report_id}":{"get":{"tags":["Drive > Activity > Report"],"summary":"Get report","description":"Get activity report.","operationId":"kDriveGetReportV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Report identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"report_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"$ref":"#\/components\/parameters\/Page","schema":{"type":"integer","default":1}},{"$ref":"#\/components\/parameters\/PerPage","schema":{"maximum":1000,"minimum":1,"type":"integer","default":10}},{"$ref":"#\/components\/parameters\/Total"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_ActivityReport"}}},{"$ref":"#\/components\/schemas\/Pagination"}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Activity > Report"],"summary":"Delete report","description":"Delete report.","operationId":"kDriveDeleteReportV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Report identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"report_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"404":{"description":"Not Found","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 404","type":"object","properties":{"code":{"enum":["object_not_found"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.object_not_found<\/strong>: Triggered when the asked entity is not accessible.<\/note>","example":"object_not_found"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/activities\/reports\/{report_id}\/export":{"get":{"tags":["Drive > Activity > Report"],"summary":"Export report","description":"Download\/Export report.","operationId":"kDriveExportReportV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Report identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"report_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/csv":{"schema":{"$ref":"#\/components\/schemas\/91ac10ff_Stream"}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"404":{"description":"Not Found","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 404","type":"object","properties":{"code":{"enum":["report_does_not_exist_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.report_does_not_exist_error<\/strong>: Report not found.<\/note>","example":"report_does_not_exist_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/statistics\/sizes":{"get":{"tags":["Drive > Statistics"],"summary":"Chart : files size","description":"Chart data, list files size value over time","operationId":"kDriveChartFilesSizeV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"required":true,"style":"form","explode":true,"schema":{"title":"from","maximum":253402300799,"type":"integer","description":"Date from which to get statistics in unix-timestamp format"},"name":"from","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"interval","maximum":720,"minimum":1,"type":"integer","description":"Statistics hours interval between from and until"},"name":"interval","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"metrics","type":"array","items":{"title":"item","enum":["files","trash","versions"],"type":"string"}},"name":"metrics","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"until","maximum":253402300799,"type":"integer","description":"Date until when to get statistics in unix-timestamp format"},"name":"until","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Chart"}}}]}}}},"400":{"description":"Bad Request","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 400","type":"object","properties":{"code":{"enum":["no_metrics_requested_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.no_metrics_requested_error<\/strong>: No metrics were requested.<\/note>","example":"no_metrics_requested_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"500":{"description":"Internal Server Error","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 500","type":"object","properties":{"code":{"enum":["unexpected_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.unexpected_error<\/strong>: Triggered when something unknown happens.<\/note>","example":"unexpected_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/statistics\/sizes\/export":{"get":{"tags":["Drive > Statistics"],"summary":"Export : files size","description":"Exports sizes statistics as csv file","operationId":"kDriveExportFilesSizeV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"required":true,"style":"form","explode":true,"schema":{"title":"from","maximum":253402300799,"type":"integer","description":"Date from which to get statistics in unix-timestamp format"},"name":"from","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"interval","maximum":720,"minimum":1,"type":"integer","description":"Statistics hours interval between from and until"},"name":"interval","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"metrics","type":"array","items":{"title":"item","enum":["files","trash","versions"],"type":"string"}},"name":"metrics","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"until","maximum":253402300799,"type":"integer","description":"Date until when to get statistics in unix-timestamp format"},"name":"until","in":"query"}],"responses":{"200":{"description":"OK","content":{"text\/csv":{"schema":{"$ref":"#\/components\/schemas\/91ac10ff_Stream"}}}},"400":{"description":"Bad Request","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 400","type":"object","properties":{"code":{"enum":["no_metrics_requested_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.no_metrics_requested_error<\/strong>: No metrics were requested.<\/note>","example":"no_metrics_requested_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"500":{"description":"Internal Server Error","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 500","type":"object","properties":{"code":{"enum":["unexpected_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.unexpected_error<\/strong>: Triggered when something unknown happens.<\/note>","example":"unexpected_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/statistics\/activities\/users":{"get":{"tags":["Drive > Statistics"],"summary":"Activities : Users","operationId":"kDriveActivitiesUsersV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"required":true,"style":"form","explode":true,"schema":{"title":"from","maximum":253402300799,"type":"integer","description":"Date from which to get statistics in unix-timestamp format"},"name":"from","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"until","maximum":253402300799,"type":"integer","description":"Date until when to get statistics in unix-timestamp format"},"name":"until","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_ActiveMembers"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/statistics\/activities\/shared_files":{"get":{"tags":["Drive > Statistics"],"summary":"Activities : Shared files","operationId":"kDriveActivitiesSharedFilesV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"required":true,"style":"form","explode":true,"schema":{"title":"from","maximum":253402300799,"type":"integer","description":"Date from which to get statistics in unix-timestamp format"},"name":"from","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"until","maximum":253402300799,"type":"integer","description":"Date until when to get statistics in unix-timestamp format"},"name":"until","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_Sharefile"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/statistics\/activities":{"get":{"tags":["Drive > Statistics"],"summary":"Chart : Activities","description":"Chart data of activities metrics over time","operationId":"kDriveChartActivitiesV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"required":true,"style":"form","explode":true,"schema":{"title":"from","maximum":253402300799,"type":"integer","description":"Date from which to get statistics in unix-timestamp format"},"name":"from","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"interval","maximum":720,"minimum":1,"type":"integer","description":"Statistics hours interval between from and until"},"name":"interval","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"metric","enum":["devices","shared_files","users"],"type":"string"},"name":"metric","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"until","maximum":253402300799,"type":"integer","description":"Date until when to get statistics in unix-timestamp format"},"name":"until","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Chart"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/statistics\/activities\/export":{"get":{"tags":["Drive > Statistics"],"summary":"Export : Activities","description":"Exports activities statistics","operationId":"kDriveExportActivitiesV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"required":true,"style":"form","explode":true,"schema":{"title":"from","maximum":253402300799,"type":"integer","description":"Date from which to get statistics in unix-timestamp format"},"name":"from","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"interval","maximum":720,"minimum":1,"type":"integer","description":"Statistics hours interval between from and until"},"name":"interval","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"metric","enum":["devices","shared_files","users"],"type":"string"},"name":"metric","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"until","maximum":253402300799,"type":"integer","description":"Date until when to get statistics in unix-timestamp format"},"name":"until","in":"query"}],"responses":{"200":{"description":"OK","content":{"text\/csv":{"schema":{"$ref":"#\/components\/schemas\/91ac10ff_Stream"}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/statistics\/activities\/links":{"get":{"tags":["Drive > Statistics"],"summary":"Activities : ShareLinks","operationId":"kDriveActivitiesShareLinksV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"from","maximum":253402300799,"type":"integer","description":"Date from which to get statistics in unix-timestamp format"},"name":"from","in":"query"},{"style":"form","explode":true,"schema":{"title":"max_view","type":"integer","description":"Filter result by a maximum view"},"name":"max_view","in":"query"},{"style":"form","explode":true,"schema":{"title":"min_view","type":"integer","description":"Filter result by a minimum view"},"name":"min_view","in":"query"},{"style":"form","explode":true,"schema":{"title":"rights","type":"array","items":{"title":"item","enum":["inherit","password","public"],"type":"string","description":"Rights required to view the share link.inherit<\/strong>: Share link is accessible only by users of the drive.<\/note>password<\/strong>: Share link is public but protected by a password.<\/note>public<\/strong>: Share link is public, no restriction set.<\/note>","example":"inherit"}},"name":"rights","in":"query"},{"style":"form","explode":true,"schema":{"title":"search","type":"string","description":" Search the exact match of share link filename when file is asked."},"name":"search","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"until","maximum":253402300799,"type":"integer","description":"Date until when to get statistics in unix-timestamp format"},"name":"until","in":"query"},{"style":"form","explode":true,"schema":{"title":"valid_until","maximum":253402300799,"type":"integer","description":"Filter result by valid_until date","nullable":true},"name":"valid_until","in":"query"},{"$ref":"#\/components\/parameters\/Page","schema":{"type":"integer","default":1}},{"$ref":"#\/components\/parameters\/PerPage","schema":{"maximum":1000,"minimum":1,"type":"integer","default":10}},{"$ref":"#\/components\/parameters\/Total"},{"$ref":"#\/components\/parameters\/OrderBy","schema":{"enum":["unique_views","views","files.path","relevance"]}},{"$ref":"#\/components\/parameters\/Order"},{"$ref":"#\/components\/parameters\/OrderFor","schema":{"enum":["asc","desc"],"example":"order_for[unique_views]=asc"}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_StatisticSharelink"}}}},{"$ref":"#\/components\/schemas\/Pagination"}]}}}},"401":{"description":"Unauthorized","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 401","type":"object","properties":{"code":{"enum":["not_authorized"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.not_authorized<\/strong>: Triggered when the user is not authorized to access this resource.<\/note>","example":"not_authorized"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/statistics\/activities\/links\/export":{"get":{"tags":["Drive > Statistics"],"summary":"Export : ShareLinks Activities","operationId":"kDriveExportShareLinksActivitiesV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"required":true,"style":"form","explode":true,"schema":{"title":"from","maximum":253402300799,"type":"integer","description":"Date from which to get statistics in unix-timestamp format"},"name":"from","in":"query"},{"style":"form","explode":true,"schema":{"title":"max_view","type":"integer","description":"Filter result by a maximum view"},"name":"max_view","in":"query"},{"style":"form","explode":true,"schema":{"title":"min_view","type":"integer","description":"Filter result by a minimum view"},"name":"min_view","in":"query"},{"style":"form","explode":true,"schema":{"title":"rights","type":"array","items":{"title":"item","enum":["inherit","password","public"],"type":"string","description":"Rights required to view the share link.inherit<\/strong>: Share link is accessible only by users of the drive.<\/note>password<\/strong>: Share link is public but protected by a password.<\/note>public<\/strong>: Share link is public, no restriction set.<\/note>","example":"inherit"}},"name":"rights","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"until","maximum":253402300799,"type":"integer","description":"Date until when to get statistics in unix-timestamp format"},"name":"until","in":"query"},{"style":"form","explode":true,"schema":{"title":"valid_until","maximum":253402300799,"type":"integer","description":"Filter result by valid_until date","nullable":true},"name":"valid_until","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_ShareLink"}}}}]}}}},"401":{"description":"Unauthorized","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 401","type":"object","properties":{"code":{"enum":["not_authorized"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.not_authorized<\/strong>: Triggered when the user is not authorized to access this resource.<\/note>","example":"not_authorized"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/preferences":{"put":{"tags":["Drive > Settings"],"summary":"Update Preferences","description":"Updates the connected user preference for a drive.","operationId":"kDriveUpdatePreferencesV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"color":{"title":"color","pattern":"^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$","type":"string"},"default_page":{"title":"default_page","enum":["common","dropbox","favorite","last_modified","links","my_shared","private","shared_with_me","statistics","trash"],"type":"string"},"hide":{"title":"hide","type":"boolean"},"ui":{"title":"ui","type":"object","properties":{"rag_ocr_promotion":{"title":"rag_ocr_promotion","type":"boolean","description":"Display a promotion message about the RAG OCR if the user has not seen it yet"},"storage_limit_alert":{"title":"storage_limit_alert","type":"boolean","description":"Display an alert when storage limit has been reached"},"storage_warning_alert":{"title":"storage_warning_alert","type":"boolean","description":"Display an alert when storage limit is about to be reached"}}}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"400":{"description":"User not associated with drive","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["user_not_associated_with_drive"],"type":"string","description":"Error code","example":"user_not_associated_with_drive"},"description":{"enum":["User not associated with drive"],"type":"string","description":"Description of the error","example":"User not associated with drive"}},"description":"Error object"}}}]},"examples":{"User not associated with drive":{"summary":"Example","value":{"result":"error","error":{"code":"user_not_associated_with_drive","description":"User not associated with drive","errors":[]}}}}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/imports":{"get":{"tags":["Drive > Files > External import"],"summary":"List imports","description":"List all external imports for the current user","operationId":"kDriveListImportsV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"$ref":"#\/components\/parameters\/Page","schema":{"type":"integer","default":1}},{"$ref":"#\/components\/parameters\/PerPage","schema":{"maximum":1000,"minimum":1,"type":"integer","default":10}},{"$ref":"#\/components\/parameters\/Total"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_ExternalImport"}}}},{"$ref":"#\/components\/schemas\/Pagination"}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Files > External import"],"summary":"Clean imports history","description":"Clean imports history for the current user.","operationId":"kDriveCleanImportsHistoryV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/imports\/sharelink":{"post":{"tags":["Drive > Files > External import"],"summary":"Import kDrive sharelink","description":"Import the content of a kDrive sharelink","operationId":"kDriveImportKDriveSharelinkV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["destination_folder_id","sharelink_uuid","source_drive_id"],"type":"object","properties":{"destination_folder_id":{"title":"destination_folder_id","type":"string","description":"ID of the destination folder for the copy"},"except_file_ids":{"title":"except_file_ids","type":"array","items":{"title":"item","type":"integer"},"description":"Ids of files to be imported. If missing or empty, all files of the share link will be imported"},"file_ids":{"title":"file_ids","type":"array","items":{"title":"item","type":"integer"},"description":"Ids of files to be imported. If missing or empty, all files of the share link will be imported"},"password":{"title":"password","type":"string","description":"Password to access the sharelink, if password-protected"},"sharelink_token":{"title":"sharelink_token","pattern":"[a-zA-Z0-9+\/=]+","type":"string","description":"Encrypted, base64 sharelink token to use for password-protected sharelink instead of clear password"},"sharelink_uuid":{"title":"sharelink_uuid","maxLength":36,"pattern":"^[A-Za-z0-9_-]+$","type":"string","description":"UUID of the share link to import"},"source_drive_id":{"title":"source_drive_id","type":"integer","description":"ID of the kDrive containing the sharelink to copy"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_ExternalImport"}}}}]}}}},"400":{"description":"Bad Request","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 400","type":"object","properties":{"code":{"enum":["quota_exceeded_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.quota_exceeded_error<\/strong>: Triggered when the quota storage of the drive is reached.<\/note>","example":"quota_exceeded_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"422":{"description":"Unprocessable Entity","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 422","type":"object","properties":{"code":{"enum":["external_import_in_progress_in_directory_error","external_import_unsupported_app_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.external_import_in_progress_in_directory_error<\/strong>: Cannot perform action on the directory because an external import is in progress.<\/note>external_import_unsupported_app_error<\/strong>: The provided application is unsupported and cannot be used for an external import.<\/note>","example":"external_import_unsupported_app_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/imports\/kdrive":{"post":{"tags":["Drive > Files > External import"],"summary":"Import kDrive","description":"Import the content of a kDrive","operationId":"kDriveImportKDriveV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["application_drive_id","directory_id"],"type":"object","properties":{"application_drive_id":{"title":"application_drive_id","type":"string","description":"Id of the kDrive containing the content to import"},"directory_id":{"title":"directory_id","type":"integer","description":"Destination directory identifier"},"source_path":{"title":"source_path","type":"string","description":"Path of the folder to import, if different from the root"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_ExternalImport"}}}}]}}}},"400":{"description":"Bad Request","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 400","type":"object","properties":{"code":{"enum":["quota_exceeded_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.quota_exceeded_error<\/strong>: Triggered when the quota storage of the drive is reached.<\/note>","example":"quota_exceeded_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"422":{"description":"Unprocessable Entity","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 422","type":"object","properties":{"code":{"enum":["external_import_in_progress_in_directory_error","external_import_unsupported_app_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.external_import_in_progress_in_directory_error<\/strong>: Cannot perform action on the directory because an external import is in progress.<\/note>external_import_unsupported_app_error<\/strong>: The provided application is unsupported and cannot be used for an external import.<\/note>","example":"external_import_unsupported_app_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/imports\/webdav":{"post":{"tags":["Drive > Files > External import"],"summary":"Import WebDAV app","description":"Import files and folders from a third party app supporting WebDAV","operationId":"kDriveImportWebDAVAppV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["application","directory_id","endpoint","login","password"],"type":"object","properties":{"application":{"title":"application","enum":["kdrive","nextcloud","owncloud","webdav"],"type":"string","description":"Supported service or third-party service identifier for external import.kdrive<\/strong>: Import from another kDrive.<\/note>nextcloud<\/strong>: Import from Nextcloud.<\/note>owncloud<\/strong>: Import from ownCloud.<\/note>webdav<\/strong>: Import from a generic WebDAV provider.<\/note>","example":"kdrive"},"directory_id":{"title":"directory_id","type":"integer","description":"Destination directory identifier"},"endpoint":{"title":"endpoint","type":"string","description":"Webdav endpoint"},"login":{"title":"login","maxLength":320,"type":"string","description":"Webdav login"},"password":{"title":"password","type":"string","description":"Webdav password"},"source_path":{"title":"source_path","type":"string","description":"Path of the folder to import, if different from the root"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_ExternalImport"}}}}]}}}},"400":{"description":"Bad Request","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 400","type":"object","properties":{"code":{"enum":["quota_exceeded_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.quota_exceeded_error<\/strong>: Triggered when the quota storage of the drive is reached.<\/note>","example":"quota_exceeded_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"422":{"description":"Unprocessable Entity","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 422","type":"object","properties":{"code":{"enum":["external_import_in_progress_in_directory_error","external_import_unsupported_app_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.external_import_in_progress_in_directory_error<\/strong>: Cannot perform action on the directory because an external import is in progress.<\/note>external_import_unsupported_app_error<\/strong>: The provided application is unsupported and cannot be used for an external import.<\/note>","example":"external_import_unsupported_app_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/imports\/oauth":{"post":{"tags":["Drive > Files > External import"],"summary":"Import OAuth2 app","description":"Import files and folders from a third party app supporting OAuth2","operationId":"kDriveImportOAuth2AppV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["application","directory_id"],"type":"object","properties":{"access_token_id":{"title":"access_token_id","type":"integer","description":"ID of the authentication token for the application"},"application":{"title":"application","enum":["dropbox","onedrive"],"type":"string","description":"Supported service or third-party service identifier for external import.dropbox<\/strong>: Import from Dropbox.<\/note>onedrive<\/strong>: Import from Microsoft OneDrive.<\/note>","example":"dropbox"},"application_drive_id":{"title":"application_drive_id","pattern":"^[A-Za-z0-9_!-]+$","type":"string","description":"Application drive id selected"},"auth_code":{"title":"auth_code","maxLength":12288,"minLength":40,"pattern":"^[a-zA-Z0-9\\-._~\\+!\\\/\\*]+\\$*$","type":"string","description":"Authentication code of the application"},"directory_id":{"title":"directory_id","type":"integer","description":"Destination directory identifier"},"skip_shared_files":{"title":"skip_shared_files","type":"boolean","description":"Skip shared files during the import, if the application supports it"},"source_path":{"title":"source_path","type":"string","description":"Path of the folder to import, if different from the root"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_ExternalImport"}}}}]}}}},"400":{"description":"Bad Request","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 400","type":"object","properties":{"code":{"enum":["quota_exceeded_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.quota_exceeded_error<\/strong>: Triggered when the quota storage of the drive is reached.<\/note>","example":"quota_exceeded_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"422":{"description":"Unprocessable Entity","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 422","type":"object","properties":{"code":{"enum":["external_import_in_progress_in_directory_error","external_import_unsupported_app_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.external_import_in_progress_in_directory_error<\/strong>: Cannot perform action on the directory because an external import is in progress.<\/note>external_import_unsupported_app_error<\/strong>: The provided application is unsupported and cannot be used for an external import.<\/note>","example":"external_import_unsupported_app_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/imports\/oauth\/drives":{"get":{"tags":["Drive > Files > External import"],"summary":"List eligible drives","description":"List all drives eligible for import for the given third party application supporting OAuth2","operationId":"kDriveListEligibleDrivesV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"style":"form","explode":true,"schema":{"title":"access_token_id","type":"integer","description":"ID of the authentication token for the application"},"name":"access_token_id","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"application","enum":["dropbox","onedrive"],"type":"string","description":"Supported service or third-party service identifier for external import.dropbox<\/strong>: Import from Dropbox.<\/note>onedrive<\/strong>: Import from Microsoft OneDrive.<\/note>","example":"dropbox"},"name":"application","in":"query"},{"style":"form","explode":true,"schema":{"title":"auth_code","maxLength":12288,"minLength":40,"pattern":"^[a-zA-Z0-9\\-._~\\+!\\\/\\*]+\\$*$","type":"string","description":"Authentication code of the application"},"name":"auth_code","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Thirdpartydriveslist"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"404":{"description":"Not Found","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 404","type":"object","properties":{"code":{"enum":["not_found_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.not_found_error<\/strong>: The requested data was not found.<\/note>","example":"not_found_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"422":{"description":"Unprocessable Entity","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 422","type":"object","properties":{"code":{"enum":["external_import_unsupported_app_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.external_import_unsupported_app_error<\/strong>: The provided application is unsupported and cannot be used for an external import.<\/note>","example":"external_import_unsupported_app_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/imports\/{import_id}":{"get":{"tags":["Drive > Files > External import"],"summary":"List errored import files","description":"List all files which couldn't be imported properly.","operationId":"kDriveListErroredImportFilesV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"External import identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"import_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"$ref":"#\/components\/parameters\/Page","schema":{"type":"integer","default":1}},{"$ref":"#\/components\/parameters\/PerPage","schema":{"maximum":1000,"minimum":1,"type":"integer","default":10}},{"$ref":"#\/components\/parameters\/Total"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_ExternalImportFile"}}}},{"$ref":"#\/components\/schemas\/Pagination"}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Files > External import"],"summary":"Delete import","description":"Delete a external import","operationId":"kDriveDeleteImportV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"External import identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"import_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"422":{"description":"Unprocessable Entity","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 422","type":"object","properties":{"code":{"enum":["external_import_unsuitable_status_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.external_import_unsuitable_status_error<\/strong>: The provided import is not in a suitable status for this operation.<\/note>","example":"external_import_unsuitable_status_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/imports\/{import_id}\/cancel":{"put":{"tags":["Drive > Files > External import"],"summary":"Cancel import","description":"Cancel an external import.\nThis returns with a success if the import is already canceled or has ended.\n\nActual cancellation may take up to a few minutes to be effective","operationId":"kDriveCancelImportV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"External import identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"import_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/cancel":{"post":{"tags":["Drive > Files > Action"],"summary":"Undo action","description":"Cancel an action with a token or cancel actions with tokens.\nAn action token is a token returned with a CancelResource.\nUsed in bulk processes or specific actions like renaming a file.","operationId":"kDriveUndoActionV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"cancel_id":{"title":"cancel_id","pattern":"^[0-9a-f\\-]{36}$","type":"string","description":"The cancel identifier","example":"00000000-e89b-12d3-a456-000000000000"},"cancel_ids":{"title":"cancel_ids","type":"array","items":{"title":"item","pattern":"^[0-9a-f\\-]{36}$","type":"string","example":"00000000-e89b-12d3-a456-000000000000"},"description":"The cancel identifiers"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#\/components\/schemas\/91ac10ff_UUIDFeedbackresource"},{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_UUIDFeedbackresource"}}]}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"404":{"description":"Not Found","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 404","type":"object","properties":{"code":{"enum":["object_not_found"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.object_not_found<\/strong>: Triggered when the asked entity is not accessible.<\/note>","example":"object_not_found"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"500":{"description":"Internal Server Error","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 500","type":"object","properties":{"code":{"enum":["unexpected_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.unexpected_error<\/strong>: Triggered when something unknown happens.<\/note>","example":"unexpected_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/access\/requests\/{request_id}":{"get":{"tags":["Drive > Files > File\/Directory > Access > Request"],"summary":"Get requested file access from its id","description":"Show a given requested file access","operationId":"kDriveGetRequestedFileAccessFromItsIdV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"request_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_SanitizedFileAccessRequest"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/access\/requests\/{request_id}\/decline":{"put":{"tags":["Drive > Files > File\/Directory > Access > Request"],"summary":"Decline a file access request","description":"Decline a file access request","operationId":"kDriveDeclineAFileAccessRequestV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"request_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_SanitizedFileAccessRequest"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}":{"delete":{"tags":["Drive > Files > File\/Directory"],"summary":"Trash","description":"Trash a file, move it to the trash can.","operationId":"kDriveTrashV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_CancelResource"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"500":{"description":"Internal Server Error","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 500","type":"object","properties":{"code":{"enum":["cannot_delete_object"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.cannot_delete_object<\/strong>: Triggered when the entity cannot be deleted.<\/note>","example":"cannot_delete_object"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/favorite":{"post":{"tags":["Drive > Files > Favorite"],"summary":"Favorite file","description":"Add a file in the favorites","operationId":"kDriveFavoriteFileV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"responses":{"201":{"description":"Created","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Files > Favorite"],"summary":"Unfavorite file","description":"Remove a file from the favorites","operationId":"kDriveUnfavoriteFileV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/thumbnail":{"get":{"tags":["Drive > Files > File\/Directory"],"summary":"Thumbnail","description":"Get file thumbnail.","operationId":"kDriveThumbnailV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"style":"form","explode":true,"schema":{"title":"height","maximum":400,"minimum":10,"type":"integer","description":"The height of the thumbnail."},"name":"height","in":"query"},{"style":"form","explode":true,"schema":{"title":"width","maximum":400,"minimum":10,"type":"integer","description":"The width of the thumbnail."},"name":"width","in":"query"}],"responses":{"200":{"description":"OK","content":{"image\/*":{"schema":{"$ref":"#\/components\/schemas\/91ac10ff_Stream"}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/preview":{"get":{"tags":["Drive > Files > File\/Directory"],"summary":"Preview","description":"Get file preview.","operationId":"kDrivePreviewV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"style":"form","explode":true,"schema":{"title":"as","enum":["pdf","text"],"type":"string","description":"Convert file before preview"},"name":"as","in":"query"},{"style":"form","explode":true,"schema":{"title":"height","maximum":10000,"minimum":10,"type":"integer","description":"The height of the preview. This parameter only works on image<\/note>"},"name":"height","in":"query"},{"style":"form","explode":true,"schema":{"title":"quality","maximum":100,"minimum":1,"type":"integer","description":"The quality of the preview. This parameter only works on image<\/note>"},"name":"quality","in":"query"},{"style":"form","explode":true,"schema":{"title":"width","maximum":10000,"minimum":10,"type":"integer","description":"The width of the preview. This parameter only works on image<\/note>"},"name":"width","in":"query"},{"style":"simple","explode":true,"schema":{"title":"x-kdrive-file-password","type":"string","description":"File password to open it for conversion, if the file is password-protected"},"name":"x-kdrive-file-password","in":"header"}],"responses":{"200":{"description":"OK","content":{"image\/*":{"schema":{"$ref":"#\/components\/schemas\/91ac10ff_Stream"}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/download":{"get":{"tags":["Drive > Files > File\/Directory"],"summary":"Download","description":"Download file content or directory as Zip file.\n\n\nPlease note that this may respond a 302 to actually download the requested content.\n<\/note>","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"style":"form","explode":true,"schema":{"title":"as","enum":["pdf","text"],"type":"string","description":"Convert file before download"},"name":"as","in":"query"},{"style":"simple","explode":true,"schema":{"title":"x-kdrive-file-password","type":"string","description":"File password to open it for conversion, if the file is password-protected"},"name":"x-kdrive-file-password","in":"header"}],"responses":{"200":{"description":"OK","content":{"application\/octet-stream":{"schema":{"$ref":"#\/components\/schemas\/91ac10ff_Stream"}}}},"400":{"description":"Bad Request","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 400","type":"object","properties":{"code":{"enum":["bad_request_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.bad_request_error<\/strong>: Bad request, the request is invalid.<\/note>","example":"bad_request_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/rename":{"post":{"tags":["Drive > Files > File\/Directory"],"summary":"Rename","description":"Rename a file\/directory","operationId":"kDriveRenameV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["name"],"type":"object","properties":{"name":{"title":"name","type":"string","description":"Name of the File\/Directory"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_CancelResource"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/sizes":{"get":{"tags":["Drive > Files > File\/Directory"],"summary":"Get size","description":"Get the size and storage_size of the File\/Directory with children, up to $depth.","operationId":"kDriveGetSizeV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"style":"form","explode":true,"schema":{"title":"depth","enum":["folder","unlimited"],"type":"string"},"name":"depth","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_CountFileSize"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/hash":{"get":{"tags":["Drive > Files > File\/Directory"],"summary":"Hash","description":"Get file hash.","operationId":"kDriveHashV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Filecontenthash"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/copy-to-drive":{"post":{"tags":["Drive > Files > File\/Directory"],"summary":"Copy to Drive","description":"Copy source file in source drive to destination drive at destination folder.","operationId":"kDriveCopyToDriveV2","parameters":[{"required":true,"style":"simple","explode":true,"schema":{"type":"string"},"name":"drive_id","in":"path"},{"required":true,"style":"simple","explode":true,"schema":{"type":"string"},"name":"file_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["source_drive_id","source_file_id"],"type":"object","properties":{"source_drive_id":{"title":"source_drive_id","type":"integer","description":"Source Drive Identifier"},"source_file_id":{"title":"source_file_id","type":"integer","description":"Source File Identifier"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_ExternalImport"}}}}]}}}},"400":{"description":"Bad Request","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 400","type":"object","properties":{"code":{"enum":["external_import_size_computation_failed_error","quota_exceeded_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.external_import_size_computation_failed_error<\/strong>: Computing the import size failed; the import can't be executed.<\/note>quota_exceeded_error<\/strong>: Triggered when the quota storage of the drive is reached.<\/note>","example":"quota_exceeded_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"404":{"description":"Not Found","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 404","type":"object","properties":{"code":{"enum":["not_found_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.not_found_error<\/strong>: The requested data was not found.<\/note>","example":"not_found_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"422":{"description":"Unprocessable Entity","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 422","type":"object","properties":{"code":{"enum":["external_import_unsupported_app_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.external_import_unsupported_app_error<\/strong>: The provided application is unsupported and cannot be used for an external import.<\/note>","example":"external_import_unsupported_app_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/temporary_url":{"get":{"tags":["Drive > Files > File\/Directory"],"summary":"Get a file Temporary URL","description":"Get a Temporary URL for a given file\n\n\nNote that it is not possible to get a directory temporary URL.\n<\/note>","operationId":"kDriveGetAFileTemporaryURLV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"style":"form","explode":true,"schema":{"title":"duration","maximum":86400,"minimum":60,"type":"integer","description":"How long before this link expires, in seconds"},"name":"duration","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_TemporaryURL"}}}]}}}},"400":{"description":"Cannot get a temporary url for a directory","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["cannot_get_a_temporary_url_for_a_directory"],"type":"string","description":"Error code","example":"cannot_get_a_temporary_url_for_a_directory"},"description":{"enum":["Cannot get a temporary url for a directory"],"type":"string","description":"Description of the error","example":"Cannot get a temporary url for a directory"}},"description":"Error object"}}}]},"examples":{"Cannot get a temporary url for a directory":{"summary":"Example","value":{"result":"error","error":{"code":"cannot_get_a_temporary_url_for_a_directory","description":"Cannot get a temporary url for a directory","errors":[]}}}}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/versions":{"get":{"tags":["Drive > Files > File\/Directory > Version"],"summary":"List","description":"Get list of file versions","operationId":"kDriveListV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"$ref":"#\/components\/parameters\/OrderBy","schema":{"enum":["created_at","last_modified_at","keep_forever"]}},{"$ref":"#\/components\/parameters\/Order"},{"$ref":"#\/components\/parameters\/OrderFor","schema":{"enum":["asc","desc"],"example":"order_for[created_at]=asc"}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_FileVersionV2"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"deprecated":true,"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Files > File\/Directory > Version"],"summary":"Delete all","description":"Delete all version for file.","operationId":"kDriveDeleteAllV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/versions\/current":{"put":{"tags":["Drive > Files > File\/Directory > Version"],"summary":"Update current","description":"Update current file version","operationId":"kDriveUpdateCurrentV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["keep_forever"],"type":"object","properties":{"keep_forever":{"title":"keep_forever","type":"boolean","description":"Indicate whether the current version should be kept forever"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/versions\/{version_id}":{"get":{"tags":["Drive > Files > File\/Directory > Version"],"summary":"Get","description":"Get file version information.","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"Version identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"version_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_FileVersionV2"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["Drive > Files > File\/Directory > Version"],"summary":"Update","description":"Update file version","operationId":"kDriveUpdateV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"Version identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"version_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["keep_forever"],"type":"object","properties":{"keep_forever":{"title":"keep_forever","type":"boolean","description":"Never delete this version from version history"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Files > File\/Directory > Version"],"summary":"Delete","description":"Delete a file version.","operationId":"kDriveDeleteV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"Version identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"version_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/versions\/{version_id}\/download":{"get":{"tags":["Drive > Files > File\/Directory > Version"],"summary":"Download","description":"Download file version.\n\n\nPlease note that this may respond a 302 to actually download the requested content.\n<\/note>","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"Version identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"version_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/octet-stream":{"schema":{"$ref":"#\/components\/schemas\/91ac10ff_Stream"}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/versions\/{version_id}\/restore":{"post":{"tags":["Drive > Files > File\/Directory > Version"],"summary":"Restore","description":"Restore a file version.","operationId":"kDriveRestoreV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"Version identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"version_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_File"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"deprecated":true,"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/versions\/{version_id}\/restore\/{destination_directory_id}":{"post":{"tags":["Drive > Files > File\/Directory > Version"],"summary":"Restore to Directory","description":"Restore a file version as a copy in target directory, keeping current original intact.","operationId":"kDriveRestoreToDirectoryV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"Version identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"version_id","in":"path"},{"description":"Directory identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"destination_directory_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"name":{"title":"name","type":"string","description":"Name of File in the destination Directory"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_File"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"deprecated":true,"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/access\/requests":{"get":{"tags":["Drive > Files > File\/Directory > Access > Request"],"summary":"Get requested file access from a file id","description":"Show requested file access for a given file","operationId":"kDriveGetRequestedFileAccessFromAFileIdV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Drive > Files > File\/Directory > Access > Request"],"summary":"Create a new file access request","description":"Create a new file access request","operationId":"kDriveCreateANewFileAccessRequestV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"message":{"title":"message","type":"string","description":"Message provided by the requestor of new access","nullable":true}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_SanitizedFileAccessRequest"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/access\/applications":{"post":{"tags":["Drive > Files > File\/Directory > Access"],"summary":"Allow external applications","description":"Get access for an external application","operationId":"kDriveAllowExternalApplicationsV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["type"],"type":"object","properties":{"mode":{"title":"mode","enum":["edit","view"],"type":"string","description":"Asked mode to open the external wopi documents.edit<\/strong>: Open with the edit mode.<\/note>view<\/strong>: Open with the view mode.<\/note>","example":"edit"},"type":{"title":"type","enum":["365","collabora"],"type":"string","description":"List of applications.365<\/strong>: The 365 application.<\/note>collabora<\/strong>: The collabora application.<\/note>","example":"365"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Feedbackaccessresource_c3fdaa7f"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/access":{"get":{"tags":["Drive > Files > File\/Directory > Access"],"summary":"Get multi-access","description":"Show access file information","operationId":"kDriveGetMultiaccessV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_FileAccess"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Drive > Files > File\/Directory > Access"],"summary":"Add multi-access","description":"Add multi-access to file","operationId":"kDriveAddMultiaccessV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"description":"Override the language of the request, in most cases when an e-mail is triggered in the request.","style":"form","explode":true,"schema":{"enum":["de","en","es","fr","it"],"type":"string"},"name":"lang","in":"query"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["right"],"type":"object","properties":{"emails":{"title":"emails","maxItems":100,"type":"array","items":{"title":"item","type":"string"}},"lang":{"title":"lang","enum":["de","en","es","fr","it"],"type":"string","description":"Invitation language fallback if user's preference is not found","nullable":true},"message":{"title":"message","type":"string","nullable":true},"right":{"title":"right","enum":["manage","none","read","write"],"type":"string","description":"Access level of {name}.manage<\/strong>: Can share, write and read the file.<\/note>none<\/strong>: Can not act on the file.<\/note>read<\/strong>: Can only read the file.<\/note>write<\/strong>: Can write and read the file.<\/note>","example":"manage"},"team_ids":{"title":"team_ids","maxItems":40,"type":"array","items":{"title":"item","type":"integer"}},"user_ids":{"title":"user_ids","maxItems":100,"type":"array","items":{"title":"item","type":"integer","description":"User identifier. Only user in the same Infomaniak group"}}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Feedbackaccessresource_c3fdaa7f"}}}]}}}},"400":{"description":"Permission denied","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["permission_denied"],"type":"string","description":"Error code","example":"permission_denied"},"description":{"enum":["Permission denied"],"type":"string","description":"Description of the error","example":"Permission denied"}},"description":"Error object"}}}]},"examples":{"Permission denied":{"summary":"Example","value":{"result":"error","error":{"code":"permission_denied","description":"Permission denied","errors":[]}}}}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/access\/sync-parent":{"post":{"tags":["Drive > Files > File\/Directory > Access"],"summary":"Synchronize with parent rights","description":"Retrieve the parent access rights and apply them to the current file.\nAny further update on parent access rights will be propagated to this file, unless its access rights have been changed.","operationId":"kDriveSynchronizeWithParentRightsV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"401":{"description":"Unauthorized","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 401","type":"object","properties":{"code":{"enum":["not_authorized"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.not_authorized<\/strong>: Triggered when the user is not authorized to access this resource.<\/note>","example":"not_authorized"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/access\/check":{"post":{"tags":["Drive > Files > File\/Directory > Access"],"summary":"Check access change","description":"Analyzes each user that has access to the drive by team, email or user identifier.\nThis method tries to find users for the given inputs:<\/br>\n> The emails are parsed to user identifiers if possible.<\/br>\n> The teams identifiers are parsed to multiple user identifiers.<\/br>\n> The users identifiers are parsed accordingly.<\/br><\/br>\nA right is required to simulate if a user needs to change their permissions to match it.","operationId":"kDriveCheckAccessChangeV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["right"],"type":"object","properties":{"emails":{"title":"emails","maxItems":100,"type":"array","items":{"title":"item","type":"string"}},"lang":{"title":"lang","enum":["de","en","es","fr","it"],"type":"string","description":"Invitation language fallback if user's preference is not found","nullable":true},"right":{"title":"right","enum":["manage","none","read","write"],"type":"string","description":"Access level of {name}.manage<\/strong>: Can share, write and read the file.<\/note>none<\/strong>: Can not act on the file.<\/note>read<\/strong>: Can only read the file.<\/note>write<\/strong>: Can write and read the file.<\/note>","example":"manage"},"team_ids":{"title":"team_ids","maxItems":40,"type":"array","items":{"title":"item","type":"integer"}},"user_ids":{"title":"user_ids","maxItems":100,"type":"array","items":{"title":"item","type":"integer","description":"User identifier. Only user in the same Infomaniak group"}}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_Checkchangeaccessfeedbackresource"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/access\/invitations":{"get":{"tags":["Drive > Files > File\/Directory > Access > Invitation"],"summary":"Invitation > get access","description":"Show invitation send and that has access to the File|Directory, pending and accepted invitation","operationId":"kDriveInvitationGetAccessV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_ExternInvitationFileAccess"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Drive > Files > File\/Directory > Access > Invitation"],"summary":"Add access","description":"Give access to the File|Directory by email","operationId":"kDriveAddAccessV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"description":"Override the language of the request, in most cases when an e-mail is triggered in the request.","style":"form","explode":true,"schema":{"enum":["de","en","es","fr","it"],"type":"string"},"name":"lang","in":"query"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["emails","right"],"type":"object","properties":{"emails":{"title":"emails","maxItems":100,"type":"array","items":{"title":"item","type":"string"}},"lang":{"title":"lang","enum":["de","en","es","fr","it"],"type":"string","description":"Invitation language fallback if user's preference is not found","nullable":true},"message":{"title":"message","type":"string","nullable":true},"right":{"title":"right","enum":["manage","none","read","write"],"type":"string","description":"Access level of {name}.manage<\/strong>: Can share, write and read the file.<\/note>none<\/strong>: Can not act on the file.<\/note>read<\/strong>: Can only read the file.<\/note>write<\/strong>: Can write and read the file.<\/note>","example":"manage"}}}}}},"responses":{"201":{"description":"Created","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_Feedbackaccessresource"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/access\/invitations\/check":{"post":{"tags":["Drive > Files > File\/Directory > Access > Invitation"],"summary":"Check access","description":"Check if an invitation exists or a drive invitation is currently pending","operationId":"kDriveCheckAccessV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"emails":{"title":"emails","maxItems":100,"minItems":1,"type":"array","items":{"title":"item","type":"string"}},"user_ids":{"title":"user_ids","maxItems":100,"minItems":1,"type":"array","items":{"title":"item","minimum":1,"type":"integer"}}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_Feedbackaccesspendinginvitationresource"}}}}]}}}},"400":{"description":"Permission denied","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["permission_denied"],"type":"string","description":"Error code","example":"permission_denied"},"description":{"enum":["Permission denied"],"type":"string","description":"Description of the error","example":"Permission denied"}},"description":"Error object"}}}]},"examples":{"Permission denied":{"summary":"Example","value":{"result":"error","error":{"code":"permission_denied","description":"Permission denied","errors":[]}}}}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/access\/teams":{"get":{"tags":["Drive > Files > File\/Directory > Access > Teams"],"summary":"Get access","description":"Show team that has access to the File|Directory","operationId":"kDriveGetAccessV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_TeamFileAccess"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Drive > Files > File\/Directory > Access > Teams"],"summary":"Add access","description":"Give teams access to the File|Directory","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"description":"Override the language of the request, in most cases when an e-mail is triggered in the request.","style":"form","explode":true,"schema":{"enum":["de","en","es","fr","it"],"type":"string"},"name":"lang","in":"query"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["right"],"type":"object","properties":{"lang":{"title":"lang","enum":["de","en","es","fr","it"],"type":"string","description":"Invitation language fallback if user's preference is not found","nullable":true},"message":{"title":"message","type":"string","nullable":true},"right":{"title":"right","enum":["manage","none","read","write"],"type":"string","description":"Access level of {name}.manage<\/strong>: Can share, write and read the file.<\/note>none<\/strong>: Can not act on the file.<\/note>read<\/strong>: Can only read the file.<\/note>write<\/strong>: Can write and read the file.<\/note>","example":"manage"},"team_ids":{"title":"team_ids","maxItems":40,"type":"array","items":{"title":"item","type":"integer"}}}}}}},"responses":{"201":{"description":"Created","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_Feedbackaccessresource"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/access\/teams\/{team_id}":{"put":{"tags":["Drive > Files > File\/Directory > Access > Teams"],"summary":"Update access","description":"Update the access permission of a team access","operationId":"kDriveUpdateAccessV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"Team identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"team_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["right"],"type":"object","properties":{"right":{"title":"right","enum":["manage","none","read","write"],"type":"string","description":"Access level of {name}.manage<\/strong>: Can share, write and read the file.<\/note>none<\/strong>: Can not act on the file.<\/note>read<\/strong>: Can only read the file.<\/note>write<\/strong>: Can write and read the file.<\/note>","example":"manage"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"401":{"description":"Unauthorized","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 401","type":"object","properties":{"code":{"enum":["not_authorized"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.not_authorized<\/strong>: Triggered when the user is not authorized to access this resource.<\/note>","example":"not_authorized"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Files > File\/Directory > Access > Teams"],"summary":"Remove access","description":"Delete the access permission of a team access","operationId":"kDriveRemoveAccessV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"Team identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"team_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"401":{"description":"Unauthorized","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 401","type":"object","properties":{"code":{"enum":["not_authorized"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.not_authorized<\/strong>: Triggered when the user is not authorized to access this resource.<\/note>","example":"not_authorized"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/access\/users":{"get":{"tags":["Drive > Files > File\/Directory > Access > Users"],"summary":"get access","description":"Show user that has access to the File|Directory","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_Userfileaccess"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Drive > Files > File\/Directory > Access > Users"],"summary":"add access","description":"Give users access to the File|Directory","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"description":"Override the language of the request, in most cases when an e-mail is triggered in the request.","style":"form","explode":true,"schema":{"enum":["de","en","es","fr","it"],"type":"string"},"name":"lang","in":"query"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["right","user_ids"],"type":"object","properties":{"lang":{"title":"lang","enum":["de","en","es","fr","it"],"type":"string","description":"Invitation language fallback if user's preference is not found","nullable":true},"message":{"title":"message","type":"string","nullable":true},"right":{"title":"right","enum":["manage","none","read","write"],"type":"string","description":"Access level of {name}.manage<\/strong>: Can share, write and read the file.<\/note>none<\/strong>: Can not act on the file.<\/note>read<\/strong>: Can only read the file.<\/note>write<\/strong>: Can write and read the file.<\/note>","example":"manage"},"user_ids":{"title":"user_ids","maxItems":100,"type":"array","items":{"title":"item","type":"integer","description":"User identifier. Only user in the same Infomaniak group"}}}}}}},"responses":{"201":{"description":"Created","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_Feedbackaccessresource"}}}}]}}}},"401":{"description":"Unauthorized","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 401","type":"object","properties":{"code":{"enum":["not_authorized"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.not_authorized<\/strong>: Triggered when the user is not authorized to access this resource.<\/note>","example":"not_authorized"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"404":{"description":"Not Found","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 404","type":"object","properties":{"code":{"enum":["object_not_found"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.object_not_found<\/strong>: Triggered when the asked entity is not accessible.<\/note>","example":"object_not_found"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/access\/users\/{user_id}":{"put":{"tags":["Drive > Files > File\/Directory > Access > Users"],"summary":"Update access","description":"Update the access permission of an access","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"User identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"user_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["right"],"type":"object","properties":{"right":{"title":"right","enum":["manage","none","read","write"],"type":"string","description":"Access level of {name}.manage<\/strong>: Can share, write and read the file.<\/note>none<\/strong>: Can not act on the file.<\/note>read<\/strong>: Can only read the file.<\/note>write<\/strong>: Can write and read the file.<\/note>","example":"manage"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"401":{"description":"Unauthorized","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 401","type":"object","properties":{"code":{"enum":["not_authorized"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.not_authorized<\/strong>: Triggered when the user is not authorized to access this resource.<\/note>","example":"not_authorized"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Files > File\/Directory > Access > Users"],"summary":"Remove access","description":"Delete access of a File\/Directory","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"User identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"user_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"400":{"description":"User not associated with drive","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["user_not_associated_with_drive"],"type":"string","description":"Error code","example":"user_not_associated_with_drive"},"description":{"enum":["User not associated with drive"],"type":"string","description":"Description of the error","example":"User not associated with drive"}},"description":"Error object"}}}]},"examples":{"User not associated with drive":{"summary":"Example","value":{"result":"error","error":{"code":"user_not_associated_with_drive","description":"User not associated with drive","errors":[]}}}}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/access\/force":{"post":{"tags":["Drive > Files > File\/Directory > Access > Users"],"summary":"Force write access","description":"Claim write access in a shared file","operationId":"kDriveForceWriteAccessV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"400":{"description":"Unsupported file type","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["unsupported_file_type"],"type":"string","description":"Error code","example":"unsupported_file_type"},"description":{"enum":["Unsupported file type"],"type":"string","description":"Description of the error","example":"Unsupported file type"}},"description":"Error object"}}}]},"examples":{"Unsupported file type":{"summary":"Example","value":{"result":"error","error":{"code":"unsupported_file_type","description":"Unsupported file type","errors":[]}}}}}}},"401":{"description":"Unauthorized","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 401","type":"object","properties":{"code":{"enum":["not_authorized"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.not_authorized<\/strong>: Triggered when the user is not authorized to access this resource.<\/note>","example":"not_authorized"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/link":{"get":{"tags":["Drive > Files > Share link > Manage"],"summary":"Get share-link","description":"Get a share link information","operationId":"kDriveGetSharelinkV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_ShareLink"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["Drive > Files > Share link > Manage"],"summary":"Update share-link","description":"Update a share-link","operationId":"kDriveUpdateSharelinkV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"can_comment":{"title":"can_comment","type":"boolean","description":"Allow users to to comment the shared files. It takes the same value as can_edit if unset or null"},"can_download":{"title":"can_download","type":"boolean","description":"Allow users to download shared content"},"can_edit":{"title":"can_edit","type":"boolean","description":"Allow users to edit the file content using the shared link"},"can_request_access":{"title":"can_request_access","type":"boolean","description":"Allow connected users to join the folder via the shared link. It is not possible to join a file via a shared link"},"can_see_info":{"title":"can_see_info","type":"boolean","description":"Allow users to see information about the shared files"},"can_see_stats":{"title":"can_see_stats","type":"boolean","description":"Allow users to see statistics"},"password":{"title":"password","type":"string","description":"The password if the permission password is set"},"right":{"title":"right","enum":["inherit","password","public"],"type":"string"},"valid_until":{"title":"valid_until","type":"integer","description":"Maximum validity timestamp of the shared link","nullable":true}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Drive > Files > Share link > Manage"],"summary":"Create share-link","description":"Create a share link","operationId":"kDriveCreateSharelinkV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["right"],"type":"object","properties":{"can_comment":{"title":"can_comment","type":"boolean","description":"Allow users to to comment the shared files. It takes the same value as can_edit if unset or null"},"can_download":{"title":"can_download","type":"boolean","description":"Allow users to download shared content"},"can_edit":{"title":"can_edit","type":"boolean","description":"Allow users to edit the file content using the shared link"},"can_request_access":{"title":"can_request_access","type":"boolean","description":"Allow connected users to join the folder via the shared link. It is not possible to join a file via a shared link"},"can_see_info":{"title":"can_see_info","type":"boolean","description":"Allow users to see information about the shared files"},"can_see_stats":{"title":"can_see_stats","type":"boolean","description":"Allow users to see statistics"},"password":{"title":"password","type":"string","description":"The password if the permission password is set"},"right":{"title":"right","enum":["inherit","password","public"],"type":"string","description":"Permission of the shared link: no restriction (public), access by authenticated and authorized user (inherit) or public but protected by a password (password)"},"valid_until":{"title":"valid_until","type":"integer","description":"Maximum validity timestamp of the shared link","nullable":true}}}}}},"responses":{"201":{"description":"Created","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_ShareLink"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Files > Share link > Manage"],"summary":"Remove share-link","description":"Delete a share link","operationId":"kDriveRemoveSharelinkV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/link\/invite":{"post":{"tags":["Drive > Files > Share link > Manage"],"summary":"Share link invite","description":"Send an email with the share link, to allow an user to upload files.","operationId":"kDriveShareLinkInviteV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"emails":{"title":"emails","maxItems":100,"minItems":1,"type":"array","items":{"title":"item","type":"string"},"description":"List of emails to invite"},"message":{"title":"message","type":"string","description":"Message to be sent","nullable":true},"user_ids":{"title":"user_ids","type":"array","items":{"title":"item","minimum":1,"type":"integer"},"description":"List of user ids to invite by mail. Users must be in the drive's organisation "}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/dropbox":{"get":{"tags":["Drive > Files > Dropbox"],"summary":"Get dropbox","description":"Get dropbox by the directory identifier.\nA dropbox allows no logged users to upload files to this directory via an external dropbox link (see Drive > External Access > Dropbox).<\/note>","operationId":"kDriveGetDropboxV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Dropbox"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["Drive > Files > Dropbox"],"summary":"Update dropbox","description":"Update and manage a dropbox.","operationId":"kDriveUpdateDropboxV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"alias":{"title":"alias","type":"string","description":"Alias of the dropbox","nullable":true},"email_when_finished":{"title":"email_when_finished","type":"boolean","description":"Send an email when done"},"limit_file_size":{"title":"limit_file_size","type":"integer","description":"Maximum accepted file size (bytes)","nullable":true},"password":{"title":"password","type":"string","description":"Password for protecting the dropbox","nullable":true},"valid_until":{"title":"valid_until","maximum":253402300799,"type":"integer","description":"Maximum validity date","nullable":true}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Drive > Files > Dropbox"],"summary":"Convert a folder into a dropbox","description":"A dropbox allows unauthenticated users to upload files onto the drive via a public link (see Drive > External Access > Dropbox).<\/note>","operationId":"kDriveConvertAFolderIntoADropboxV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"alias":{"title":"alias","type":"string","description":"Alias of the dropbox","nullable":true},"email_when_finished":{"title":"email_when_finished","type":"boolean","description":"Send an email when done"},"limit_file_size":{"title":"limit_file_size","type":"integer","description":"Maximum accepted file size (bytes)","nullable":true},"password":{"title":"password","type":"string","description":"Password for protecting the dropbox","nullable":true},"valid_until":{"title":"valid_until","maximum":253402300799,"type":"integer","description":"Maximum validity date","nullable":true}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Dropbox"}}}]}}}},"400":{"description":"Collaborative folder already exists for file","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["collaborative_folder_already_exists_for_file"],"type":"string","description":"Error code","example":"collaborative_folder_already_exists_for_file"},"description":{"enum":["Collaborative folder already exists for file"],"type":"string","description":"Description of the error","example":"Collaborative folder already exists for file"}},"description":"Error object"}}}]},"examples":{"Collaborative folder already exists for file":{"summary":"Example","value":{"result":"error","error":{"code":"collaborative_folder_already_exists_for_file","description":"Collaborative folder already exists for file","errors":[]}}}}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Files > Dropbox"],"summary":"Delete dropbox","description":"Delete a Dropbox Directory resource","operationId":"kDriveDeleteDropboxV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/dropbox\/invite":{"post":{"tags":["Drive > Files > Dropbox"],"summary":"Dropbox invite","description":"Send an email with the dropbox external link, to allow an user to upload files.","operationId":"kDriveDropboxInviteV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"emails":{"title":"emails","maxItems":100,"minItems":1,"type":"array","items":{"title":"item","type":"string"},"description":"List of emails to invite"},"message":{"title":"message","type":"string","description":"Message to be sent","nullable":true},"user_ids":{"title":"user_ids","type":"array","items":{"title":"item","minimum":1,"type":"integer"},"description":"List of user ids to invite by mail. Users must be in the drive's organisation "}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/comments":{"get":{"tags":["Drive > Files > File\/Directory > Comment"],"summary":"Get file comments","description":"Retrieve all Comments from a file","operationId":"kDriveGetFileCommentsV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"$ref":"#\/components\/parameters\/Page","schema":{"type":"integer","default":1}},{"$ref":"#\/components\/parameters\/PerPage","schema":{"maximum":1000,"minimum":1,"type":"integer","default":10}},{"$ref":"#\/components\/parameters\/Total"},{"$ref":"#\/components\/parameters\/OrderBy","schema":{"enum":["created_at"]}},{"$ref":"#\/components\/parameters\/Order"},{"$ref":"#\/components\/parameters\/OrderFor","schema":{"enum":["asc","desc"],"example":"order_for[created_at]=asc"}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_Comment"}}}},{"$ref":"#\/components\/schemas\/Pagination"}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Drive > Files > File\/Directory > Comment"],"summary":"Add comment","description":"Add a comment to a file.","operationId":"kDriveAddCommentV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["body"],"type":"object","properties":{"body":{"title":"body","type":"string"}}}}}},"responses":{"201":{"description":"Created","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Comment"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/comments\/{comment_id}":{"get":{"tags":["Drive > Files > File\/Directory > Comment"],"summary":"Get comment reply","description":"Retrieve reply responding to a comment on file.","operationId":"kDriveGetCommentReplyV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"required":true,"style":"simple","explode":true,"schema":{"type":"string"},"name":"comment_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"$ref":"#\/components\/parameters\/Page","schema":{"type":"integer","default":1}},{"$ref":"#\/components\/parameters\/PerPage","schema":{"maximum":1000,"minimum":1,"type":"integer","default":10}},{"$ref":"#\/components\/parameters\/Total"},{"$ref":"#\/components\/parameters\/OrderBy","schema":{"enum":["created_at"]}},{"$ref":"#\/components\/parameters\/Order"},{"$ref":"#\/components\/parameters\/OrderFor","schema":{"enum":["asc","desc"],"example":"order_for[created_at]=asc"}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_Comment"}}}},{"$ref":"#\/components\/schemas\/Pagination"}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["Drive > Files > File\/Directory > Comment"],"summary":"Modify comment","description":"Modify a comment on a file.","operationId":"kDriveModifyCommentV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"required":true,"style":"simple","explode":true,"schema":{"type":"string"},"name":"comment_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"body":{"title":"body","type":"string"},"is_resolved":{"title":"is_resolved","type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Drive > Files > File\/Directory > Comment"],"summary":"Add comment reply","description":"Add a reply to a comment.","operationId":"kDriveAddCommentReplyV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"required":true,"style":"simple","explode":true,"schema":{"type":"string"},"name":"comment_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["body"],"type":"object","properties":{"body":{"title":"body","type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_Comment"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Drive > Files > File\/Directory > Comment"],"summary":"Delete comment","description":"Delete a comment from a file.","operationId":"kDriveDeleteCommentV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"required":true,"style":"simple","explode":true,"schema":{"type":"string"},"name":"comment_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/comments\/{comment_id}\/like":{"post":{"tags":["Drive > Files > File\/Directory > Comment"],"summary":"Like comment","description":"Add a like to the comment","operationId":"kDriveLikeCommentV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"required":true,"style":"simple","explode":true,"schema":{"type":"string"},"name":"comment_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/{file_id}\/comments\/{comment_id}\/unlike":{"post":{"tags":["Drive > Files > File\/Directory > Comment"],"summary":"Unlike comment","description":"Remove a like from the Comment","operationId":"kDriveUnlikeCommentV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"required":true,"style":"simple","explode":true,"schema":{"type":"string"},"name":"comment_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/exists":{"post":{"tags":["Drive > Files"],"summary":"Check file's existence","description":"Check if some files ids still exists in the drive","operationId":"kDriveCheckFilesExistenceV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","required":["ids"],"type":"object","properties":{"ids":{"title":"ids","type":"array","items":{"title":"item","type":"integer"},"description":"The ids of the files to check"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_Feedbackresource"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/files\/archives\/{archive_uuid}":{"get":{"tags":["Drive > Files > Archive"],"summary":"Download archive","description":"You can download an archive\/zip with the token provided by the route drive\/{drive_id}\/files\/archives<\/a>.\n\nPlease note that this may respond a 302 to actually download the requested content.<\/note>","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Archive uuid","required":true,"style":"simple","explode":true,"schema":{"type":"string"},"name":"archive_uuid","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/zip":{"schema":{"$ref":"#\/components\/schemas\/91ac10ff_Stream"}}}},"400":{"description":"Bad Request","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 400","type":"object","properties":{"code":{"enum":["too_many_files_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.too_many_files_error<\/strong>: To many files, max limit reached.<\/note>","example":"too_many_files_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/trash":{"delete":{"tags":["Drive > Files > Trash"],"summary":"Empty trash","description":"Empty all trashed files","operationId":"kDriveEmptyTrashV2","parameters":[{"description":"the drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/trash\/count":{"get":{"tags":["Drive > Files > Trash"],"summary":"Count Directory\/File in Trash","description":"Count the number of Directory and File in trash","operationId":"kDriveCountDirectoryFileInTrashV2","parameters":[{"description":"the drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_CountFile"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/trash\/{file_id}":{"delete":{"tags":["Drive > Files > Trash"],"summary":"Remove file","description":"Delete a file from trash (remove it completely)","operationId":"kDriveRemoveFileV2","parameters":[{"description":"the drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"the file identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/trash\/{file_id}\/restore":{"post":{"tags":["Drive > Files > Trash"],"summary":"Restore file","description":"Restore a specific Directory or File from the trash","operationId":"kDriveRestoreFileV2","parameters":[{"description":"the drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"the file identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"requestBody":{"description":"Request body of the called URI","content":{"application\/json":{"schema":{"title":"Request body","required":["destination_directory_id"],"type":"object","properties":{"destination_directory_id":{"title":"destination_directory_id","type":"integer","description":"Destination directory identifier"}}}}},"required":true},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#\/components\/schemas\/91ac10ff_CancelResource"},{"type":"boolean"}]}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error","lock_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.lock_error<\/strong>: Action impossible. There is a lock on the file\/directory.<\/note>forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/trash\/{file_id}\/thumbnail":{"get":{"tags":["Drive > Files > Trash"],"summary":"Get thumbnail","description":"Get thumbnail of trashed file","operationId":"kDriveGetThumbnailV2","parameters":[{"description":"the drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"the file identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"style":"form","explode":true,"schema":{"title":"height","maximum":400,"minimum":10,"type":"integer","description":"The height of the thumbnail."},"name":"height","in":"query"},{"style":"form","explode":true,"schema":{"title":"width","maximum":400,"minimum":10,"type":"integer","description":"The width of the thumbnail."},"name":"width","in":"query"}],"responses":{"200":{"description":"OK","content":{"image\/*":{"schema":{"$ref":"#\/components\/schemas\/91ac10ff_Stream"}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/trash\/{file_id}\/count":{"get":{"tags":["Drive > Files > Trash"],"summary":"Count Directory\/File in trashed Directory","description":"Count the number of Directory and File","operationId":"kDriveCountDirectoryFileInTrashedDirectoryV2","parameters":[{"description":"the drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"the file identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_CountFile"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"deprecated":true,"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/upload":{"delete":{"tags":["Drive > Files > File\/Directory > Upload"],"summary":"Cancel by path","description":"Cancel an upload by its path (for instance, if the session token is unknown)","operationId":"kDriveCancelByPathV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"directory_id":{"title":"directory_id","type":"integer","description":"The directory destination root of the new file. Must be a directory.\n If the identifier is unknown you can use only directory_path<\/strong>.<\/note>\n The identifier 1<\/strong> is the user root folder.<\/note>\n Required without directory_path<\/strong><\/note>","example":1000},"directory_path":{"title":"directory_path","type":"string","description":"The destination path of the new file. If the directory_id<\/strong> is provided the directory path is used as a relative path, otherwise it will be used as an absolute path. The destination should be a directory.\n If the directory path does not exist, folders are created automatically.<\/note>\n The path is a destination path, the file name should not be provided at the end.<\/note>\n Required without directory_id<\/strong>.<\/note>","nullable":true,"example":"\/Directory\/SubDirectory"},"file_id":{"title":"file_id","type":"integer","description":"File identifier of uploaded file.\n This is an alternative to replace a file by its identifier, if this mode is used file_name<\/strong>, directory_id<\/strong>, conflict<\/strong> and directory_path<\/strong> params are automatically computed and cannot be provided.<\/note>\n If you don't know the identifier, or you want to upload a new file, you should provide a filename and a directory destination.<\/note>","example":1001},"file_name":{"title":"file_name","maxLength":255,"type":"string","description":"The name of the file to create.\n Slashes will be replaced by colons.<\/note>\n Maximum bytes size is 255<\/note>","example":"file.txt"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/upload\/session\/{session_token}":{"delete":{"tags":["Drive > Files > File\/Directory > Upload > Session"],"summary":"Cancel session","description":"Cancel an upload by its token. If you want to stop the upload and close the session to explicitly erase the file\/upload.\n\nWhen a session is started, it can be used for a maximum of 4 hours. It will be automatically canceled afterwards.\n<\/note>","operationId":"kDriveCancelSessionV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Session token uuid","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"session_token","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"400":{"description":"Destination not writable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["destination_not_writable"],"type":"string","description":"Error code","example":"destination_not_writable"},"description":{"enum":["Destination not writable"],"type":"string","description":"Description of the error","example":"Destination not writable"}},"description":"Error object"}}}]},"examples":{"Destination not writable":{"summary":"Example","value":{"result":"error","error":{"code":"destination_not_writable","description":"Destination not writable","errors":[]}}}}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"deprecated":true,"security":[{"bearerAuth":[]}]}},"\/2\/drive\/{drive_id}\/upload\/session\/batch":{"delete":{"tags":["Drive > Files > File\/Directory > Upload > Session"],"summary":"Batch : cancel sessions","description":"Cancel multiple session tokens. If you want to stop the upload and close one or more sessions to explicitly erase file(s)\/upload(s).\n\nWhen a session is started, it can be used for a maximum of 4 hours. It will be automatically canceled afterwards.\n<\/note>\n\n The batch cannot exceed 1,000 sessions.\n<\/note>","operationId":"kDriveBatchCancelSessionsV2","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"required":true,"style":"form","explode":true,"schema":{"title":"tokens","type":"array","items":{"title":"item","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[47][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$","type":"string","description":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"}},"name":"tokens","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_UUIDFeedbackresource"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"429":{"description":"Response","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 429","type":"object","properties":{"code":{"enum":["too_many_upload_sessions_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.too_many_upload_sessions_error<\/strong>: You have reached the maximum limit of simultaneous upload sessions. Wait before some uploads finish before retrying.<\/note>","example":"too_many_upload_sessions_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"deprecated":true,"security":[{"bearerAuth":[]}]}},"\/2\/app\/{drive_id}\/share\/{sharelink_uuid}\/archive":{"post":{"tags":["Drive > Files > Share link > Archive"],"summary":"Build archive","description":"Build an archive from files in the share link. The archive can then be downloaded using the drive\/{drive_id}\/share\/{sharelink_uuid}\/download<\/a> route.\n<\/br><\/br>\nThe file identifiers should be in the same parent directory.\n<\/note>\n<\/br>\nThe archive should contain at least one file and may not contain more than 20,000 files.\n<\/note>","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Sharelink token","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"sharelink_uuid","in":"path"}],"requestBody":{"content":{"application\/json":{"schema":{"title":"Request body","type":"object","properties":{"except_file_ids":{"title":"except_file_ids","type":"array","items":{"title":"item","type":"integer"},"description":"Array of files to exclude from the request; only used when parent_id is set, meaningless otherwise"},"file_ids":{"title":"file_ids","type":"array","items":{"title":"item","type":"integer"},"description":"Array of files to include in the request; required without parent_id"},"parent_id":{"title":"parent_id","type":"integer","description":"The directory containing the files to include in the request; required without file_ids"}}}}}},"responses":{"201":{"description":"Created","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/91ac10ff_ArchiveResource"}}}]}}}},"400":{"description":"Bad Request","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 400","type":"object","properties":{"code":{"enum":["file_not_in_share_link_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.file_not_in_share_link_error<\/strong>: The provided file or directory does not belong to the given share link.<\/note>","example":"file_not_in_share_link_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}}}},"\/2\/app\/{drive_id}\/share\/{sharelink_uuid}\/archive\/{archive_uuid}\/download":{"get":{"tags":["Drive > Files > Share link > Archive"],"summary":"Download sharelink archive","description":"You can download an archive\/zip with the archive token provided by the route drive\/{drive_id}\/share\/{sharelink_uuid}\/download<\/a>.\nPlease note that this may respond a 302 to actually download the requested content.<\/note>","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"Sharelink token","required":true,"style":"simple","explode":true,"schema":{"type":"string"},"name":"sharelink_uuid","in":"path"},{"description":"Archive token","required":true,"style":"simple","explode":true,"schema":{"type":"string"},"name":"archive_uuid","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/zip":{"schema":{"$ref":"#\/components\/schemas\/91ac10ff_Stream"}}}},"400":{"description":"Bad Request","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 400","type":"object","properties":{"code":{"enum":["too_many_files_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.too_many_files_error<\/strong>: To many files, max limit reached.<\/note>","example":"too_many_files_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}}}},"\/3\/drive\/{drive_id}\/activities":{"get":{"tags":["Drive > Activity"],"summary":"Get drive activities of all the users.","description":"Get all activities from drive as defined in options","operationId":"kDriveGetDriveActivitiesOfAllTheUsersV3","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"style":"form","explode":true,"schema":{"title":"cursor","type":"string","description":"The `cursor` parameter must be provided to fetch the subsequent batch of results. It essentially acts as a marker, indicating the point at which to begin retrieving the next set or page of the list"},"name":"cursor","in":"query"},{"style":"form","explode":true,"schema":{"title":"limit","maximum":1000,"minimum":5,"type":"integer","description":"The maximum number of items returned","default":10},"name":"limit","in":"query"},{"style":"form","explode":true,"schema":{"title":"order_by","type":"array","items":{"enum":["created_at"],"type":"string","description":"The `order_by` parameter accepts values corresponding to the items attributes, allowing you to specify the field by which the list should be sorted"}},"name":"order_by","in":"query"},{"style":"form","explode":true,"schema":{"title":"order","enum":["asc","desc"],"type":"string","description":"Specifies the default sorting direction for any `order_by` parameters provided"},"name":"order","in":"query"},{"style":"form","explode":true,"schema":{"title":"order_for","type":"array","items":{"enum":["asc","desc"],"type":"string","description":"Specifies the sorting direction for a specific order_by, it should be used with the `order_by` key like `order_for[created_at]=asc`"}},"name":"order_for","in":"query"},{"description":"Override the language of the request, in most cases when an e-mail is triggered in the request.","style":"form","explode":true,"schema":{"enum":["de","en","es","fr","it"],"type":"string"},"name":"lang","in":"query"},{"style":"form","explode":true,"schema":{"title":"actions","type":"array","items":{"title":"item","enum":["acl_insert","acl_main_users_insert","acl_main_users_remove","acl_main_users_update","acl_remove","acl_team_insert","acl_team_remove","acl_team_update","acl_update","acl_user_insert","acl_user_remove","acl_user_update","category_create","category_delete","category_update","collaborative_folder_access","collaborative_folder_create","collaborative_folder_delete","collaborative_folder_update","collaborative_user_access","collaborative_user_create","collaborative_user_delete","comment_create","comment_delete","comment_like","comment_resolve","comment_unlike","comment_update","exchange_pro_create","file_access","file_categorize","file_color_delete","file_color_update","file_create","file_delete","file_favorite_create","file_favorite_remove","file_ia_categorize","file_move","file_move_out","file_rename","file_rename_alias","file_restore","file_restore_inherited","file_share_create","file_share_delete","file_share_update","file_trash","file_trash_inherited","file_uncategorize","file_update","file_update_mime_type","maintenance_added","maintenance_removed","rewind_ended","rewind_started","share_link_create","share_link_delete","share_link_show","share_link_update","trash_empty","trash_empty_auto","update_trash_settings","user_connected","user_create","user_delete","user_restore","user_update"],"type":"string","description":"Logged interaction type of activities on the drive or file.acl_insert<\/strong>: Technical: when a new group access to a file\/directory is create.<\/note>acl_main_users_insert<\/strong>: Logged when the main kDrive team access to a file\/directory is created.<\/note>acl_main_users_remove<\/strong>: Logged when the main kDrive team to a file\/directory is removed.<\/note>acl_main_users_update<\/strong>: Logged when the main kDrive team to a file\/directory is modified.<\/note>acl_remove<\/strong>: Technical: when a group access to a file\/directory is removed.<\/note>acl_team_insert<\/strong>: Logged when a team access to a file\/directory is created.<\/note>acl_team_remove<\/strong>: Logged when a team access to a file\/directory is removed.<\/note>acl_team_update<\/strong>: Logged when a team access to a file\/directory is modified.<\/note>acl_update<\/strong>: Technical: when a group access to a file\/directory is modified.<\/note>acl_user_insert<\/strong>: Logged when an user\/admin access to a file\/directory is created.<\/note>acl_user_remove<\/strong>: Logged when an user\/admin access to a file\/directory is removed.<\/note>acl_user_update<\/strong>: Logged when an user\/admin access to a file\/directory is modified.<\/note>category_create<\/strong>: Logged when a new category is added.<\/note>category_delete<\/strong>: Logged when a category is deleted.<\/note>category_update<\/strong>: Logged when a category is renamed.<\/note>collaborative_folder_access<\/strong>: Logged when an user\/guest access to the dropbox.<\/note>collaborative_folder_create<\/strong>: Logged when an user create a dropbox.<\/note>collaborative_folder_delete<\/strong>: Logged when an user delete the dropbox.<\/note>collaborative_folder_update<\/strong>: Logged when an user update settings of the dropbox.<\/note>collaborative_user_access<\/strong>: Logged when an user\/guest upload to the dropbox.<\/note>collaborative_user_create<\/strong>: Logged when an user\/guest add his information before uploading to the dropbox.<\/note>collaborative_user_delete<\/strong>: Logged when an user remove the directory to the dropbox.<\/note>comment_create<\/strong>: Logged when an user\/admin add a comment on a file.<\/note>comment_delete<\/strong>: Logged when an user\/admin delete a comment on a file.<\/note>comment_like<\/strong>: Logged when an user\/admin like a comment on a file.<\/note>comment_resolve<\/strong>: Logged when an user\/admin resolve a comment on a file.<\/note>comment_unlike<\/strong>: Logged when an user\/admin unlike a comment on a file.<\/note>comment_update<\/strong>: Logged when an user\/admin update a comment on a file.<\/note>exchange_pro_create<\/strong>: Technical: no used.<\/note>file_access<\/strong>: Logged when an user\/guest access to the file.<\/note>file_categorize<\/strong>: Logged when a category is added to the file\/directory.<\/note>file_color_delete<\/strong>: Logged when a directory color is removed.<\/note>file_color_update<\/strong>: Logged when a directory color changed.<\/note>file_create<\/strong>: Logged when on the first file creation.<\/note>file_delete<\/strong>: Logged when the file is deleted.<\/note>file_favorite_create<\/strong>: Logged when a file\/directory is flagged as favorites.<\/note>file_favorite_remove<\/strong>: Logged when a file\/directory is unflagged from favorites.<\/note>file_ia_categorize<\/strong>: Logged when a file is categorized by the ia.<\/note>file_move<\/strong>: Logged when the file is added inside a directory.<\/note>file_move_out<\/strong>: Logged when the file is removed from a directory.<\/note>file_rename<\/strong>: Logged when the file is renamed.<\/note>file_rename_alias<\/strong>: Logged when a root file is renamed by an external user (only visible for the external user).<\/note>file_restore<\/strong>: Logged when the file is restored from the trash.<\/note>file_share_create<\/strong>: Logged when an external user access to a file\/directory is created.<\/note>file_share_delete<\/strong>: Logged when an external user access to a file\/directory is removed.<\/note>file_share_update<\/strong>: Logged when an external user access to a file\/directory is modified to another permission.<\/note>file_trash<\/strong>: Logged when the file is sent to trash.<\/note>file_uncategorize<\/strong>: Logged when a category is removed to the file\/directory.<\/note>file_update<\/strong>: Logged when the file is updated.<\/note>file_update_mime_type<\/strong>: Logged when a file mime_type is updated.<\/note>rewind_ended<\/strong>: Logged when the user ended a rewind.<\/note>rewind_started<\/strong>: Logged when the user started a rewind.<\/note>share_link_create<\/strong>: Logged when a public share link to a file\/directory is created.<\/note>share_link_delete<\/strong>: Logged when a public share link to a file\/directory is deleted.<\/note>share_link_show<\/strong>: Logged when a public share link to a file\/directory is seen by someone else.<\/note>share_link_update<\/strong>: Logged when a public share link to a file\/directory is modified.<\/note>trash_empty<\/strong>: Logged when the user empties the trash.<\/note>trash_empty_auto<\/strong>: Logged when the trash empties old files automatically.<\/note>update_trash_settings<\/strong>: Logged when the user changes trash the settings.<\/note>user_connected<\/strong>: Logged when an user is connected to the drive.<\/note>user_create<\/strong>: Logged when an user\/admin is added to the drive.<\/note>user_delete<\/strong>: Logged when an user\/admin has been removed of the drive.<\/note>user_restore<\/strong>: Logged when an user\/admin has been restored of the drive.<\/note>user_update<\/strong>: Logged when an user\/admin information has changed.<\/note>","example":"acl_insert"}},"name":"actions","in":"query"},{"style":"form","explode":true,"schema":{"title":"depth","enum":["children","file","folder","unlimited"],"type":"string"},"name":"depth","in":"query"},{"style":"form","explode":true,"schema":{"title":"files","maxItems":500,"minItems":1,"type":"array","items":{"title":"item","minimum":1,"type":"integer"},"description":"List of files for which to retrieve activities"},"name":"files","in":"query"},{"style":"form","explode":true,"schema":{"title":"from","type":"integer"},"name":"from","in":"query"},{"style":"form","explode":true,"schema":{"title":"terms","minLength":3,"type":"string"},"name":"terms","in":"query"},{"style":"form","explode":true,"schema":{"title":"until","type":"integer"},"name":"until","in":"query"},{"style":"form","explode":true,"schema":{"title":"users","type":"array","items":{"title":"item","type":"integer"}},"name":"users","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_ActivityFileV3"}}}},{"$ref":"#\/components\/schemas\/91ac10ff_NavigatorResponse"}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/3\/drive\/{drive_id}\/activities\/total":{"get":{"tags":["Drive > Activity"],"summary":"Get total count drive activities of all the users.","description":"Get total of all activities from drive as defined in options","operationId":"kDriveGetTotalCountDriveActivitiesOfAllTheUsersV3","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"style":"form","explode":true,"schema":{"title":"actions","type":"array","items":{"title":"item","enum":["acl_insert","acl_main_users_insert","acl_main_users_remove","acl_main_users_update","acl_remove","acl_team_insert","acl_team_remove","acl_team_update","acl_update","acl_user_insert","acl_user_remove","acl_user_update","category_create","category_delete","category_update","collaborative_folder_access","collaborative_folder_create","collaborative_folder_delete","collaborative_folder_update","collaborative_user_access","collaborative_user_create","collaborative_user_delete","comment_create","comment_delete","comment_like","comment_resolve","comment_unlike","comment_update","exchange_pro_create","file_access","file_categorize","file_color_delete","file_color_update","file_create","file_delete","file_favorite_create","file_favorite_remove","file_ia_categorize","file_move","file_move_out","file_rename","file_rename_alias","file_restore","file_restore_inherited","file_share_create","file_share_delete","file_share_update","file_trash","file_trash_inherited","file_uncategorize","file_update","file_update_mime_type","maintenance_added","maintenance_removed","rewind_ended","rewind_started","share_link_create","share_link_delete","share_link_show","share_link_update","trash_empty","trash_empty_auto","update_trash_settings","user_connected","user_create","user_delete","user_restore","user_update"],"type":"string","description":"Logged interaction type of activities on the drive or file.acl_insert<\/strong>: Technical: when a new group access to a file\/directory is create.<\/note>acl_main_users_insert<\/strong>: Logged when the main kDrive team access to a file\/directory is created.<\/note>acl_main_users_remove<\/strong>: Logged when the main kDrive team to a file\/directory is removed.<\/note>acl_main_users_update<\/strong>: Logged when the main kDrive team to a file\/directory is modified.<\/note>acl_remove<\/strong>: Technical: when a group access to a file\/directory is removed.<\/note>acl_team_insert<\/strong>: Logged when a team access to a file\/directory is created.<\/note>acl_team_remove<\/strong>: Logged when a team access to a file\/directory is removed.<\/note>acl_team_update<\/strong>: Logged when a team access to a file\/directory is modified.<\/note>acl_update<\/strong>: Technical: when a group access to a file\/directory is modified.<\/note>acl_user_insert<\/strong>: Logged when an user\/admin access to a file\/directory is created.<\/note>acl_user_remove<\/strong>: Logged when an user\/admin access to a file\/directory is removed.<\/note>acl_user_update<\/strong>: Logged when an user\/admin access to a file\/directory is modified.<\/note>category_create<\/strong>: Logged when a new category is added.<\/note>category_delete<\/strong>: Logged when a category is deleted.<\/note>category_update<\/strong>: Logged when a category is renamed.<\/note>collaborative_folder_access<\/strong>: Logged when an user\/guest access to the dropbox.<\/note>collaborative_folder_create<\/strong>: Logged when an user create a dropbox.<\/note>collaborative_folder_delete<\/strong>: Logged when an user delete the dropbox.<\/note>collaborative_folder_update<\/strong>: Logged when an user update settings of the dropbox.<\/note>collaborative_user_access<\/strong>: Logged when an user\/guest upload to the dropbox.<\/note>collaborative_user_create<\/strong>: Logged when an user\/guest add his information before uploading to the dropbox.<\/note>collaborative_user_delete<\/strong>: Logged when an user remove the directory to the dropbox.<\/note>comment_create<\/strong>: Logged when an user\/admin add a comment on a file.<\/note>comment_delete<\/strong>: Logged when an user\/admin delete a comment on a file.<\/note>comment_like<\/strong>: Logged when an user\/admin like a comment on a file.<\/note>comment_resolve<\/strong>: Logged when an user\/admin resolve a comment on a file.<\/note>comment_unlike<\/strong>: Logged when an user\/admin unlike a comment on a file.<\/note>comment_update<\/strong>: Logged when an user\/admin update a comment on a file.<\/note>exchange_pro_create<\/strong>: Technical: no used.<\/note>file_access<\/strong>: Logged when an user\/guest access to the file.<\/note>file_categorize<\/strong>: Logged when a category is added to the file\/directory.<\/note>file_color_delete<\/strong>: Logged when a directory color is removed.<\/note>file_color_update<\/strong>: Logged when a directory color changed.<\/note>file_create<\/strong>: Logged when on the first file creation.<\/note>file_delete<\/strong>: Logged when the file is deleted.<\/note>file_favorite_create<\/strong>: Logged when a file\/directory is flagged as favorites.<\/note>file_favorite_remove<\/strong>: Logged when a file\/directory is unflagged from favorites.<\/note>file_ia_categorize<\/strong>: Logged when a file is categorized by the ia.<\/note>file_move<\/strong>: Logged when the file is added inside a directory.<\/note>file_move_out<\/strong>: Logged when the file is removed from a directory.<\/note>file_rename<\/strong>: Logged when the file is renamed.<\/note>file_rename_alias<\/strong>: Logged when a root file is renamed by an external user (only visible for the external user).<\/note>file_restore<\/strong>: Logged when the file is restored from the trash.<\/note>file_share_create<\/strong>: Logged when an external user access to a file\/directory is created.<\/note>file_share_delete<\/strong>: Logged when an external user access to a file\/directory is removed.<\/note>file_share_update<\/strong>: Logged when an external user access to a file\/directory is modified to another permission.<\/note>file_trash<\/strong>: Logged when the file is sent to trash.<\/note>file_uncategorize<\/strong>: Logged when a category is removed to the file\/directory.<\/note>file_update<\/strong>: Logged when the file is updated.<\/note>file_update_mime_type<\/strong>: Logged when a file mime_type is updated.<\/note>rewind_ended<\/strong>: Logged when the user ended a rewind.<\/note>rewind_started<\/strong>: Logged when the user started a rewind.<\/note>share_link_create<\/strong>: Logged when a public share link to a file\/directory is created.<\/note>share_link_delete<\/strong>: Logged when a public share link to a file\/directory is deleted.<\/note>share_link_show<\/strong>: Logged when a public share link to a file\/directory is seen by someone else.<\/note>share_link_update<\/strong>: Logged when a public share link to a file\/directory is modified.<\/note>trash_empty<\/strong>: Logged when the user empties the trash.<\/note>trash_empty_auto<\/strong>: Logged when the trash empties old files automatically.<\/note>update_trash_settings<\/strong>: Logged when the user changes trash the settings.<\/note>user_connected<\/strong>: Logged when an user is connected to the drive.<\/note>user_create<\/strong>: Logged when an user\/admin is added to the drive.<\/note>user_delete<\/strong>: Logged when an user\/admin has been removed of the drive.<\/note>user_restore<\/strong>: Logged when an user\/admin has been restored of the drive.<\/note>user_update<\/strong>: Logged when an user\/admin information has changed.<\/note>","example":"acl_insert"}},"name":"actions","in":"query"},{"style":"form","explode":true,"schema":{"title":"depth","enum":["children","file","folder","unlimited"],"type":"string"},"name":"depth","in":"query"},{"style":"form","explode":true,"schema":{"title":"files","maxItems":500,"minItems":1,"type":"array","items":{"title":"item","minimum":1,"type":"integer"},"description":"List of files for which to retrieve activities"},"name":"files","in":"query"},{"style":"form","explode":true,"schema":{"title":"from","type":"integer"},"name":"from","in":"query"},{"style":"form","explode":true,"schema":{"title":"terms","minLength":3,"type":"string"},"name":"terms","in":"query"},{"style":"form","explode":true,"schema":{"title":"until","type":"integer"},"name":"until","in":"query"},{"style":"form","explode":true,"schema":{"title":"users","type":"array","items":{"title":"item","type":"integer"}},"name":"users","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_ActivityFileV3"}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/3\/drive\/{drive_id}\/users":{"get":{"tags":["Drive"],"summary":"Get users","description":"Retrieves a list of users. By default, this endpoint returns all active account users. Using the types parameter, you can filter by: account, drive role, or pending invitation.\n\n
The results are filtered based on the requesting user's permissions.<\/note>","operationId":"kDriveGetUsersV3","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"style":"form","explode":true,"schema":{"title":"cursor","type":"string","description":"The `cursor` parameter must be provided to fetch the subsequent batch of results. It essentially acts as a marker, indicating the point at which to begin retrieving the next set or page of the list"},"name":"cursor","in":"query"},{"style":"form","explode":true,"schema":{"title":"limit","maximum":1000,"minimum":5,"type":"integer","description":"The maximum number of items returned","default":10},"name":"limit","in":"query"},{"style":"form","explode":true,"schema":{"title":"order_by","type":"array","items":{"enum":["display_name","first_name","last_name"],"type":"string","description":"The `order_by` parameter accepts values corresponding to the items attributes, allowing you to specify the field by which the list should be sorted"}},"name":"order_by","in":"query"},{"style":"form","explode":true,"schema":{"title":"order","enum":["asc","desc"],"type":"string","description":"Specifies the default sorting direction for any `order_by` parameters provided"},"name":"order","in":"query"},{"style":"form","explode":true,"schema":{"title":"order_for","type":"array","items":{"enum":["asc","desc"],"type":"string","description":"Specifies the sorting direction for a specific order_by, it should be used with the `order_by` key like `order_for[display_name]=asc`"}},"name":"order_for","in":"query"},{"style":"form","explode":true,"schema":{"title":"search","type":"string","description":"Search user by his first name, last name or email"},"name":"search","in":"query"},{"style":"form","explode":true,"schema":{"title":"status","type":"array","items":{"title":"item","enum":["active","deleted","locked","pending","withdrawn"],"type":"string"},"description":"Status of the resource `{name}`"},"name":"status","in":"query"},{"style":"form","explode":true,"schema":{"title":"types","type":"array","items":{"title":"item","enum":["account","admin","expired","external","pending","user"],"type":"string"}},"name":"types","in":"query"},{"style":"form","explode":true,"schema":{"title":"user_ids","maxItems":100,"type":"array","items":{"title":"item","minimum":1,"type":"integer"},"description":"User identifiers"},"name":"user_ids","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_UserV3"}}}},{"$ref":"#\/components\/schemas\/91ac10ff_NavigatorResponse"}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/3\/drive\/{drive_id}\/wake":{"post":{"tags":["Drive"],"summary":"Wake a sleeping drive up","description":"Request a {@link Drive} with a {@link MaintenanceType::Asleep} maintenance to wake up.","operationId":"kDriveWakeASleepingDriveUpV3","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"boolean"}}}]}}}},"400":{"description":"Bad Request","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 400","type":"object","properties":{"code":{"enum":["drive_is_not_asleep_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_not_asleep_error<\/strong>: Drive is not asleep.<\/note>","example":"drive_is_not_asleep_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"500":{"description":"Internal Server Error","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 500","type":"object","properties":{"code":{"enum":["drive_wont_wake_up_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_wont_wake_up_error<\/strong>: Something went wrong while trying to wake this drive up.<\/note>","example":"drive_wont_wake_up_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/3\/drive\/{drive_id}\/files\/{file_id}":{"get":{"tags":["Drive > Files > File\/Directory"],"summary":"Get File\/Directory","description":"Get File\/Directory by file identifier.\nIf you need to access the root directory, set the 'file_id' parameter to '1'; from there, you can navigate to other files and directories.","operationId":"kDriveGetFileDirectoryV3","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#\/components\/schemas\/91ac10ff_DirectoryV3"},{"$ref":"#\/components\/schemas\/91ac10ff_FileV3"}]}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/3\/drive\/{drive_id}\/files\/{file_id}\/files":{"get":{"tags":["Drive > Files > File\/Directory"],"summary":"Get files in directory","description":"Get paginate children file\/directory of specific directory (file identifier)","operationId":"kDriveGetFilesInDirectoryV3","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"style":"form","explode":true,"schema":{"title":"cursor","type":"string","description":"The `cursor` parameter must be provided to fetch the subsequent batch of results. It essentially acts as a marker, indicating the point at which to begin retrieving the next set or page of the list"},"name":"cursor","in":"query"},{"style":"form","explode":true,"schema":{"title":"limit","maximum":1000,"minimum":5,"type":"integer","description":"The maximum number of items returned","default":10},"name":"limit","in":"query"},{"style":"form","explode":true,"schema":{"title":"order_by","type":"array","items":{"enum":["added_at","last_modified_at","mime_type","name","revised_at","size","type","updated_at"],"type":"string","description":"The `order_by` parameter accepts values corresponding to the items attributes, allowing you to specify the field by which the list should be sorted"}},"name":"order_by","in":"query"},{"style":"form","explode":true,"schema":{"title":"order","enum":["asc","desc"],"type":"string","description":"Specifies the default sorting direction for any `order_by` parameters provided"},"name":"order","in":"query"},{"style":"form","explode":true,"schema":{"title":"order_for","type":"array","items":{"enum":["asc","desc"],"type":"string","description":"Specifies the sorting direction for a specific order_by, it should be used with the `order_by` key like `order_for[type]=asc`"}},"name":"order_for","in":"query"},{"style":"form","explode":true,"schema":{"title":"depth","enum":["child","unlimited"],"type":"string","description":"Cannot be used on file_id `1`."},"name":"depth","in":"query"},{"style":"form","explode":true,"schema":{"title":"type","type":"array","items":{"title":"item","enum":["dir","file","vault"],"type":"string","description":"The file type structure either a File, a Directory or a Vault","example":"file"}},"name":"type","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"oneOf":[{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_DirectoryV3"}},{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_FileV3"}}]}}},{"$ref":"#\/components\/schemas\/91ac10ff_NavigatorResponse"}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/3\/drive\/{drive_id}\/files\/{file_id}\/name":{"get":{"tags":["Drive > Files > File\/Directory"],"summary":"Get sub file\/directory by filename","description":"Get a sub directory or file of a Directory by their filename","operationId":"kDriveGetSubFiledirectoryByFilenameV3","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"required":true,"style":"form","explode":true,"schema":{"title":"name","type":"string","description":"Name of the File\/Directory"},"name":"name","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#\/components\/schemas\/91ac10ff_DirectoryV3"},{"$ref":"#\/components\/schemas\/91ac10ff_FileV3"}]}}}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"access_denied"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/3\/drive\/{drive_id}\/files\/{file_id}\/activities":{"get":{"tags":["Drive > Activity"],"summary":"Get file activities","description":"Get activities of a file|directory","operationId":"kDriveGetFileActivitiesV3","parameters":[{"description":"the drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"the file identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"description":"*Optional* : Allows loading additional data about a resource, which may include related resources.","style":"form","explode":true,"schema":{"type":"string"},"name":"with","in":"query"},{"style":"form","explode":true,"schema":{"title":"cursor","type":"string","description":"The `cursor` parameter must be provided to fetch the subsequent batch of results. It essentially acts as a marker, indicating the point at which to begin retrieving the next set or page of the list"},"name":"cursor","in":"query"},{"style":"form","explode":true,"schema":{"title":"limit","maximum":1000,"minimum":5,"type":"integer","description":"The maximum number of items returned","default":10},"name":"limit","in":"query"},{"style":"form","explode":true,"schema":{"title":"order_by","type":"array","items":{"enum":["created_at"],"type":"string","description":"The `order_by` parameter accepts values corresponding to the items attributes, allowing you to specify the field by which the list should be sorted"}},"name":"order_by","in":"query"},{"style":"form","explode":true,"schema":{"title":"order","enum":["asc","desc"],"type":"string","description":"Specifies the default sorting direction for any `order_by` parameters provided"},"name":"order","in":"query"},{"style":"form","explode":true,"schema":{"title":"order_for","type":"array","items":{"enum":["asc","desc"],"type":"string","description":"Specifies the sorting direction for a specific order_by, it should be used with the `order_by` key like `order_for[created_at]=asc`"}},"name":"order_for","in":"query"},{"style":"form","explode":true,"schema":{"title":"actions","type":"array","items":{"title":"item","enum":["collaborative_folder_access","collaborative_folder_create","collaborative_folder_delete","collaborative_folder_update","collaborative_user_access","collaborative_user_create","collaborative_user_delete","comment_create","comment_delete","comment_like","comment_resolve","comment_unlike","comment_update","file_access","file_categorize","file_color_delete","file_color_update","file_create","file_delete","file_favorite_create","file_favorite_remove","file_ia_categorize","file_move","file_move_out","file_rename","file_rename_alias","file_restore","file_share_create","file_share_delete","file_share_update","file_trash","file_uncategorize","file_update","share_link_create","share_link_delete","share_link_show","share_link_update"],"type":"string","description":"Logged interaction type of activities on the drive or file.collaborative_folder_access<\/strong>: Logged when an user\/guest access to the dropbox.<\/note>collaborative_folder_create<\/strong>: Logged when an user create a dropbox.<\/note>collaborative_folder_delete<\/strong>: Logged when an user delete the dropbox.<\/note>collaborative_folder_update<\/strong>: Logged when an user update settings of the dropbox.<\/note>collaborative_user_access<\/strong>: Logged when an user\/guest upload to the dropbox.<\/note>collaborative_user_create<\/strong>: Logged when an user\/guest add his information before uploading to the dropbox.<\/note>collaborative_user_delete<\/strong>: Logged when an user remove the directory to the dropbox.<\/note>comment_create<\/strong>: Logged when an user\/admin add a comment on a file.<\/note>comment_delete<\/strong>: Logged when an user\/admin delete a comment on a file.<\/note>comment_like<\/strong>: Logged when an user\/admin like a comment on a file.<\/note>comment_resolve<\/strong>: Logged when an user\/admin resolve a comment on a file.<\/note>comment_unlike<\/strong>: Logged when an user\/admin unlike a comment on a file.<\/note>comment_update<\/strong>: Logged when an user\/admin update a comment on a file.<\/note>file_access<\/strong>: Logged when an user\/guest access to the file.<\/note>file_categorize<\/strong>: Logged when a category is added to the file\/directory.<\/note>file_color_delete<\/strong>: Logged when a directory color is removed.<\/note>file_color_update<\/strong>: Logged when a directory color changed.<\/note>file_create<\/strong>: Logged when on the first file creation.<\/note>file_delete<\/strong>: Logged when the file is deleted.<\/note>file_favorite_create<\/strong>: Logged when a file\/directory is flagged as favorites.<\/note>file_favorite_remove<\/strong>: Logged when a file\/directory is unflagged from favorites.<\/note>file_ia_categorize<\/strong>: Logged when a file is categorized by the ia.<\/note>file_move<\/strong>: Logged when the file is added inside a directory.<\/note>file_move_out<\/strong>: Logged when the file is removed from a directory.<\/note>file_rename<\/strong>: Logged when the file is renamed.<\/note>file_rename_alias<\/strong>: Logged when a root file is renamed by an external user (only visible for the external user).<\/note>file_restore<\/strong>: Logged when the file is restored from the trash.<\/note>file_share_create<\/strong>: Logged when an external user access to a file\/directory is created.<\/note>file_share_delete<\/strong>: Logged when an external user access to a file\/directory is removed.<\/note>file_share_update<\/strong>: Logged when an external user access to a file\/directory is modified to another permission.<\/note>file_trash<\/strong>: Logged when the file is sent to trash.<\/note>file_uncategorize<\/strong>: Logged when a category is removed to the file\/directory.<\/note>file_update<\/strong>: Logged when the file is updated.<\/note>share_link_create<\/strong>: Logged when a public share link to a file\/directory is created.<\/note>share_link_delete<\/strong>: Logged when a public share link to a file\/directory is deleted.<\/note>share_link_show<\/strong>: Logged when a public share link to a file\/directory is seen by someone else.<\/note>share_link_update<\/strong>: Logged when a public share link to a file\/directory is modified.<\/note>","example":"collaborative_folder_access"}},"name":"actions","in":"query"},{"style":"form","explode":true,"schema":{"title":"depth","enum":["children","file","folder","unlimited"],"type":"string"},"name":"depth","in":"query"},{"style":"form","explode":true,"schema":{"title":"from","type":"integer"},"name":"from","in":"query"},{"style":"form","explode":true,"schema":{"title":"terms","minLength":3,"type":"string"},"name":"terms","in":"query"},{"style":"form","explode":true,"schema":{"title":"until","type":"integer"},"name":"until","in":"query"},{"style":"form","explode":true,"schema":{"title":"users","type":"array","items":{"title":"item","type":"integer"}},"name":"users","in":"query"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/91ac10ff_ActivityFileV3"}}}},{"$ref":"#\/components\/schemas\/91ac10ff_NavigatorResponse"}]}}}},"403":{"description":"Forbidden","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 403","type":"object","properties":{"code":{"enum":["access_denied","forbidden_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.forbidden_error<\/strong>: Triggered when user does not have the file permission.<\/note>access_denied<\/strong>: Triggered the user do not have access to this resource.<\/note>","example":"forbidden_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}},"503":{"description":"Service Unavailable","content":{"application\/json":{"schema":{"allOf":[{"$ref":"#\/components\/schemas\/ErrorResponse"},{"type":"object","properties":{"error":{"title":"The error returned when the http code is 503","type":"object","properties":{"code":{"enum":["drive_is_in_maintenance_error"],"type":"string","description":"The error code returned, the description<\/strong> add details relative to this code.drive_is_in_maintenance_error<\/strong>: Drive is in maintenance.<\/note>","example":"drive_is_in_maintenance_error"},"description":{"type":"string","description":"More details about the error","example":"Something wrong, additional information about the error code"}}}}}]}}}}},"security":[{"bearerAuth":[]}]}},"\/3\/drive\/{drive_id}\/files\/{file_id}\/count":{"get":{"tags":["Drive > Files > File\/Directory"],"summary":"Count element in directory","description":"Get number of element in a directory by ID","operationId":"kDriveCountElementInDirectoryV3","parameters":[{"description":"Drive identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"drive_id","in":"path"},{"description":"File identifier","required":true,"style":"simple","explode":true,"schema":{"type":"integer"},"name":"file_id","in":"path"},{"style":"form","explode":true,"schema":{"title":"depth","enum":["folder","unlimited"],"type":"string","description":"Specifies how elements are counted within given folder. Choose either to count only within the specified folder (folder) or to include subfolders in the count (unlimited). The default mode is folder.