diff --git a/src/Speckle.Sdk/Api/GraphQL/Inputs/FileImportInputs.cs b/src/Speckle.Sdk/Api/GraphQL/Inputs/FileImportInputs.cs index 9ccf478b..0a1ebee5 100644 --- a/src/Speckle.Sdk/Api/GraphQL/Inputs/FileImportInputs.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Inputs/FileImportInputs.cs @@ -2,8 +2,10 @@ public record GenerateFileUploadUrlInput(string projectId, string fileName); +[Obsolete(FileImportInputBase.FILE_IMPORT_DEPRECATION_MESSAGE)] public record StartFileImportInput(string projectId, string modelId, string fileId, string etag); +[Obsolete(FileImportInputBase.FILE_IMPORT_DEPRECATION_MESSAGE)] public record FileImportResult( double durationSeconds, double downloadDurationSeconds, @@ -14,14 +16,23 @@ public record FileImportResult( public abstract class FileImportInputBase { + internal const string FILE_IMPORT_DEPRECATION_MESSAGE = + "Part of the old API surface and will be removed in the future. Use the new ingestion API instead. Field will be deleted on June 1st, 2026"; + + [Obsolete(FileImportInputBase.FILE_IMPORT_DEPRECATION_MESSAGE)] + protected FileImportInputBase() { } + public required string projectId { get; init; } public required string jobId { get; init; } public required IReadOnlyCollection warnings { get; init; } + + [Obsolete(FileImportInputBase.FILE_IMPORT_DEPRECATION_MESSAGE)] public required FileImportResult result { get; init; } } #pragma warning disable CA1822 //Mark members as static +[Obsolete(FILE_IMPORT_DEPRECATION_MESSAGE)] public sealed class FileImportSuccessInput() : FileImportInputBase() { public const string TYPE_STATUS = "success"; @@ -29,6 +40,7 @@ public sealed class FileImportSuccessInput() : FileImportInputBase() public string status => TYPE_STATUS; } +[Obsolete(FILE_IMPORT_DEPRECATION_MESSAGE)] public sealed class FileImportErrorInput() : FileImportInputBase() { public const string TYPE_STATUS = "error"; diff --git a/src/Speckle.Sdk/Api/GraphQL/Resources/FileImportResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/FileImportResource.cs index 98eb9951..e8dda92e 100644 --- a/src/Speckle.Sdk/Api/GraphQL/Resources/FileImportResource.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Resources/FileImportResource.cs @@ -29,8 +29,10 @@ public sealed class FileImportResource : IDisposable /// /// Only use this if you are writing a file importer, that is responsible for /// processing file import jobs. - /// Only works on servers version >=2.25.8 + /// Only works on servers version >=2.25.8 but from 3.0.7 onwards has been deprecated and replaced by model ingestion api + /// see /// + [Obsolete(FileImportInputBase.FILE_IMPORT_DEPRECATION_MESSAGE)] public async Task FinishFileImportJob(FileImportInputBase input, CancellationToken cancellationToken) { //language=graphql @@ -57,7 +59,11 @@ public sealed class FileImportResource : IDisposable /// /// /// - /// Only works on servers version >=2.25.8 + /// + /// Only works on servers version >=2.25.8 but from 3.0.7 onwards has been deprecated and replaced by model ingestion api + /// see + /// + [Obsolete(FileImportInputBase.FILE_IMPORT_DEPRECATION_MESSAGE)] public async Task StartFileImportJob( StartFileImportInput input, CancellationToken cancellationToken = default