From 70406f994096c0c6f81864ed5af5243b412f50db Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 23 Apr 2026 19:07:28 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...escript.ApiEndpointsClient.GetProject.g.cs | 538 ++++++++++++++ ...cript.ApiEndpointsClient.ListProjects.g.cs | 533 ++++++++++++++ ...escript.ApiEndpointsClient.PublishJob.g.cs | 656 +++++++++++++++++ ...script.IApiEndpointsClient.GetProject.g.cs | 24 + ...ript.IApiEndpointsClient.ListProjects.g.cs | 47 ++ ...script.IApiEndpointsClient.PublishJob.g.cs | 85 +++ ...ters.GetProjectResponseMediaFilesType.g.cs | 53 ++ ...ProjectResponseMediaFilesTypeNullable.g.cs | 60 ++ .../Descript.JsonConverters.JobStatus.g.cs | 17 +- ....JsonConverters.ListProjectsDirection.g.cs | 53 ++ ...verters.ListProjectsDirectionNullable.g.cs | 60 ++ ...cript.JsonConverters.ListProjectsSort.g.cs | 53 ++ ...onConverters.ListProjectsSortNullable.g.cs | 60 ++ ...onConverters.PublishErrorResultStatus.g.cs | 53 ++ ...ters.PublishErrorResultStatusNullable.g.cs | 60 ++ ...nverters.PublishJobRequestAccessLevel.g.cs | 53 ++ ....PublishJobRequestAccessLevelNullable.g.cs | 60 ++ ...Converters.PublishJobRequestMediaType.g.cs | 53 ++ ...rs.PublishJobRequestMediaTypeNullable.g.cs | 60 ++ ...onverters.PublishJobRequestResolution.g.cs | 53 ++ ...s.PublishJobRequestResolutionNullable.g.cs | 60 ++ ...onConverters.PublishJobStatusJobState.g.cs | 53 ++ ...ters.PublishJobStatusJobStateNullable.g.cs | 60 ++ ...sonConverters.PublishJobStatusJobType.g.cs | 53 ++ ...rters.PublishJobStatusJobTypeNullable.g.cs | 60 ++ ...ishJobStatusResultDiscriminatorStatus.g.cs | 53 ++ ...atusResultDiscriminatorStatusNullable.g.cs | 60 ++ ...Converters.PublishSuccessResultStatus.g.cs | 53 ++ ...rs.PublishSuccessResultStatusNullable.g.cs | 60 ++ .../Descript.JsonConverters.Result3.g.cs | 72 ++ .../Descript.JsonSerializerContext.g.cs | 76 ++ .../Descript.JsonSerializerContextTypes.g.cs | 172 ++++- ...script.Models.GetProjectResponse.Json.g.cs | 92 +++ .../Descript.Models.GetProjectResponse.g.cs | 118 ++++ ...ls.GetProjectResponseComposition.Json.g.cs | 92 +++ ....Models.GetProjectResponseComposition.g.cs | 80 +++ ...els.GetProjectResponseMediaFiles.Json.g.cs | 92 +++ ...t.Models.GetProjectResponseMediaFiles.g.cs | 18 + ...ls.GetProjectResponseMediaFiles2.Json.g.cs | 92 +++ ....Models.GetProjectResponseMediaFiles2.g.cs | 58 ++ ...dels.GetProjectResponseMediaFilesType.g.cs | 69 ++ .../Generated/Descript.Models.JobStatus.g.cs | 60 +- ....Models.JobStatusDiscriminatorJobType.g.cs | 6 + ...Descript.Models.ListProjectsDirection.g.cs | 51 ++ ...ript.Models.ListProjectsResponse.Json.g.cs | 92 +++ .../Descript.Models.ListProjectsResponse.g.cs | 54 ++ ...els.ListProjectsResponseDataItem.Json.g.cs | 92 +++ ...t.Models.ListProjectsResponseDataItem.g.cs | 94 +++ ...s.ListProjectsResponsePagination.Json.g.cs | 92 +++ ...Models.ListProjectsResponsePagination.g.cs | 45 ++ .../Descript.Models.ListProjectsSort.g.cs | 63 ++ ...script.Models.PublishErrorResult.Json.g.cs | 92 +++ .../Descript.Models.PublishErrorResult.g.cs | 61 ++ ...cript.Models.PublishErrorResultStatus.g.cs | 45 ++ ...escript.Models.PublishJobRequest.Json.g.cs | 92 +++ .../Descript.Models.PublishJobRequest.g.cs | 123 ++++ ...t.Models.PublishJobRequestAccessLevel.g.cs | 66 ++ ...ipt.Models.PublishJobRequestMediaType.g.cs | 52 ++ ...pt.Models.PublishJobRequestResolution.g.cs | 69 ++ ...script.Models.PublishJobResponse.Json.g.cs | 92 +++ .../Descript.Models.PublishJobResponse.g.cs | 94 +++ ...Descript.Models.PublishJobStatus.Json.g.cs | 92 +++ .../Descript.Models.PublishJobStatus.g.cs | 182 +++++ ...cript.Models.PublishJobStatusJobState.g.cs | 68 ++ ...script.Models.PublishJobStatusJobType.g.cs | 45 ++ ....Models.PublishJobStatusProgress.Json.g.cs | 92 +++ ...cript.Models.PublishJobStatusProgress.g.cs | 105 +++ ...lishJobStatusResultDiscriminator.Json.g.cs | 92 +++ ...s.PublishJobStatusResultDiscriminator.g.cs | 44 ++ ...ishJobStatusResultDiscriminatorStatus.g.cs | 51 ++ ...ript.Models.PublishSuccessResult.Json.g.cs | 92 +++ .../Descript.Models.PublishSuccessResult.g.cs | 101 +++ ...ipt.Models.PublishSuccessResultStatus.g.cs | 45 ++ .../Descript.Models.Result3.Json.g.cs | 92 +++ .../Generated/Descript.Models.Result3.g.cs | 229 ++++++ .../Generated/autosdk.generated-examples.json | 41 +- src/libs/Descript/openapi.yaml | 659 ++++++++++++++++++ 77 files changed, 7604 insertions(+), 35 deletions(-) create mode 100644 src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetProject.g.cs create mode 100644 src/libs/Descript/Generated/Descript.ApiEndpointsClient.ListProjects.g.cs create mode 100644 src/libs/Descript/Generated/Descript.ApiEndpointsClient.PublishJob.g.cs create mode 100644 src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetProject.g.cs create mode 100644 src/libs/Descript/Generated/Descript.IApiEndpointsClient.ListProjects.g.cs create mode 100644 src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.GetProjectResponseMediaFilesType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.GetProjectResponseMediaFilesTypeNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsDirection.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsDirectionNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsSort.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsSortNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishErrorResultStatus.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishErrorResultStatusNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestAccessLevel.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestAccessLevelNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestMediaType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestMediaTypeNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestResolution.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestResolutionNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobState.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobStateNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobTypeNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusResultDiscriminatorStatus.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusResultDiscriminatorStatusNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultStatus.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultStatusNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.Result3.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.GetProjectResponse.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.GetProjectResponse.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.GetProjectResponseComposition.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.GetProjectResponseComposition.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles2.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles2.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFilesType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.ListProjectsDirection.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.ListProjectsResponse.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.ListProjectsResponse.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.ListProjectsResponseDataItem.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.ListProjectsResponseDataItem.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.ListProjectsResponsePagination.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.ListProjectsResponsePagination.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.ListProjectsSort.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishErrorResult.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishErrorResult.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishErrorResultStatus.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobRequest.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobRequest.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobRequestAccessLevel.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobRequestMediaType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobRequestResolution.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobResponse.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobResponse.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobStatus.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobStatus.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobStatusJobState.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobStatusJobType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobStatusProgress.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobStatusProgress.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobStatusResultDiscriminator.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobStatusResultDiscriminator.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishJobStatusResultDiscriminatorStatus.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishSuccessResult.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishSuccessResult.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishSuccessResultStatus.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.Result3.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.Result3.g.cs diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetProject.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetProject.g.cs new file mode 100644 index 0000000..99403e2 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetProject.g.cs @@ -0,0 +1,538 @@ + +#nullable enable + +namespace Descript +{ + public partial class ApiEndpointsClient + { + + + private static readonly global::Descript.EndPointSecurityRequirement s_GetProjectSecurityRequirement0 = + new global::Descript.EndPointSecurityRequirement + { + Authorizations = new global::Descript.EndPointAuthorizationRequirement[] + { new global::Descript.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Descript.EndPointSecurityRequirement[] s_GetProjectSecurityRequirements = + new global::Descript.EndPointSecurityRequirement[] + { s_GetProjectSecurityRequirement0, + }; + partial void PrepareGetProjectArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::System.Guid projectId); + partial void PrepareGetProjectRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::System.Guid projectId); + partial void ProcessGetProjectResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetProjectResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get project details
+ /// Get a detailed project summary including all media files and compositions.
+ /// Returns the project's id, name, drive_id, a map of media files (keyed by
+ /// display path) with type and duration, and a list of compositions with id,
+ /// name, duration, and media type.
+ /// Use this to inspect a project's contents before editing or importing media. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetProjectAsync( + global::System.Guid projectId, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetProjectArguments( + httpClient: HttpClient, + projectId: ref projectId); + + + var __authorizations = global::Descript.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetProjectSecurityRequirements, + operationName: "GetProjectAsync"); + + using var __timeoutCancellationTokenSource = global::Descript.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Descript.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Descript.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::Descript.PathBuilder( + path: $"/projects/{projectId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Descript.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::Descript.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetProjectRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Descript.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetProject", + methodName: "GetProjectAsync", + pathTemplate: "$\"/projects/{projectId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetProject", + methodName: "GetProjectAsync", + pathTemplate: "$\"/projects/{projectId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Descript.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetProject", + methodName: "GetProjectAsync", + pathTemplate: "$\"/projects/{projectId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetProjectResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetProject", + methodName: "GetProjectAsync", + pathTemplate: "$\"/projects/{projectId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetProject", + methodName: "GetProjectAsync", + pathTemplate: "$\"/projects/{projectId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized - invalid or missing authentication token + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::Descript.Error401? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::Descript.Error401.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::Descript.Error401.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::Descript.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseObject = __value_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Forbidden - user does not have access to this project + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Descript.Error403? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Descript.Error403.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Descript.Error403.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::Descript.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Project not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Descript.Error404? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Descript.Error404.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Descript.Error404.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::Descript.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseObject = __value_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Too many requests - rate limit exceeded. Use the `Retry-After` header to determine when to retry. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Descript.Error429? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Descript.Error429.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Descript.Error429.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + throw new global::Descript.ApiException( + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + statusCode: __response.StatusCode) + { + ResponseBody = __content_429, + ResponseObject = __value_429, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetProjectResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Descript.GetProjectResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Descript.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Descript.GetProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Descript.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ListProjects.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ListProjects.g.cs new file mode 100644 index 0000000..636bb88 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ListProjects.g.cs @@ -0,0 +1,533 @@ + +#nullable enable + +namespace Descript +{ + public partial class ApiEndpointsClient + { + + + private static readonly global::Descript.EndPointSecurityRequirement s_ListProjectsSecurityRequirement0 = + new global::Descript.EndPointSecurityRequirement + { + Authorizations = new global::Descript.EndPointAuthorizationRequirement[] + { new global::Descript.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Descript.EndPointSecurityRequirement[] s_ListProjectsSecurityRequirements = + new global::Descript.EndPointSecurityRequirement[] + { s_ListProjectsSecurityRequirement0, + }; + partial void PrepareListProjectsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? name, + ref global::System.Guid? createdBy, + ref global::System.DateTime? createdAfter, + ref global::System.DateTime? createdBefore, + ref global::System.DateTime? updatedAfter, + ref global::System.DateTime? updatedBefore, + ref global::Descript.ListProjectsSort? sort, + ref global::Descript.ListProjectsDirection? direction, + ref string? cursor, + ref int? limit); + partial void PrepareListProjectsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? name, + global::System.Guid? createdBy, + global::System.DateTime? createdAfter, + global::System.DateTime? createdBefore, + global::System.DateTime? updatedAfter, + global::System.DateTime? updatedBefore, + global::Descript.ListProjectsSort? sort, + global::Descript.ListProjectsDirection? direction, + string? cursor, + int? limit); + partial void ProcessListProjectsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListProjectsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List projects
+ /// List projects accessible to the authenticated user within a drive.
+ /// The drive is determined from the access token.
+ /// Results are paginated. Use the `cursor` from the response `pagination.next_cursor`
+ /// to fetch subsequent pages. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// Default Value: created_at + /// + /// + /// Default Value: desc + /// + /// + /// + /// Default Value: 20 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ListProjectsAsync( + string? name = default, + global::System.Guid? createdBy = default, + global::System.DateTime? createdAfter = default, + global::System.DateTime? createdBefore = default, + global::System.DateTime? updatedAfter = default, + global::System.DateTime? updatedBefore = default, + global::Descript.ListProjectsSort? sort = default, + global::Descript.ListProjectsDirection? direction = default, + string? cursor = default, + int? limit = default, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListProjectsArguments( + httpClient: HttpClient, + name: ref name, + createdBy: ref createdBy, + createdAfter: ref createdAfter, + createdBefore: ref createdBefore, + updatedAfter: ref updatedAfter, + updatedBefore: ref updatedBefore, + sort: ref sort, + direction: ref direction, + cursor: ref cursor, + limit: ref limit); + + + var __authorizations = global::Descript.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListProjectsSecurityRequirements, + operationName: "ListProjectsAsync"); + + using var __timeoutCancellationTokenSource = global::Descript.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Descript.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Descript.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::Descript.PathBuilder( + path: "/projects", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("name", name) + .AddOptionalParameter("created_by", createdBy?.ToString()) + .AddOptionalParameter("created_after", createdAfter?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("created_before", createdBefore?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("updated_after", updatedAfter?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("updated_before", updatedBefore?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("sort", sort?.ToValueString()) + .AddOptionalParameter("direction", direction?.ToValueString()) + .AddOptionalParameter("cursor", cursor) + .AddOptionalParameter("limit", limit?.ToString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Descript.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::Descript.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListProjectsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + name: name, + createdBy: createdBy, + createdAfter: createdAfter, + createdBefore: createdBefore, + updatedAfter: updatedAfter, + updatedBefore: updatedBefore, + sort: sort, + direction: direction, + cursor: cursor, + limit: limit); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Descript.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListProjects", + methodName: "ListProjectsAsync", + pathTemplate: "\"/projects\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListProjects", + methodName: "ListProjectsAsync", + pathTemplate: "\"/projects\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Descript.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListProjects", + methodName: "ListProjectsAsync", + pathTemplate: "\"/projects\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessListProjectsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListProjects", + methodName: "ListProjectsAsync", + pathTemplate: "\"/projects\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListProjects", + methodName: "ListProjectsAsync", + pathTemplate: "\"/projects\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized - invalid or missing authentication token + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::Descript.Error401? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::Descript.Error401.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::Descript.Error401.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::Descript.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseObject = __value_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Too many requests - rate limit exceeded. Use the `Retry-After` header to determine when to retry. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Descript.Error429? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Descript.Error429.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Descript.Error429.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + throw new global::Descript.ApiException( + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + statusCode: __response.StatusCode) + { + ResponseBody = __content_429, + ResponseObject = __value_429, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessListProjectsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Descript.ListProjectsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Descript.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Descript.ListProjectsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Descript.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.PublishJob.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.PublishJob.g.cs new file mode 100644 index 0000000..40a9d7a --- /dev/null +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.PublishJob.g.cs @@ -0,0 +1,656 @@ + +#nullable enable + +namespace Descript +{ + public partial class ApiEndpointsClient + { + + + private static readonly global::Descript.EndPointSecurityRequirement s_PublishJobSecurityRequirement0 = + new global::Descript.EndPointSecurityRequirement + { + Authorizations = new global::Descript.EndPointAuthorizationRequirement[] + { new global::Descript.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Descript.EndPointSecurityRequirement[] s_PublishJobSecurityRequirements = + new global::Descript.EndPointSecurityRequirement[] + { s_PublishJobSecurityRequirement0, + }; + partial void PreparePublishJobArguments( + global::System.Net.Http.HttpClient httpClient, + global::Descript.PublishJobRequest request); + partial void PreparePublishJobRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Descript.PublishJobRequest request); + partial void ProcessPublishJobResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessPublishJobResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Publish project media
+ /// Publish a project composition to create a shareable link and download the exported file.
+ /// Publishes a specific composition from a project, rendering the output as video or audio
+ /// at the specified resolution. When the job completes successfully the result contains both:
+ /// - `share_url`: a public URL that can be used to view the published content on Descript's share site.
+ /// - `download_url`: a time-limited signed URL to download the exported media file directly,
+ /// along with `download_url_expires_at` indicating when the link expires.
+ /// ### Async Operations
+ /// Publish jobs run in the background and return a `job_id`. Monitor progress via the [GET /jobs/{job_id}](#operation/getJob) endpoint,
+ /// which returns the `share_url`, `download_url`, and `download_url_expires_at` fields once the job finishes.
+ /// ### Dynamic webhook
+ /// If `callback_url` is provided, Descript will POST the job status to that URL when the job completes or fails.
+ /// The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob). + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task PublishJobAsync( + + global::Descript.PublishJobRequest request, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PreparePublishJobArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Descript.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_PublishJobSecurityRequirements, + operationName: "PublishJobAsync"); + + using var __timeoutCancellationTokenSource = global::Descript.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Descript.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Descript.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::Descript.PathBuilder( + path: "/jobs/publish", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Descript.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Descript.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PreparePublishJobRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Descript.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PublishJob", + methodName: "PublishJobAsync", + pathTemplate: "\"/jobs/publish\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PublishJob", + methodName: "PublishJobAsync", + pathTemplate: "\"/jobs/publish\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Descript.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PublishJob", + methodName: "PublishJobAsync", + pathTemplate: "\"/jobs/publish\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessPublishJobResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PublishJob", + methodName: "PublishJobAsync", + pathTemplate: "\"/jobs/publish\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PublishJob", + methodName: "PublishJobAsync", + pathTemplate: "\"/jobs/publish\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input: - Malformed request body - Invalid project_id or composition_id format - Invalid media_type or resolution value + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Descript.Error400? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Descript.Error400.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Descript.Error400.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::Descript.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Unauthorized - missing or invalid authentication token + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::Descript.Error401? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::Descript.Error401.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::Descript.Error401.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::Descript.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseObject = __value_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Forbidden: - User doesn't have write access to the project - Project doesn't belong to the token's drive - Requested `access_level` is not permitted by the drive's publish settings + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Descript.Error403? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Descript.Error403.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Descript.Error403.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::Descript.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + throw new global::Descript.ApiException( + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Too many requests - rate limit exceeded. Use the `Retry-After` header to determine when to retry. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Descript.Error429? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Descript.Error429.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Descript.Error429.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + throw new global::Descript.ApiException( + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + statusCode: __response.StatusCode) + { + ResponseBody = __content_429, + ResponseObject = __value_429, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessPublishJobResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Descript.PublishJobResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Descript.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Descript.PublishJobResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Descript.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Publish project media
+ /// Publish a project composition to create a shareable link and download the exported file.
+ /// Publishes a specific composition from a project, rendering the output as video or audio
+ /// at the specified resolution. When the job completes successfully the result contains both:
+ /// - `share_url`: a public URL that can be used to view the published content on Descript's share site.
+ /// - `download_url`: a time-limited signed URL to download the exported media file directly,
+ /// along with `download_url_expires_at` indicating when the link expires.
+ /// ### Async Operations
+ /// Publish jobs run in the background and return a `job_id`. Monitor progress via the [GET /jobs/{job_id}](#operation/getJob) endpoint,
+ /// which returns the `share_url`, `download_url`, and `download_url_expires_at` fields once the job finishes.
+ /// ### Dynamic webhook
+ /// If `callback_url` is provided, Descript will POST the job status to that URL when the job completes or fails.
+ /// The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob). + ///
+ /// + /// The ID of the project to publish.
+ /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + /// + /// + /// The ID of the composition within the project to publish.
+ /// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + /// + /// + /// Media type of the published output.
+ /// Default Value: Video + /// + /// + /// Resolution for the published output. Only applicable when media_type is Video. + /// + /// + /// Optional webhook URL to call when the job completes or fails.
+ /// Descript will POST the job status (same format as [GET /jobs/{job_id}](#operation/getJob)) to this URL.
+ /// Example: https://example.com/webhooks/descript/job_callback + /// + /// + /// Desired access level for the published share page.
+ /// If omitted, the drive's configured default is used.
+ /// Returns 403 if the requested level is not permitted by the drive's publish settings
+ /// (e.g. requesting `public` when search engine indexing is disabled). + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task PublishJobAsync( + global::System.Guid projectId, + global::System.Guid? compositionId = default, + global::Descript.PublishJobRequestMediaType? mediaType = default, + global::Descript.PublishJobRequestResolution? resolution = default, + string? callbackUrl = default, + global::Descript.PublishJobRequestAccessLevel? accessLevel = default, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Descript.PublishJobRequest + { + ProjectId = projectId, + CompositionId = compositionId, + MediaType = mediaType, + Resolution = resolution, + CallbackUrl = callbackUrl, + AccessLevel = accessLevel, + }; + + return await PublishJobAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetProject.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetProject.g.cs new file mode 100644 index 0000000..c2d6c03 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetProject.g.cs @@ -0,0 +1,24 @@ +#nullable enable + +namespace Descript +{ + public partial interface IApiEndpointsClient + { + /// + /// Get project details
+ /// Get a detailed project summary including all media files and compositions.
+ /// Returns the project's id, name, drive_id, a map of media files (keyed by
+ /// display path) with type and duration, and a list of compositions with id,
+ /// name, duration, and media type.
+ /// Use this to inspect a project's contents before editing or importing media. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetProjectAsync( + global::System.Guid projectId, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ListProjects.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ListProjects.g.cs new file mode 100644 index 0000000..2d78f90 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ListProjects.g.cs @@ -0,0 +1,47 @@ +#nullable enable + +namespace Descript +{ + public partial interface IApiEndpointsClient + { + /// + /// List projects
+ /// List projects accessible to the authenticated user within a drive.
+ /// The drive is determined from the access token.
+ /// Results are paginated. Use the `cursor` from the response `pagination.next_cursor`
+ /// to fetch subsequent pages. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// Default Value: created_at + /// + /// + /// Default Value: desc + /// + /// + /// + /// Default Value: 20 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ListProjectsAsync( + string? name = default, + global::System.Guid? createdBy = default, + global::System.DateTime? createdAfter = default, + global::System.DateTime? createdBefore = default, + global::System.DateTime? updatedAfter = default, + global::System.DateTime? updatedBefore = default, + global::Descript.ListProjectsSort? sort = default, + global::Descript.ListProjectsDirection? direction = default, + string? cursor = default, + int? limit = default, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs new file mode 100644 index 0000000..a9f4795 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs @@ -0,0 +1,85 @@ +#nullable enable + +namespace Descript +{ + public partial interface IApiEndpointsClient + { + /// + /// Publish project media
+ /// Publish a project composition to create a shareable link and download the exported file.
+ /// Publishes a specific composition from a project, rendering the output as video or audio
+ /// at the specified resolution. When the job completes successfully the result contains both:
+ /// - `share_url`: a public URL that can be used to view the published content on Descript's share site.
+ /// - `download_url`: a time-limited signed URL to download the exported media file directly,
+ /// along with `download_url_expires_at` indicating when the link expires.
+ /// ### Async Operations
+ /// Publish jobs run in the background and return a `job_id`. Monitor progress via the [GET /jobs/{job_id}](#operation/getJob) endpoint,
+ /// which returns the `share_url`, `download_url`, and `download_url_expires_at` fields once the job finishes.
+ /// ### Dynamic webhook
+ /// If `callback_url` is provided, Descript will POST the job status to that URL when the job completes or fails.
+ /// The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob). + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task PublishJobAsync( + + global::Descript.PublishJobRequest request, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Publish project media
+ /// Publish a project composition to create a shareable link and download the exported file.
+ /// Publishes a specific composition from a project, rendering the output as video or audio
+ /// at the specified resolution. When the job completes successfully the result contains both:
+ /// - `share_url`: a public URL that can be used to view the published content on Descript's share site.
+ /// - `download_url`: a time-limited signed URL to download the exported media file directly,
+ /// along with `download_url_expires_at` indicating when the link expires.
+ /// ### Async Operations
+ /// Publish jobs run in the background and return a `job_id`. Monitor progress via the [GET /jobs/{job_id}](#operation/getJob) endpoint,
+ /// which returns the `share_url`, `download_url`, and `download_url_expires_at` fields once the job finishes.
+ /// ### Dynamic webhook
+ /// If `callback_url` is provided, Descript will POST the job status to that URL when the job completes or fails.
+ /// The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob). + ///
+ /// + /// The ID of the project to publish.
+ /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + /// + /// + /// The ID of the composition within the project to publish.
+ /// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + /// + /// + /// Media type of the published output.
+ /// Default Value: Video + /// + /// + /// Resolution for the published output. Only applicable when media_type is Video. + /// + /// + /// Optional webhook URL to call when the job completes or fails.
+ /// Descript will POST the job status (same format as [GET /jobs/{job_id}](#operation/getJob)) to this URL.
+ /// Example: https://example.com/webhooks/descript/job_callback + /// + /// + /// Desired access level for the published share page.
+ /// If omitted, the drive's configured default is used.
+ /// Returns 403 if the requested level is not permitted by the drive's publish settings
+ /// (e.g. requesting `public` when search engine indexing is disabled). + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task PublishJobAsync( + global::System.Guid projectId, + global::System.Guid? compositionId = default, + global::Descript.PublishJobRequestMediaType? mediaType = default, + global::Descript.PublishJobRequestResolution? resolution = default, + string? callbackUrl = default, + global::Descript.PublishJobRequestAccessLevel? accessLevel = default, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.GetProjectResponseMediaFilesType.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.GetProjectResponseMediaFilesType.g.cs new file mode 100644 index 0000000..8b99472 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.GetProjectResponseMediaFilesType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class GetProjectResponseMediaFilesTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.GetProjectResponseMediaFilesType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.GetProjectResponseMediaFilesTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.GetProjectResponseMediaFilesType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.GetProjectResponseMediaFilesType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.GetProjectResponseMediaFilesType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.GetProjectResponseMediaFilesTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.GetProjectResponseMediaFilesTypeNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.GetProjectResponseMediaFilesTypeNullable.g.cs new file mode 100644 index 0000000..32e05b9 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.GetProjectResponseMediaFilesTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class GetProjectResponseMediaFilesTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.GetProjectResponseMediaFilesType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.GetProjectResponseMediaFilesTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.GetProjectResponseMediaFilesType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.GetProjectResponseMediaFilesType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.GetProjectResponseMediaFilesType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Descript.GetProjectResponseMediaFilesTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.JobStatus.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.JobStatus.g.cs index d7a3159..af37a6b 100644 --- a/src/libs/Descript/Generated/Descript.JsonConverters.JobStatus.g.cs +++ b/src/libs/Descript/Generated/Descript.JsonConverters.JobStatus.g.cs @@ -35,12 +35,21 @@ public class JobStatusJsonConverter : global::System.Text.Json.Serialization.Jso throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Descript.AgentJobStatus)}"); agent = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } + global::Descript.PublishJobStatus? publish = default; + if (discriminator?.JobType == global::Descript.JobStatusDiscriminatorJobType.Publish) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Descript.PublishJobStatus), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Descript.PublishJobStatus)}"); + publish = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } var __value = new global::Descript.JobStatus( discriminator?.JobType, importProjectMedia, - agent + agent, + + publish ); return __value; @@ -67,6 +76,12 @@ public override void Write( throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Descript.AgentJobStatus).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Agent!, typeInfo); } + else if (value.IsPublish) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Descript.PublishJobStatus), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Descript.PublishJobStatus).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Publish!, typeInfo); + } } } } \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsDirection.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsDirection.g.cs new file mode 100644 index 0000000..03b5525 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsDirection.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class ListProjectsDirectionJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.ListProjectsDirection Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.ListProjectsDirectionExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.ListProjectsDirection)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.ListProjectsDirection); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.ListProjectsDirection value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.ListProjectsDirectionExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsDirectionNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsDirectionNullable.g.cs new file mode 100644 index 0000000..831e354 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsDirectionNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class ListProjectsDirectionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.ListProjectsDirection? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.ListProjectsDirectionExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.ListProjectsDirection)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.ListProjectsDirection?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.ListProjectsDirection? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Descript.ListProjectsDirectionExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsSort.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsSort.g.cs new file mode 100644 index 0000000..197797f --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsSort.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class ListProjectsSortJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.ListProjectsSort Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.ListProjectsSortExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.ListProjectsSort)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.ListProjectsSort); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.ListProjectsSort value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.ListProjectsSortExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsSortNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsSortNullable.g.cs new file mode 100644 index 0000000..e14bee2 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.ListProjectsSortNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class ListProjectsSortNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.ListProjectsSort? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.ListProjectsSortExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.ListProjectsSort)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.ListProjectsSort?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.ListProjectsSort? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Descript.ListProjectsSortExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishErrorResultStatus.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishErrorResultStatus.g.cs new file mode 100644 index 0000000..9a891d7 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishErrorResultStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishErrorResultStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishErrorResultStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishErrorResultStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishErrorResultStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishErrorResultStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishErrorResultStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.PublishErrorResultStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishErrorResultStatusNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishErrorResultStatusNullable.g.cs new file mode 100644 index 0000000..34dae32 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishErrorResultStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishErrorResultStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishErrorResultStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishErrorResultStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishErrorResultStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishErrorResultStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishErrorResultStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Descript.PublishErrorResultStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestAccessLevel.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestAccessLevel.g.cs new file mode 100644 index 0000000..227d6cb --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestAccessLevel.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishJobRequestAccessLevelJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishJobRequestAccessLevel Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishJobRequestAccessLevelExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishJobRequestAccessLevel)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishJobRequestAccessLevel); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishJobRequestAccessLevel value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.PublishJobRequestAccessLevelExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestAccessLevelNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestAccessLevelNullable.g.cs new file mode 100644 index 0000000..f599067 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestAccessLevelNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishJobRequestAccessLevelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishJobRequestAccessLevel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishJobRequestAccessLevelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishJobRequestAccessLevel)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishJobRequestAccessLevel?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishJobRequestAccessLevel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Descript.PublishJobRequestAccessLevelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestMediaType.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestMediaType.g.cs new file mode 100644 index 0000000..c9366c2 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestMediaType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishJobRequestMediaTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishJobRequestMediaType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishJobRequestMediaTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishJobRequestMediaType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishJobRequestMediaType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishJobRequestMediaType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.PublishJobRequestMediaTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestMediaTypeNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestMediaTypeNullable.g.cs new file mode 100644 index 0000000..6453beb --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestMediaTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishJobRequestMediaTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishJobRequestMediaType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishJobRequestMediaTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishJobRequestMediaType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishJobRequestMediaType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishJobRequestMediaType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Descript.PublishJobRequestMediaTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestResolution.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestResolution.g.cs new file mode 100644 index 0000000..9ea7137 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestResolution.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishJobRequestResolutionJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishJobRequestResolution Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishJobRequestResolutionExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishJobRequestResolution)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishJobRequestResolution); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishJobRequestResolution value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.PublishJobRequestResolutionExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestResolutionNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestResolutionNullable.g.cs new file mode 100644 index 0000000..5ceaf81 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobRequestResolutionNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishJobRequestResolutionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishJobRequestResolution? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishJobRequestResolutionExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishJobRequestResolution)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishJobRequestResolution?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishJobRequestResolution? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Descript.PublishJobRequestResolutionExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobState.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobState.g.cs new file mode 100644 index 0000000..8198140 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobState.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishJobStatusJobStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishJobStatusJobState Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishJobStatusJobStateExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishJobStatusJobState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishJobStatusJobState); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishJobStatusJobState value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.PublishJobStatusJobStateExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobStateNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobStateNullable.g.cs new file mode 100644 index 0000000..8286b01 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobStateNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishJobStatusJobStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishJobStatusJobState? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishJobStatusJobStateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishJobStatusJobState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishJobStatusJobState?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishJobStatusJobState? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Descript.PublishJobStatusJobStateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobType.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobType.g.cs new file mode 100644 index 0000000..b832c72 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishJobStatusJobTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishJobStatusJobType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishJobStatusJobTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishJobStatusJobType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishJobStatusJobType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishJobStatusJobType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.PublishJobStatusJobTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobTypeNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobTypeNullable.g.cs new file mode 100644 index 0000000..2e9588e --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusJobTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishJobStatusJobTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishJobStatusJobType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishJobStatusJobTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishJobStatusJobType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishJobStatusJobType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishJobStatusJobType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Descript.PublishJobStatusJobTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusResultDiscriminatorStatus.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusResultDiscriminatorStatus.g.cs new file mode 100644 index 0000000..7945d52 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusResultDiscriminatorStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishJobStatusResultDiscriminatorStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishJobStatusResultDiscriminatorStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishJobStatusResultDiscriminatorStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishJobStatusResultDiscriminatorStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishJobStatusResultDiscriminatorStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishJobStatusResultDiscriminatorStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.PublishJobStatusResultDiscriminatorStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusResultDiscriminatorStatusNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusResultDiscriminatorStatusNullable.g.cs new file mode 100644 index 0000000..17708a7 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishJobStatusResultDiscriminatorStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishJobStatusResultDiscriminatorStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishJobStatusResultDiscriminatorStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishJobStatusResultDiscriminatorStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishJobStatusResultDiscriminatorStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishJobStatusResultDiscriminatorStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishJobStatusResultDiscriminatorStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Descript.PublishJobStatusResultDiscriminatorStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultStatus.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultStatus.g.cs new file mode 100644 index 0000000..dd0773d --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishSuccessResultStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishSuccessResultStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishSuccessResultStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishSuccessResultStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishSuccessResultStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishSuccessResultStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.PublishSuccessResultStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultStatusNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultStatusNullable.g.cs new file mode 100644 index 0000000..2d95a03 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishSuccessResultStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishSuccessResultStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishSuccessResultStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishSuccessResultStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishSuccessResultStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishSuccessResultStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Descript.PublishSuccessResultStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.Result3.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.Result3.g.cs new file mode 100644 index 0000000..478e6af --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.Result3.g.cs @@ -0,0 +1,72 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Descript.JsonConverters +{ + /// + public class Result3JsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.Result3 Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + + var readerCopy = reader; + var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Descript.PublishJobStatusResultDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Descript.PublishJobStatusResultDiscriminator)}"); + var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); + + global::Descript.PublishSuccessResult? success = default; + if (discriminator?.Status == global::Descript.PublishJobStatusResultDiscriminatorStatus.Success) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Descript.PublishSuccessResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Descript.PublishSuccessResult)}"); + success = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Descript.PublishErrorResult? error = default; + if (discriminator?.Status == global::Descript.PublishJobStatusResultDiscriminatorStatus.Error) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Descript.PublishErrorResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Descript.PublishErrorResult)}"); + error = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + + var __value = new global::Descript.Result3( + discriminator?.Status, + success, + + error + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.Result3 value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsSuccess) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Descript.PublishSuccessResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Descript.PublishSuccessResult).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Success!, typeInfo); + } + else if (value.IsError) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Descript.PublishErrorResult), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Descript.PublishErrorResult).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Error!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.JsonSerializerContext.g.cs b/src/libs/Descript/Generated/Descript.JsonSerializerContext.g.cs index 48a8b1a..417a95d 100644 --- a/src/libs/Descript/Generated/Descript.JsonSerializerContext.g.cs +++ b/src/libs/Descript/Generated/Descript.JsonSerializerContext.g.cs @@ -85,6 +85,26 @@ namespace Descript typeof(global::Descript.JsonConverters.AgentJobStatusResultDiscriminatorStatusNullableJsonConverter), + typeof(global::Descript.JsonConverters.PublishSuccessResultStatusJsonConverter), + + typeof(global::Descript.JsonConverters.PublishSuccessResultStatusNullableJsonConverter), + + typeof(global::Descript.JsonConverters.PublishErrorResultStatusJsonConverter), + + typeof(global::Descript.JsonConverters.PublishErrorResultStatusNullableJsonConverter), + + typeof(global::Descript.JsonConverters.PublishJobStatusJobTypeJsonConverter), + + typeof(global::Descript.JsonConverters.PublishJobStatusJobTypeNullableJsonConverter), + + typeof(global::Descript.JsonConverters.PublishJobStatusJobStateJsonConverter), + + typeof(global::Descript.JsonConverters.PublishJobStatusJobStateNullableJsonConverter), + + typeof(global::Descript.JsonConverters.PublishJobStatusResultDiscriminatorStatusJsonConverter), + + typeof(global::Descript.JsonConverters.PublishJobStatusResultDiscriminatorStatusNullableJsonConverter), + typeof(global::Descript.JsonConverters.JobStatusDiscriminatorJobTypeJsonConverter), typeof(global::Descript.JsonConverters.JobStatusDiscriminatorJobTypeNullableJsonConverter), @@ -97,10 +117,34 @@ namespace Descript typeof(global::Descript.JsonConverters.AgentEditJobRequestTeamAccessNullableJsonConverter), + typeof(global::Descript.JsonConverters.PublishJobRequestMediaTypeJsonConverter), + + typeof(global::Descript.JsonConverters.PublishJobRequestMediaTypeNullableJsonConverter), + + typeof(global::Descript.JsonConverters.PublishJobRequestResolutionJsonConverter), + + typeof(global::Descript.JsonConverters.PublishJobRequestResolutionNullableJsonConverter), + + typeof(global::Descript.JsonConverters.PublishJobRequestAccessLevelJsonConverter), + + typeof(global::Descript.JsonConverters.PublishJobRequestAccessLevelNullableJsonConverter), + typeof(global::Descript.JsonConverters.ListJobsTypeJsonConverter), typeof(global::Descript.JsonConverters.ListJobsTypeNullableJsonConverter), + typeof(global::Descript.JsonConverters.ListProjectsSortJsonConverter), + + typeof(global::Descript.JsonConverters.ListProjectsSortNullableJsonConverter), + + typeof(global::Descript.JsonConverters.ListProjectsDirectionJsonConverter), + + typeof(global::Descript.JsonConverters.ListProjectsDirectionNullableJsonConverter), + + typeof(global::Descript.JsonConverters.GetProjectResponseMediaFilesTypeJsonConverter), + + typeof(global::Descript.JsonConverters.GetProjectResponseMediaFilesTypeNullableJsonConverter), + typeof(global::Descript.JsonConverters.GetStatusResponseStatusJsonConverter), typeof(global::Descript.JsonConverters.GetStatusResponseStatusNullableJsonConverter), @@ -109,6 +153,8 @@ namespace Descript typeof(global::Descript.JsonConverters.Result2JsonConverter), + typeof(global::Descript.JsonConverters.Result3JsonConverter), + typeof(global::Descript.JsonConverters.JobStatusJsonConverter), typeof(global::Descript.JsonConverters.OneOfJsonConverter), @@ -176,6 +222,17 @@ namespace Descript [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.Result2), TypeInfoPropertyName = "Result22")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.AgentJobStatusResultDiscriminator))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.AgentJobStatusResultDiscriminatorStatus), TypeInfoPropertyName = "AgentJobStatusResultDiscriminatorStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishSuccessResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishSuccessResultStatus), TypeInfoPropertyName = "PublishSuccessResultStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishErrorResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishErrorResultStatus), TypeInfoPropertyName = "PublishErrorResultStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishJobStatus))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishJobStatusJobType), TypeInfoPropertyName = "PublishJobStatusJobType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishJobStatusJobState), TypeInfoPropertyName = "PublishJobStatusJobState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishJobStatusProgress))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.Result3), TypeInfoPropertyName = "Result32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishJobStatusResultDiscriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishJobStatusResultDiscriminatorStatus), TypeInfoPropertyName = "PublishJobStatusResultDiscriminatorStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.JobStatus), TypeInfoPropertyName = "JobStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.JobStatusDiscriminator))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.JobStatusDiscriminatorJobType), TypeInfoPropertyName = "JobStatusDiscriminatorJobType2")] @@ -194,14 +251,31 @@ namespace Descript [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.ImportProjectMediaRequestAddCompositionClip))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.AgentEditJobRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.AgentEditJobRequestTeamAccess), TypeInfoPropertyName = "AgentEditJobRequestTeamAccess2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishJobRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishJobRequestMediaType), TypeInfoPropertyName = "PublishJobRequestMediaType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishJobRequestResolution), TypeInfoPropertyName = "PublishJobRequestResolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishJobRequestAccessLevel), TypeInfoPropertyName = "PublishJobRequestAccessLevel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.ListJobsType), TypeInfoPropertyName = "ListJobsType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.ListProjectsSort), TypeInfoPropertyName = "ListProjectsSort2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.ListProjectsDirection), TypeInfoPropertyName = "ListProjectsDirection2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.ImportProjectMediaResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.ImportProjectMediaResponseUploadUrls2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.AgentEditJobResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishJobResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.ListJobsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.ListJobsResponsePagination))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.ListProjectsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.ListProjectsResponseDataItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.ListProjectsResponsePagination))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.GetProjectResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.GetProjectResponseMediaFiles2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.GetProjectResponseMediaFilesType), TypeInfoPropertyName = "GetProjectResponseMediaFilesType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.GetProjectResponseComposition))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.GetStatusResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.GetStatusResponseStatus), TypeInfoPropertyName = "GetStatusResponseStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -210,6 +284,8 @@ namespace Descript [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] public sealed partial class SourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext { } diff --git a/src/libs/Descript/Generated/Descript.JsonSerializerContextTypes.g.cs b/src/libs/Descript/Generated/Descript.JsonSerializerContextTypes.g.cs index 163c483..6ee0a3b 100644 --- a/src/libs/Descript/Generated/Descript.JsonSerializerContextTypes.g.cs +++ b/src/libs/Descript/Generated/Descript.JsonSerializerContextTypes.g.cs @@ -268,107 +268,219 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Descript.JobStatus? Type60 { get; set; } + public global::Descript.PublishSuccessResult? Type60 { get; set; } /// /// /// - public global::Descript.JobStatusDiscriminator? Type61 { get; set; } + public global::Descript.PublishSuccessResultStatus? Type61 { get; set; } /// /// /// - public global::Descript.JobStatusDiscriminatorJobType? Type62 { get; set; } + public global::Descript.PublishErrorResult? Type62 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequest? Type63 { get; set; } + public global::Descript.PublishErrorResultStatus? Type63 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestTeamAccess? Type64 { get; set; } + public global::Descript.PublishJobStatus? Type64 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddMediaUrlImport? Type65 { get; set; } + public global::Descript.PublishJobStatusJobType? Type65 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddMediaDirectUpload? Type66 { get; set; } + public global::Descript.PublishJobStatusJobState? Type66 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddMediaMultitrackSequence? Type67 { get; set; } + public global::Descript.PublishJobStatusProgress? Type67 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type68 { get; set; } + public global::Descript.Result3? Type68 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddMediaMultitrackSequenceTrack? Type69 { get; set; } + public global::Descript.PublishJobStatusResultDiscriminator? Type69 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type70 { get; set; } + public global::Descript.PublishJobStatusResultDiscriminatorStatus? Type70 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddComposition? Type71 { get; set; } + public global::Descript.JobStatus? Type71 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type72 { get; set; } + public global::Descript.JobStatusDiscriminator? Type72 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddCompositionClip? Type73 { get; set; } + public global::Descript.JobStatusDiscriminatorJobType? Type73 { get; set; } /// /// /// - public global::Descript.AgentEditJobRequest? Type74 { get; set; } + public global::Descript.ImportProjectMediaRequest? Type74 { get; set; } /// /// /// - public global::Descript.AgentEditJobRequestTeamAccess? Type75 { get; set; } + public global::Descript.ImportProjectMediaRequestTeamAccess? Type75 { get; set; } /// /// /// - public global::Descript.ListJobsType? Type76 { get; set; } + public global::Descript.ImportProjectMediaRequestAddMediaUrlImport? Type76 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaResponse? Type77 { get; set; } + public global::Descript.ImportProjectMediaRequestAddMediaDirectUpload? Type77 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type78 { get; set; } + public global::Descript.ImportProjectMediaRequestAddMediaMultitrackSequence? Type78 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaResponseUploadUrls2? Type79 { get; set; } + public global::System.Collections.Generic.IList? Type79 { get; set; } /// /// /// - public global::Descript.AgentEditJobResponse? Type80 { get; set; } + public global::Descript.ImportProjectMediaRequestAddMediaMultitrackSequenceTrack? Type80 { get; set; } /// /// /// - public global::Descript.ListJobsResponse? Type81 { get; set; } + public global::System.Collections.Generic.IList? Type81 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type82 { get; set; } + public global::Descript.ImportProjectMediaRequestAddComposition? Type82 { get; set; } /// /// /// - public global::Descript.ListJobsResponsePagination? Type83 { get; set; } + public global::System.Collections.Generic.IList? Type83 { get; set; } /// /// /// - public global::Descript.GetStatusResponse? Type84 { get; set; } + public global::Descript.ImportProjectMediaRequestAddCompositionClip? Type84 { get; set; } /// /// /// - public global::Descript.GetStatusResponseStatus? Type85 { get; set; } + public global::Descript.AgentEditJobRequest? Type85 { get; set; } + /// + /// + /// + public global::Descript.AgentEditJobRequestTeamAccess? Type86 { get; set; } + /// + /// + /// + public global::Descript.PublishJobRequest? Type87 { get; set; } + /// + /// + /// + public global::Descript.PublishJobRequestMediaType? Type88 { get; set; } + /// + /// + /// + public global::Descript.PublishJobRequestResolution? Type89 { get; set; } + /// + /// + /// + public global::Descript.PublishJobRequestAccessLevel? Type90 { get; set; } + /// + /// + /// + public global::Descript.ListJobsType? Type91 { get; set; } + /// + /// + /// + public global::Descript.ListProjectsSort? Type92 { get; set; } + /// + /// + /// + public global::Descript.ListProjectsDirection? Type93 { get; set; } + /// + /// + /// + public global::Descript.ImportProjectMediaResponse? Type94 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.Dictionary? Type95 { get; set; } + /// + /// + /// + public global::Descript.ImportProjectMediaResponseUploadUrls2? Type96 { get; set; } + /// + /// + /// + public global::Descript.AgentEditJobResponse? Type97 { get; set; } + /// + /// + /// + public global::Descript.PublishJobResponse? Type98 { get; set; } + /// + /// + /// + public global::Descript.ListJobsResponse? Type99 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type100 { get; set; } + /// + /// + /// + public global::Descript.ListJobsResponsePagination? Type101 { get; set; } + /// + /// + /// + public global::Descript.ListProjectsResponse? Type102 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type103 { get; set; } + /// + /// + /// + public global::Descript.ListProjectsResponseDataItem? Type104 { get; set; } + /// + /// + /// + public global::Descript.ListProjectsResponsePagination? Type105 { get; set; } + /// + /// + /// + public global::Descript.GetProjectResponse? Type106 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.Dictionary? Type107 { get; set; } + /// + /// + /// + public global::Descript.GetProjectResponseMediaFiles2? Type108 { get; set; } + /// + /// + /// + public global::Descript.GetProjectResponseMediaFilesType? Type109 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type110 { get; set; } + /// + /// + /// + public global::Descript.GetProjectResponseComposition? Type111 { get; set; } + /// + /// + /// + public global::Descript.GetStatusResponse? Type112 { get; set; } + /// + /// + /// + public global::Descript.GetStatusResponseStatus? Type113 { get; set; } /// /// @@ -394,5 +506,13 @@ public sealed partial class JsonSerializerContextTypes /// /// public global::System.Collections.Generic.List? ListType5 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType6 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType7 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.GetProjectResponse.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.GetProjectResponse.Json.g.cs new file mode 100644 index 0000000..4bdc5ec --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.GetProjectResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class GetProjectResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.GetProjectResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.GetProjectResponse), + jsonSerializerContext) as global::Descript.GetProjectResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Descript.GetProjectResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Descript.GetProjectResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.GetProjectResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.GetProjectResponse.g.cs b/src/libs/Descript/Generated/Descript.Models.GetProjectResponse.g.cs new file mode 100644 index 0000000..4459b6a --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.GetProjectResponse.g.cs @@ -0,0 +1,118 @@ + +#nullable enable + +namespace Descript +{ + /// + /// + /// + public sealed partial class GetProjectResponse + { + /// + /// Project ID + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid Id { get; set; } + + /// + /// Project name + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Drive ID the project belongs to + /// + [global::System.Text.Json.Serialization.JsonPropertyName("drive_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid DriveId { get; set; } + + /// + /// When the project was created (ISO 8601) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// When the project was last updated (ISO 8601) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { get; set; } + + /// + /// Map of display path to media file info + /// + [global::System.Text.Json.Serialization.JsonPropertyName("media_files")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.Dictionary MediaFiles { get; set; } + + /// + /// Compositions in the project + /// + [global::System.Text.Json.Serialization.JsonPropertyName("compositions")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Compositions { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Project ID + /// + /// + /// Project name + /// + /// + /// Drive ID the project belongs to + /// + /// + /// When the project was created (ISO 8601) + /// + /// + /// When the project was last updated (ISO 8601) + /// + /// + /// Map of display path to media file info + /// + /// + /// Compositions in the project + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GetProjectResponse( + global::System.Guid id, + string name, + global::System.Guid driveId, + global::System.DateTime createdAt, + global::System.DateTime updatedAt, + global::System.Collections.Generic.Dictionary mediaFiles, + global::System.Collections.Generic.IList compositions) + { + this.Id = id; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.DriveId = driveId; + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + this.MediaFiles = mediaFiles ?? throw new global::System.ArgumentNullException(nameof(mediaFiles)); + this.Compositions = compositions ?? throw new global::System.ArgumentNullException(nameof(compositions)); + } + + /// + /// Initializes a new instance of the class. + /// + public GetProjectResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.GetProjectResponseComposition.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.GetProjectResponseComposition.Json.g.cs new file mode 100644 index 0000000..9187376 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.GetProjectResponseComposition.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class GetProjectResponseComposition + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.GetProjectResponseComposition? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.GetProjectResponseComposition), + jsonSerializerContext) as global::Descript.GetProjectResponseComposition; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Descript.GetProjectResponseComposition? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Descript.GetProjectResponseComposition), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.GetProjectResponseComposition; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.GetProjectResponseComposition.g.cs b/src/libs/Descript/Generated/Descript.Models.GetProjectResponseComposition.g.cs new file mode 100644 index 0000000..37b2fea --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.GetProjectResponseComposition.g.cs @@ -0,0 +1,80 @@ + +#nullable enable + +namespace Descript +{ + /// + /// + /// + public sealed partial class GetProjectResponseComposition + { + /// + /// Composition ID + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid Id { get; set; } + + /// + /// Composition name + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Duration in seconds + /// + [global::System.Text.Json.Serialization.JsonPropertyName("duration")] + public float? Duration { get; set; } + + /// + /// Media type of the composition + /// + [global::System.Text.Json.Serialization.JsonPropertyName("media_type")] + public string? MediaType { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Composition ID + /// + /// + /// Composition name + /// + /// + /// Duration in seconds + /// + /// + /// Media type of the composition + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GetProjectResponseComposition( + global::System.Guid id, + string name, + float? duration, + string? mediaType) + { + this.Id = id; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Duration = duration; + this.MediaType = mediaType; + } + + /// + /// Initializes a new instance of the class. + /// + public GetProjectResponseComposition() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles.Json.g.cs new file mode 100644 index 0000000..cc1060f --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class GetProjectResponseMediaFiles + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.GetProjectResponseMediaFiles? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.GetProjectResponseMediaFiles), + jsonSerializerContext) as global::Descript.GetProjectResponseMediaFiles; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Descript.GetProjectResponseMediaFiles? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Descript.GetProjectResponseMediaFiles), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.GetProjectResponseMediaFiles; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles.g.cs b/src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles.g.cs new file mode 100644 index 0000000..2fa95cf --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Map of display path to media file info + /// + public sealed partial class GetProjectResponseMediaFiles + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles2.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles2.Json.g.cs new file mode 100644 index 0000000..637d1b0 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class GetProjectResponseMediaFiles2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.GetProjectResponseMediaFiles2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.GetProjectResponseMediaFiles2), + jsonSerializerContext) as global::Descript.GetProjectResponseMediaFiles2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Descript.GetProjectResponseMediaFiles2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Descript.GetProjectResponseMediaFiles2), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.GetProjectResponseMediaFiles2; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles2.g.cs b/src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles2.g.cs new file mode 100644 index 0000000..c820170 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFiles2.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Descript +{ + /// + /// + /// + public sealed partial class GetProjectResponseMediaFiles2 + { + /// + /// Media type + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.GetProjectResponseMediaFilesTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Descript.GetProjectResponseMediaFilesType Type { get; set; } + + /// + /// Duration in seconds (absent for images) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("duration")] + public float? Duration { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Media type + /// + /// + /// Duration in seconds (absent for images) + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GetProjectResponseMediaFiles2( + global::Descript.GetProjectResponseMediaFilesType type, + float? duration) + { + this.Type = type; + this.Duration = duration; + } + + /// + /// Initializes a new instance of the class. + /// + public GetProjectResponseMediaFiles2() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFilesType.g.cs b/src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFilesType.g.cs new file mode 100644 index 0000000..eb3ad76 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.GetProjectResponseMediaFilesType.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Media type + /// + public enum GetProjectResponseMediaFilesType + { + /// + /// + /// + Audio, + /// + /// + /// + Image, + /// + /// + /// + Other, + /// + /// + /// + Sequence, + /// + /// + /// + Video, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class GetProjectResponseMediaFilesTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this GetProjectResponseMediaFilesType value) + { + return value switch + { + GetProjectResponseMediaFilesType.Audio => "audio", + GetProjectResponseMediaFilesType.Image => "image", + GetProjectResponseMediaFilesType.Other => "other", + GetProjectResponseMediaFilesType.Sequence => "sequence", + GetProjectResponseMediaFilesType.Video => "video", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static GetProjectResponseMediaFilesType? ToEnum(string value) + { + return value switch + { + "audio" => GetProjectResponseMediaFilesType.Audio, + "image" => GetProjectResponseMediaFilesType.Image, + "other" => GetProjectResponseMediaFilesType.Other, + "sequence" => GetProjectResponseMediaFilesType.Sequence, + "video" => GetProjectResponseMediaFilesType.Video, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.JobStatus.g.cs b/src/libs/Descript/Generated/Descript.Models.JobStatus.g.cs index 0b2b6b6..4bb29f3 100644 --- a/src/libs/Descript/Generated/Descript.Models.JobStatus.g.cs +++ b/src/libs/Descript/Generated/Descript.Models.JobStatus.g.cs @@ -48,6 +48,23 @@ namespace Descript [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Agent))] #endif public bool IsAgent => Agent != null; + + /// + /// Status of a publish job + /// +#if NET6_0_OR_GREATER + public global::Descript.PublishJobStatus? Publish { get; init; } +#else + public global::Descript.PublishJobStatus? Publish { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Publish))] +#endif + public bool IsPublish => Publish != null; /// /// /// @@ -84,25 +101,46 @@ public JobStatus(global::Descript.AgentJobStatus? value) Agent = value; } + /// + /// + /// + public static implicit operator JobStatus(global::Descript.PublishJobStatus value) => new JobStatus((global::Descript.PublishJobStatus?)value); + + /// + /// + /// + public static implicit operator global::Descript.PublishJobStatus?(JobStatus @this) => @this.Publish; + + /// + /// + /// + public JobStatus(global::Descript.PublishJobStatus? value) + { + Publish = value; + } + /// /// /// public JobStatus( global::Descript.JobStatusDiscriminatorJobType? jobType, global::Descript.ImportJobStatus? importProjectMedia, - global::Descript.AgentJobStatus? agent + global::Descript.AgentJobStatus? agent, + global::Descript.PublishJobStatus? publish ) { JobType = jobType; ImportProjectMedia = importProjectMedia; Agent = agent; + Publish = publish; } /// /// /// public object? Object => + Publish as object ?? Agent as object ?? ImportProjectMedia as object ; @@ -112,7 +150,8 @@ ImportProjectMedia as object /// public override string? ToString() => ImportProjectMedia?.ToString() ?? - Agent?.ToString() + Agent?.ToString() ?? + Publish?.ToString() ; /// @@ -120,7 +159,7 @@ ImportProjectMedia as object /// public bool Validate() { - return IsImportProjectMedia && !IsAgent || !IsImportProjectMedia && IsAgent; + return IsImportProjectMedia && !IsAgent && !IsPublish || !IsImportProjectMedia && IsAgent && !IsPublish || !IsImportProjectMedia && !IsAgent && IsPublish; } /// @@ -129,6 +168,7 @@ public bool Validate() public TResult? Match( global::System.Func? importProjectMedia = null, global::System.Func? agent = null, + global::System.Func? publish = null, bool validate = true) { if (validate) @@ -144,6 +184,10 @@ public bool Validate() { return agent(Agent!); } + else if (IsPublish && publish != null) + { + return publish(Publish!); + } return default(TResult); } @@ -154,6 +198,7 @@ public bool Validate() public void Match( global::System.Action? importProjectMedia = null, global::System.Action? agent = null, + global::System.Action? publish = null, bool validate = true) { if (validate) @@ -169,6 +214,10 @@ public void Match( { agent?.Invoke(Agent!); } + else if (IsPublish) + { + publish?.Invoke(Publish!); + } } /// @@ -182,6 +231,8 @@ public override int GetHashCode() typeof(global::Descript.ImportJobStatus), Agent, typeof(global::Descript.AgentJobStatus), + Publish, + typeof(global::Descript.PublishJobStatus), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -199,7 +250,8 @@ public bool Equals(JobStatus other) { return global::System.Collections.Generic.EqualityComparer.Default.Equals(ImportProjectMedia, other.ImportProjectMedia) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Agent, other.Agent) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Agent, other.Agent) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Publish, other.Publish) ; } diff --git a/src/libs/Descript/Generated/Descript.Models.JobStatusDiscriminatorJobType.g.cs b/src/libs/Descript/Generated/Descript.Models.JobStatusDiscriminatorJobType.g.cs index 23711f0..73eb839 100644 --- a/src/libs/Descript/Generated/Descript.Models.JobStatusDiscriminatorJobType.g.cs +++ b/src/libs/Descript/Generated/Descript.Models.JobStatusDiscriminatorJobType.g.cs @@ -16,6 +16,10 @@ public enum JobStatusDiscriminatorJobType /// /// ImportProjectMedia, + /// + /// + /// + Publish, } /// @@ -32,6 +36,7 @@ public static string ToValueString(this JobStatusDiscriminatorJobType value) { JobStatusDiscriminatorJobType.Agent => "agent", JobStatusDiscriminatorJobType.ImportProjectMedia => "import/project_media", + JobStatusDiscriminatorJobType.Publish => "publish", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -44,6 +49,7 @@ public static string ToValueString(this JobStatusDiscriminatorJobType value) { "agent" => JobStatusDiscriminatorJobType.Agent, "import/project_media" => JobStatusDiscriminatorJobType.ImportProjectMedia, + "publish" => JobStatusDiscriminatorJobType.Publish, _ => null, }; } diff --git a/src/libs/Descript/Generated/Descript.Models.ListProjectsDirection.g.cs b/src/libs/Descript/Generated/Descript.Models.ListProjectsDirection.g.cs new file mode 100644 index 0000000..44cd78c --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.ListProjectsDirection.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Default Value: desc + /// + public enum ListProjectsDirection + { + /// + /// + /// + Asc, + /// + /// + /// + Desc, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ListProjectsDirectionExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ListProjectsDirection value) + { + return value switch + { + ListProjectsDirection.Asc => "asc", + ListProjectsDirection.Desc => "desc", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ListProjectsDirection? ToEnum(string value) + { + return value switch + { + "asc" => ListProjectsDirection.Asc, + "desc" => ListProjectsDirection.Desc, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.ListProjectsResponse.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.ListProjectsResponse.Json.g.cs new file mode 100644 index 0000000..6c9a774 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.ListProjectsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class ListProjectsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.ListProjectsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.ListProjectsResponse), + jsonSerializerContext) as global::Descript.ListProjectsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Descript.ListProjectsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Descript.ListProjectsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.ListProjectsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.ListProjectsResponse.g.cs b/src/libs/Descript/Generated/Descript.Models.ListProjectsResponse.g.cs new file mode 100644 index 0000000..3da09ca --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.ListProjectsResponse.g.cs @@ -0,0 +1,54 @@ + +#nullable enable + +namespace Descript +{ + /// + /// + /// + public sealed partial class ListProjectsResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("pagination")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Descript.ListProjectsResponsePagination Pagination { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListProjectsResponse( + global::System.Collections.Generic.IList data, + global::Descript.ListProjectsResponsePagination pagination) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.Pagination = pagination ?? throw new global::System.ArgumentNullException(nameof(pagination)); + } + + /// + /// Initializes a new instance of the class. + /// + public ListProjectsResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.ListProjectsResponseDataItem.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.ListProjectsResponseDataItem.Json.g.cs new file mode 100644 index 0000000..dbe8159 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.ListProjectsResponseDataItem.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class ListProjectsResponseDataItem + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.ListProjectsResponseDataItem? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.ListProjectsResponseDataItem), + jsonSerializerContext) as global::Descript.ListProjectsResponseDataItem; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Descript.ListProjectsResponseDataItem? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Descript.ListProjectsResponseDataItem), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.ListProjectsResponseDataItem; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.ListProjectsResponseDataItem.g.cs b/src/libs/Descript/Generated/Descript.Models.ListProjectsResponseDataItem.g.cs new file mode 100644 index 0000000..e5193e0 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.ListProjectsResponseDataItem.g.cs @@ -0,0 +1,94 @@ + +#nullable enable + +namespace Descript +{ + /// + /// + /// + public sealed partial class ListProjectsResponseDataItem + { + /// + /// Project ID
+ /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + ///
+ /// 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid Id { get; set; } + + /// + /// Project name
+ /// Example: Marketing Video + ///
+ /// Marketing Video + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// When the project was created
+ /// Example: 2025-11-18T10:30:00Z + ///
+ /// 2025-11-18T10:30:00Z + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// When the project was last updated
+ /// Example: 2025-11-19T14:00:00Z + ///
+ /// 2025-11-19T14:00:00Z + [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Project ID
+ /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + /// + /// + /// Project name
+ /// Example: Marketing Video + /// + /// + /// When the project was created
+ /// Example: 2025-11-18T10:30:00Z + /// + /// + /// When the project was last updated
+ /// Example: 2025-11-19T14:00:00Z + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListProjectsResponseDataItem( + global::System.Guid id, + string name, + global::System.DateTime createdAt, + global::System.DateTime updatedAt) + { + this.Id = id; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public ListProjectsResponseDataItem() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.ListProjectsResponsePagination.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.ListProjectsResponsePagination.Json.g.cs new file mode 100644 index 0000000..1cb8cd0 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.ListProjectsResponsePagination.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class ListProjectsResponsePagination + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.ListProjectsResponsePagination? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.ListProjectsResponsePagination), + jsonSerializerContext) as global::Descript.ListProjectsResponsePagination; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Descript.ListProjectsResponsePagination? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Descript.ListProjectsResponsePagination), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.ListProjectsResponsePagination; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.ListProjectsResponsePagination.g.cs b/src/libs/Descript/Generated/Descript.Models.ListProjectsResponsePagination.g.cs new file mode 100644 index 0000000..cfb57d3 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.ListProjectsResponsePagination.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Descript +{ + /// + /// + /// + public sealed partial class ListProjectsResponsePagination + { + /// + /// Cursor for the next page. Absent if no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Cursor for the next page. Absent if no more results. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListProjectsResponsePagination( + string? nextCursor) + { + this.NextCursor = nextCursor; + } + + /// + /// Initializes a new instance of the class. + /// + public ListProjectsResponsePagination() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.ListProjectsSort.g.cs b/src/libs/Descript/Generated/Descript.Models.ListProjectsSort.g.cs new file mode 100644 index 0000000..4b5fa25 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.ListProjectsSort.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Default Value: created_at + /// + public enum ListProjectsSort + { + /// + /// + /// + CreatedAt, + /// + /// + /// + LastViewedAt, + /// + /// + /// + Name, + /// + /// + /// + UpdatedAt, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ListProjectsSortExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ListProjectsSort value) + { + return value switch + { + ListProjectsSort.CreatedAt => "created_at", + ListProjectsSort.LastViewedAt => "last_viewed_at", + ListProjectsSort.Name => "name", + ListProjectsSort.UpdatedAt => "updated_at", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ListProjectsSort? ToEnum(string value) + { + return value switch + { + "created_at" => ListProjectsSort.CreatedAt, + "last_viewed_at" => ListProjectsSort.LastViewedAt, + "name" => ListProjectsSort.Name, + "updated_at" => ListProjectsSort.UpdatedAt, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.PublishErrorResult.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishErrorResult.Json.g.cs new file mode 100644 index 0000000..4c98a31 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishErrorResult.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class PublishErrorResult + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.PublishErrorResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.PublishErrorResult), + jsonSerializerContext) as global::Descript.PublishErrorResult; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Descript.PublishErrorResult? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Descript.PublishErrorResult), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.PublishErrorResult; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.PublishErrorResult.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishErrorResult.g.cs new file mode 100644 index 0000000..36a16d2 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishErrorResult.g.cs @@ -0,0 +1,61 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Result when publish failed + /// + public sealed partial class PublishErrorResult + { + /// + /// Indicates the publish job failed + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.PublishErrorResultStatusJsonConverter))] + public global::Descript.PublishErrorResultStatus Status { get; set; } + + /// + /// Human-readable error message
+ /// Example: Export failed during render + ///
+ /// Export failed during render + [global::System.Text.Json.Serialization.JsonPropertyName("error_message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ErrorMessage { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Human-readable error message
+ /// Example: Export failed during render + /// + /// + /// Indicates the publish job failed + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public PublishErrorResult( + string errorMessage, + global::Descript.PublishErrorResultStatus status) + { + this.Status = status; + this.ErrorMessage = errorMessage ?? throw new global::System.ArgumentNullException(nameof(errorMessage)); + } + + /// + /// Initializes a new instance of the class. + /// + public PublishErrorResult() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.PublishErrorResultStatus.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishErrorResultStatus.g.cs new file mode 100644 index 0000000..e3850e0 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishErrorResultStatus.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Indicates the publish job failed + /// + public enum PublishErrorResultStatus + { + /// + /// + /// + Error, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class PublishErrorResultStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this PublishErrorResultStatus value) + { + return value switch + { + PublishErrorResultStatus.Error => "error", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static PublishErrorResultStatus? ToEnum(string value) + { + return value switch + { + "error" => PublishErrorResultStatus.Error, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobRequest.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobRequest.Json.g.cs new file mode 100644 index 0000000..eb7b400 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class PublishJobRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.PublishJobRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.PublishJobRequest), + jsonSerializerContext) as global::Descript.PublishJobRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Descript.PublishJobRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Descript.PublishJobRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.PublishJobRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobRequest.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobRequest.g.cs new file mode 100644 index 0000000..e83f4ed --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobRequest.g.cs @@ -0,0 +1,123 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Request to publish a project composition. + /// + public sealed partial class PublishJobRequest + { + /// + /// The ID of the project to publish.
+ /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + ///
+ /// 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + [global::System.Text.Json.Serialization.JsonPropertyName("project_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid ProjectId { get; set; } + + /// + /// The ID of the composition within the project to publish.
+ /// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + ///
+ /// 39677a40-1c43-4c36-8449-46cfbc4de2b5 + [global::System.Text.Json.Serialization.JsonPropertyName("composition_id")] + public global::System.Guid? CompositionId { get; set; } + + /// + /// Media type of the published output.
+ /// Default Value: Video + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("media_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.PublishJobRequestMediaTypeJsonConverter))] + public global::Descript.PublishJobRequestMediaType? MediaType { get; set; } + + /// + /// Resolution for the published output. Only applicable when media_type is Video. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.PublishJobRequestResolutionJsonConverter))] + public global::Descript.PublishJobRequestResolution? Resolution { get; set; } + + /// + /// Optional webhook URL to call when the job completes or fails.
+ /// Descript will POST the job status (same format as [GET /jobs/{job_id}](#operation/getJob)) to this URL.
+ /// Example: https://example.com/webhooks/descript/job_callback + ///
+ /// https://example.com/webhooks/descript/job_callback + [global::System.Text.Json.Serialization.JsonPropertyName("callback_url")] + public string? CallbackUrl { get; set; } + + /// + /// Desired access level for the published share page.
+ /// If omitted, the drive's configured default is used.
+ /// Returns 403 if the requested level is not permitted by the drive's publish settings
+ /// (e.g. requesting `public` when search engine indexing is disabled). + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("access_level")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.PublishJobRequestAccessLevelJsonConverter))] + public global::Descript.PublishJobRequestAccessLevel? AccessLevel { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The ID of the project to publish.
+ /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + /// + /// + /// The ID of the composition within the project to publish.
+ /// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + /// + /// + /// Media type of the published output.
+ /// Default Value: Video + /// + /// + /// Resolution for the published output. Only applicable when media_type is Video. + /// + /// + /// Optional webhook URL to call when the job completes or fails.
+ /// Descript will POST the job status (same format as [GET /jobs/{job_id}](#operation/getJob)) to this URL.
+ /// Example: https://example.com/webhooks/descript/job_callback + /// + /// + /// Desired access level for the published share page.
+ /// If omitted, the drive's configured default is used.
+ /// Returns 403 if the requested level is not permitted by the drive's publish settings
+ /// (e.g. requesting `public` when search engine indexing is disabled). + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public PublishJobRequest( + global::System.Guid projectId, + global::System.Guid? compositionId, + global::Descript.PublishJobRequestMediaType? mediaType, + global::Descript.PublishJobRequestResolution? resolution, + string? callbackUrl, + global::Descript.PublishJobRequestAccessLevel? accessLevel) + { + this.ProjectId = projectId; + this.CompositionId = compositionId; + this.MediaType = mediaType; + this.Resolution = resolution; + this.CallbackUrl = callbackUrl; + this.AccessLevel = accessLevel; + } + + /// + /// Initializes a new instance of the class. + /// + public PublishJobRequest() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobRequestAccessLevel.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobRequestAccessLevel.g.cs new file mode 100644 index 0000000..ea7cce8 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobRequestAccessLevel.g.cs @@ -0,0 +1,66 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Desired access level for the published share page.
+ /// If omitted, the drive's configured default is used.
+ /// Returns 403 if the requested level is not permitted by the drive's publish settings
+ /// (e.g. requesting `public` when search engine indexing is disabled). + ///
+ public enum PublishJobRequestAccessLevel + { + /// + /// + /// + Drive, + /// + /// + /// + Private, + /// + /// + /// + Public, + /// + /// + /// + Unlisted, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class PublishJobRequestAccessLevelExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this PublishJobRequestAccessLevel value) + { + return value switch + { + PublishJobRequestAccessLevel.Drive => "drive", + PublishJobRequestAccessLevel.Private => "private", + PublishJobRequestAccessLevel.Public => "public", + PublishJobRequestAccessLevel.Unlisted => "unlisted", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static PublishJobRequestAccessLevel? ToEnum(string value) + { + return value switch + { + "drive" => PublishJobRequestAccessLevel.Drive, + "private" => PublishJobRequestAccessLevel.Private, + "public" => PublishJobRequestAccessLevel.Public, + "unlisted" => PublishJobRequestAccessLevel.Unlisted, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobRequestMediaType.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobRequestMediaType.g.cs new file mode 100644 index 0000000..10fb02f --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobRequestMediaType.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Media type of the published output.
+ /// Default Value: Video + ///
+ public enum PublishJobRequestMediaType + { + /// + /// + /// + Audio, + /// + /// + /// + Video, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class PublishJobRequestMediaTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this PublishJobRequestMediaType value) + { + return value switch + { + PublishJobRequestMediaType.Audio => "Audio", + PublishJobRequestMediaType.Video => "Video", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static PublishJobRequestMediaType? ToEnum(string value) + { + return value switch + { + "Audio" => PublishJobRequestMediaType.Audio, + "Video" => PublishJobRequestMediaType.Video, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobRequestResolution.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobRequestResolution.g.cs new file mode 100644 index 0000000..bb4ba97 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobRequestResolution.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Resolution for the published output. Only applicable when media_type is Video. + /// + public enum PublishJobRequestResolution + { + /// + /// + /// + x1080p, + /// + /// + /// + x1440p, + /// + /// + /// + x480p, + /// + /// + /// + x4k, + /// + /// + /// + x720p, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class PublishJobRequestResolutionExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this PublishJobRequestResolution value) + { + return value switch + { + PublishJobRequestResolution.x1080p => "1080p", + PublishJobRequestResolution.x1440p => "1440p", + PublishJobRequestResolution.x480p => "480p", + PublishJobRequestResolution.x4k => "4K", + PublishJobRequestResolution.x720p => "720p", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static PublishJobRequestResolution? ToEnum(string value) + { + return value switch + { + "1080p" => PublishJobRequestResolution.x1080p, + "1440p" => PublishJobRequestResolution.x1440p, + "480p" => PublishJobRequestResolution.x480p, + "4K" => PublishJobRequestResolution.x4k, + "720p" => PublishJobRequestResolution.x720p, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobResponse.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobResponse.Json.g.cs new file mode 100644 index 0000000..dd21014 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class PublishJobResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.PublishJobResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.PublishJobResponse), + jsonSerializerContext) as global::Descript.PublishJobResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Descript.PublishJobResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Descript.PublishJobResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.PublishJobResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobResponse.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobResponse.g.cs new file mode 100644 index 0000000..d1c9f57 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobResponse.g.cs @@ -0,0 +1,94 @@ + +#nullable enable + +namespace Descript +{ + /// + /// + /// + public sealed partial class PublishJobResponse + { + /// + /// Unique identifier for the publish job
+ /// Example: 6dc3f30a-58c2-4174-96a6-dc18cf3c7776 + ///
+ /// 6dc3f30a-58c2-4174-96a6-dc18cf3c7776 + [global::System.Text.Json.Serialization.JsonPropertyName("job_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid JobId { get; set; } + + /// + /// Drive ID where the project is located
+ /// Example: c9c5c47e-158a-49f7-846b-4f6ee2a229a2 + ///
+ /// c9c5c47e-158a-49f7-846b-4f6ee2a229a2 + [global::System.Text.Json.Serialization.JsonPropertyName("drive_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid DriveId { get; set; } + + /// + /// The project ID being published
+ /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + ///
+ /// 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + [global::System.Text.Json.Serialization.JsonPropertyName("project_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid ProjectId { get; set; } + + /// + /// URL to access the project in Descript web app
+ /// Example: https://web.descript.com/9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + ///
+ /// https://web.descript.com/9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + [global::System.Text.Json.Serialization.JsonPropertyName("project_url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProjectUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique identifier for the publish job
+ /// Example: 6dc3f30a-58c2-4174-96a6-dc18cf3c7776 + /// + /// + /// Drive ID where the project is located
+ /// Example: c9c5c47e-158a-49f7-846b-4f6ee2a229a2 + /// + /// + /// The project ID being published
+ /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + /// + /// + /// URL to access the project in Descript web app
+ /// Example: https://web.descript.com/9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public PublishJobResponse( + global::System.Guid jobId, + global::System.Guid driveId, + global::System.Guid projectId, + string projectUrl) + { + this.JobId = jobId; + this.DriveId = driveId; + this.ProjectId = projectId; + this.ProjectUrl = projectUrl ?? throw new global::System.ArgumentNullException(nameof(projectUrl)); + } + + /// + /// Initializes a new instance of the class. + /// + public PublishJobResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobStatus.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobStatus.Json.g.cs new file mode 100644 index 0000000..ad2de40 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobStatus.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class PublishJobStatus + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.PublishJobStatus? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.PublishJobStatus), + jsonSerializerContext) as global::Descript.PublishJobStatus; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Descript.PublishJobStatus? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Descript.PublishJobStatus), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.PublishJobStatus; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobStatus.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobStatus.g.cs new file mode 100644 index 0000000..caa4e32 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobStatus.g.cs @@ -0,0 +1,182 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Status of a publish job + /// + public sealed partial class PublishJobStatus + { + /// + /// Unique identifier for the job
+ /// Example: 6dc3f30a-58c2-4174-96a6-dc18cf3c7776 + ///
+ /// 6dc3f30a-58c2-4174-96a6-dc18cf3c7776 + [global::System.Text.Json.Serialization.JsonPropertyName("job_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid JobId { get; set; } + + /// + /// Type of job + /// + [global::System.Text.Json.Serialization.JsonPropertyName("job_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.PublishJobStatusJobTypeJsonConverter))] + public global::Descript.PublishJobStatusJobType JobType { get; set; } + + /// + /// Current state of the job:
+ /// - queued: Job is waiting to start
+ /// - running: Job is actively processing
+ /// - stopped: Job has finished (check result.status for outcome)
+ /// - cancelled: Job was cancelled by user
+ /// Example: stopped + ///
+ /// stopped + [global::System.Text.Json.Serialization.JsonPropertyName("job_state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.PublishJobStatusJobStateJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Descript.PublishJobStatusJobState JobState { get; set; } + + /// + /// When the job was created
+ /// Example: 2025-11-18T10:30:00Z + ///
+ /// 2025-11-18T10:30:00Z + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// When the job stopped (only present when job_state is stopped or cancelled)
+ /// Example: 2025-11-18T10:35:00Z + ///
+ /// 2025-11-18T10:35:00Z + [global::System.Text.Json.Serialization.JsonPropertyName("stopped_at")] + public global::System.DateTime? StoppedAt { get; set; } + + /// + /// The drive ID
+ /// Example: c9c5c47e-158a-49f7-846b-4f6ee2a229a2 + ///
+ /// c9c5c47e-158a-49f7-846b-4f6ee2a229a2 + [global::System.Text.Json.Serialization.JsonPropertyName("drive_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid DriveId { get; set; } + + /// + /// The project ID
+ /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + ///
+ /// 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + [global::System.Text.Json.Serialization.JsonPropertyName("project_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid ProjectId { get; set; } + + /// + /// URL to access the project in Descript web app
+ /// Example: https://web.descript.com/9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + ///
+ /// https://web.descript.com/9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + [global::System.Text.Json.Serialization.JsonPropertyName("project_url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProjectUrl { get; set; } + + /// + /// Progress information for the workflow (only present when job_state is running) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("progress")] + public global::Descript.PublishJobStatusProgress? Progress { get; set; } + + /// + /// Job result (only present when job_state is stopped) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("result")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.Result3JsonConverter))] + public global::Descript.Result3? Result { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique identifier for the job
+ /// Example: 6dc3f30a-58c2-4174-96a6-dc18cf3c7776 + /// + /// + /// Current state of the job:
+ /// - queued: Job is waiting to start
+ /// - running: Job is actively processing
+ /// - stopped: Job has finished (check result.status for outcome)
+ /// - cancelled: Job was cancelled by user
+ /// Example: stopped + /// + /// + /// When the job was created
+ /// Example: 2025-11-18T10:30:00Z + /// + /// + /// The drive ID
+ /// Example: c9c5c47e-158a-49f7-846b-4f6ee2a229a2 + /// + /// + /// The project ID
+ /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + /// + /// + /// URL to access the project in Descript web app
+ /// Example: https://web.descript.com/9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + /// + /// + /// Type of job + /// + /// + /// When the job stopped (only present when job_state is stopped or cancelled)
+ /// Example: 2025-11-18T10:35:00Z + /// + /// + /// Progress information for the workflow (only present when job_state is running) + /// + /// + /// Job result (only present when job_state is stopped) + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public PublishJobStatus( + global::System.Guid jobId, + global::Descript.PublishJobStatusJobState jobState, + global::System.DateTime createdAt, + global::System.Guid driveId, + global::System.Guid projectId, + string projectUrl, + global::Descript.PublishJobStatusJobType jobType, + global::System.DateTime? stoppedAt, + global::Descript.PublishJobStatusProgress? progress, + global::Descript.Result3? result) + { + this.JobId = jobId; + this.JobType = jobType; + this.JobState = jobState; + this.CreatedAt = createdAt; + this.StoppedAt = stoppedAt; + this.DriveId = driveId; + this.ProjectId = projectId; + this.ProjectUrl = projectUrl ?? throw new global::System.ArgumentNullException(nameof(projectUrl)); + this.Progress = progress; + this.Result = result; + } + + /// + /// Initializes a new instance of the class. + /// + public PublishJobStatus() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobStatusJobState.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobStatusJobState.g.cs new file mode 100644 index 0000000..882a21b --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobStatusJobState.g.cs @@ -0,0 +1,68 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Current state of the job:
+ /// - queued: Job is waiting to start
+ /// - running: Job is actively processing
+ /// - stopped: Job has finished (check result.status for outcome)
+ /// - cancelled: Job was cancelled by user
+ /// Example: stopped + ///
+ public enum PublishJobStatusJobState + { + /// + /// Job was cancelled by user + /// + Cancelled, + /// + /// Job is waiting to start + /// + Queued, + /// + /// Job is actively processing + /// + Running, + /// + /// Job has finished (check result.status for outcome) + /// + Stopped, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class PublishJobStatusJobStateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this PublishJobStatusJobState value) + { + return value switch + { + PublishJobStatusJobState.Cancelled => "cancelled", + PublishJobStatusJobState.Queued => "queued", + PublishJobStatusJobState.Running => "running", + PublishJobStatusJobState.Stopped => "stopped", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static PublishJobStatusJobState? ToEnum(string value) + { + return value switch + { + "cancelled" => PublishJobStatusJobState.Cancelled, + "queued" => PublishJobStatusJobState.Queued, + "running" => PublishJobStatusJobState.Running, + "stopped" => PublishJobStatusJobState.Stopped, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobStatusJobType.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobStatusJobType.g.cs new file mode 100644 index 0000000..120d061 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobStatusJobType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Type of job + /// + public enum PublishJobStatusJobType + { + /// + /// + /// + Publish, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class PublishJobStatusJobTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this PublishJobStatusJobType value) + { + return value switch + { + PublishJobStatusJobType.Publish => "publish", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static PublishJobStatusJobType? ToEnum(string value) + { + return value switch + { + "publish" => PublishJobStatusJobType.Publish, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobStatusProgress.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobStatusProgress.Json.g.cs new file mode 100644 index 0000000..6ec5b7d --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobStatusProgress.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class PublishJobStatusProgress + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.PublishJobStatusProgress? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.PublishJobStatusProgress), + jsonSerializerContext) as global::Descript.PublishJobStatusProgress; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Descript.PublishJobStatusProgress? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Descript.PublishJobStatusProgress), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.PublishJobStatusProgress; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobStatusProgress.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobStatusProgress.g.cs new file mode 100644 index 0000000..6c65ec9 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobStatusProgress.g.cs @@ -0,0 +1,105 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Progress information for the workflow (only present when job_state is running) + /// + public sealed partial class PublishJobStatusProgress + { + /// + /// Human-readable label describing the current action
+ /// Example: Exporting composition... + ///
+ /// Exporting composition... + [global::System.Text.Json.Serialization.JsonPropertyName("label")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Label { get; set; } + + /// + /// Percentage of the workflow that has been completed
+ /// Example: 50 + ///
+ /// 50 + [global::System.Text.Json.Serialization.JsonPropertyName("percent")] + public int? Percent { get; set; } + + /// + /// When the progress was last updated
+ /// Example: 2025-11-18T10:32:00Z + ///
+ /// 2025-11-18T10:32:00Z + [global::System.Text.Json.Serialization.JsonPropertyName("last_update_at")] + public global::System.DateTime? LastUpdateAt { get; set; } + + /// + /// Composition being published (present when known)
+ /// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + ///
+ /// 39677a40-1c43-4c36-8449-46cfbc4de2b5 + [global::System.Text.Json.Serialization.JsonPropertyName("composition_id")] + public string? CompositionId { get; set; } + + /// + /// Share URL when available before the job completes
+ /// Example: https://share.descript.com/view/abc123 + ///
+ /// https://share.descript.com/view/abc123 + [global::System.Text.Json.Serialization.JsonPropertyName("share_url")] + public string? ShareUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Human-readable label describing the current action
+ /// Example: Exporting composition... + /// + /// + /// Percentage of the workflow that has been completed
+ /// Example: 50 + /// + /// + /// When the progress was last updated
+ /// Example: 2025-11-18T10:32:00Z + /// + /// + /// Composition being published (present when known)
+ /// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + /// + /// + /// Share URL when available before the job completes
+ /// Example: https://share.descript.com/view/abc123 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public PublishJobStatusProgress( + string label, + int? percent, + global::System.DateTime? lastUpdateAt, + string? compositionId, + string? shareUrl) + { + this.Label = label ?? throw new global::System.ArgumentNullException(nameof(label)); + this.Percent = percent; + this.LastUpdateAt = lastUpdateAt; + this.CompositionId = compositionId; + this.ShareUrl = shareUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public PublishJobStatusProgress() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobStatusResultDiscriminator.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobStatusResultDiscriminator.Json.g.cs new file mode 100644 index 0000000..b26c8fc --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobStatusResultDiscriminator.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class PublishJobStatusResultDiscriminator + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.PublishJobStatusResultDiscriminator? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.PublishJobStatusResultDiscriminator), + jsonSerializerContext) as global::Descript.PublishJobStatusResultDiscriminator; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Descript.PublishJobStatusResultDiscriminator? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Descript.PublishJobStatusResultDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.PublishJobStatusResultDiscriminator; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobStatusResultDiscriminator.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobStatusResultDiscriminator.g.cs new file mode 100644 index 0000000..4edae13 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobStatusResultDiscriminator.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace Descript +{ + /// + /// + /// + public sealed partial class PublishJobStatusResultDiscriminator + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.PublishJobStatusResultDiscriminatorStatusJsonConverter))] + public global::Descript.PublishJobStatusResultDiscriminatorStatus? Status { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public PublishJobStatusResultDiscriminator( + global::Descript.PublishJobStatusResultDiscriminatorStatus? status) + { + this.Status = status; + } + + /// + /// Initializes a new instance of the class. + /// + public PublishJobStatusResultDiscriminator() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobStatusResultDiscriminatorStatus.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobStatusResultDiscriminatorStatus.g.cs new file mode 100644 index 0000000..a3ea4ce --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobStatusResultDiscriminatorStatus.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Descript +{ + /// + /// + /// + public enum PublishJobStatusResultDiscriminatorStatus + { + /// + /// + /// + Error, + /// + /// + /// + Success, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class PublishJobStatusResultDiscriminatorStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this PublishJobStatusResultDiscriminatorStatus value) + { + return value switch + { + PublishJobStatusResultDiscriminatorStatus.Error => "error", + PublishJobStatusResultDiscriminatorStatus.Success => "success", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static PublishJobStatusResultDiscriminatorStatus? ToEnum(string value) + { + return value switch + { + "error" => PublishJobStatusResultDiscriminatorStatus.Error, + "success" => PublishJobStatusResultDiscriminatorStatus.Success, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.PublishSuccessResult.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishSuccessResult.Json.g.cs new file mode 100644 index 0000000..b781270 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishSuccessResult.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class PublishSuccessResult + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.PublishSuccessResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.PublishSuccessResult), + jsonSerializerContext) as global::Descript.PublishSuccessResult; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Descript.PublishSuccessResult? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Descript.PublishSuccessResult), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.PublishSuccessResult; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.PublishSuccessResult.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishSuccessResult.g.cs new file mode 100644 index 0000000..bddd392 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishSuccessResult.g.cs @@ -0,0 +1,101 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Result when publish completed successfully + /// + public sealed partial class PublishSuccessResult + { + /// + /// Indicates successful completion + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.PublishSuccessResultStatusJsonConverter))] + public global::Descript.PublishSuccessResultStatus Status { get; set; } + + /// + /// Identifier of the published composition
+ /// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + ///
+ /// 39677a40-1c43-4c36-8449-46cfbc4de2b5 + [global::System.Text.Json.Serialization.JsonPropertyName("composition_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CompositionId { get; set; } + + /// + /// Public URL to view the published content
+ /// Example: https://share.descript.com/view/abc123 + ///
+ /// https://share.descript.com/view/abc123 + [global::System.Text.Json.Serialization.JsonPropertyName("share_url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ShareUrl { get; set; } + + /// + /// Time-limited signed URL to download the original published media file. Present when the job completed successfully and signing succeeded.
+ /// Example: https://storage.googleapis.com/bucket/object?X-Goog-Signature=... + ///
+ /// https://storage.googleapis.com/bucket/object?X-Goog-Signature=... + [global::System.Text.Json.Serialization.JsonPropertyName("download_url")] + public string? DownloadUrl { get; set; } + + /// + /// ISO 8601 time when download_url expires (if download_url is set) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("download_url_expires_at")] + public global::System.DateTime? DownloadUrlExpiresAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Identifier of the published composition
+ /// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + /// + /// + /// Public URL to view the published content
+ /// Example: https://share.descript.com/view/abc123 + /// + /// + /// Indicates successful completion + /// + /// + /// Time-limited signed URL to download the original published media file. Present when the job completed successfully and signing succeeded.
+ /// Example: https://storage.googleapis.com/bucket/object?X-Goog-Signature=... + /// + /// + /// ISO 8601 time when download_url expires (if download_url is set) + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public PublishSuccessResult( + string compositionId, + string shareUrl, + global::Descript.PublishSuccessResultStatus status, + string? downloadUrl, + global::System.DateTime? downloadUrlExpiresAt) + { + this.Status = status; + this.CompositionId = compositionId ?? throw new global::System.ArgumentNullException(nameof(compositionId)); + this.ShareUrl = shareUrl ?? throw new global::System.ArgumentNullException(nameof(shareUrl)); + this.DownloadUrl = downloadUrl; + this.DownloadUrlExpiresAt = downloadUrlExpiresAt; + } + + /// + /// Initializes a new instance of the class. + /// + public PublishSuccessResult() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.PublishSuccessResultStatus.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishSuccessResultStatus.g.cs new file mode 100644 index 0000000..2a82c03 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishSuccessResultStatus.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Indicates successful completion + /// + public enum PublishSuccessResultStatus + { + /// + /// + /// + Success, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class PublishSuccessResultStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this PublishSuccessResultStatus value) + { + return value switch + { + PublishSuccessResultStatus.Success => "success", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static PublishSuccessResultStatus? ToEnum(string value) + { + return value switch + { + "success" => PublishSuccessResultStatus.Success, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.Result3.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.Result3.Json.g.cs new file mode 100644 index 0000000..6017a0a --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.Result3.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Descript +{ + public readonly partial struct Result3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.Result3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.Result3), + jsonSerializerContext) as global::Descript.Result3?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Descript.Result3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Descript.Result3), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.Result3?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.Result3.g.cs b/src/libs/Descript/Generated/Descript.Models.Result3.g.cs new file mode 100644 index 0000000..a70b40d --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.Result3.g.cs @@ -0,0 +1,229 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Descript +{ + /// + /// Job result (only present when job_state is stopped) + /// + public readonly partial struct Result3 : global::System.IEquatable + { + /// + /// + /// + public global::Descript.PublishJobStatusResultDiscriminatorStatus? Status { get; } + + /// + /// Result when publish completed successfully + /// +#if NET6_0_OR_GREATER + public global::Descript.PublishSuccessResult? Success { get; init; } +#else + public global::Descript.PublishSuccessResult? Success { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Success))] +#endif + public bool IsSuccess => Success != null; + + /// + /// Result when publish failed + /// +#if NET6_0_OR_GREATER + public global::Descript.PublishErrorResult? Error { get; init; } +#else + public global::Descript.PublishErrorResult? Error { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Error))] +#endif + public bool IsError => Error != null; + /// + /// + /// + public static implicit operator Result3(global::Descript.PublishSuccessResult value) => new Result3((global::Descript.PublishSuccessResult?)value); + + /// + /// + /// + public static implicit operator global::Descript.PublishSuccessResult?(Result3 @this) => @this.Success; + + /// + /// + /// + public Result3(global::Descript.PublishSuccessResult? value) + { + Success = value; + } + + /// + /// + /// + public static implicit operator Result3(global::Descript.PublishErrorResult value) => new Result3((global::Descript.PublishErrorResult?)value); + + /// + /// + /// + public static implicit operator global::Descript.PublishErrorResult?(Result3 @this) => @this.Error; + + /// + /// + /// + public Result3(global::Descript.PublishErrorResult? value) + { + Error = value; + } + + /// + /// + /// + public Result3( + global::Descript.PublishJobStatusResultDiscriminatorStatus? status, + global::Descript.PublishSuccessResult? success, + global::Descript.PublishErrorResult? error + ) + { + Status = status; + + Success = success; + Error = error; + } + + /// + /// + /// + public object? Object => + Error as object ?? + Success as object + ; + + /// + /// + /// + public override string? ToString() => + Success?.ToString() ?? + Error?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsSuccess && !IsError || !IsSuccess && IsError; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? success = null, + global::System.Func? error = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSuccess && success != null) + { + return success(Success!); + } + else if (IsError && error != null) + { + return error(Error!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? success = null, + global::System.Action? error = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSuccess) + { + success?.Invoke(Success!); + } + else if (IsError) + { + error?.Invoke(Error!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Success, + typeof(global::Descript.PublishSuccessResult), + Error, + typeof(global::Descript.PublishErrorResult), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(Result3 other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Success, other.Success) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Error, other.Error) + ; + } + + /// + /// + /// + public static bool operator ==(Result3 obj1, Result3 obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(Result3 obj1, Result3 obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is Result3 o && Equals(o); + } + } +} diff --git a/src/libs/Descript/Generated/autosdk.generated-examples.json b/src/libs/Descript/Generated/autosdk.generated-examples.json index d25f047..8d9cc32 100644 --- a/src/libs/Descript/Generated/autosdk.generated-examples.json +++ b/src/libs/Descript/Generated/autosdk.generated-examples.json @@ -35,6 +35,17 @@ }, { "Order": 4, + "Title": "Get project details", + "Slug": "getproject", + "Description": "Get a detailed project summary including all media files and compositions.\n\nReturns the project\u0027s id, name, drive_id, a map of media files (keyed by\ndisplay path) with type and duration, and a list of compositions with id,\nname, duration, and media type.\n\nUse this to inspect a project\u0027s contents before editing or importing media.", + "Language": "http", + "Code": "### Get project details\n# @name getProject\nGET {{host}}/projects/{{project_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Project details retrieved successfully\n# Content-Type: application/json\n# 401\n# Description: Unauthorized - invalid or missing authentication token\n# Content-Type: application/json\n# 403\n# Description: Forbidden - user does not have access to this project\n# Content-Type: application/json\n# 404\n# Description: Project not found\n# Content-Type: application/json\n# 429\n# Description: Too many requests - rate limit exceeded.\nUse the \u0060Retry-After\u0060 header to determine when to retry.\n\n# Content-Type: application/json", + "Format": "http", + "OperationId": "getProject", + "Setup": null + }, + { + "Order": 5, "Title": "Check API status", "Slug": "getstatus", "Description": "\u003E **Work in progress** \u2014 This endpoint is not yet available and will return an error if called.\n\nCheck API availability and validate authentication token.\n\nThis endpoint can be used to:\n- Verify that your authentication token is valid\n- Check API connectivity without performing any heavy operations\n\nReturns a success response if the token is valid, or a 401 error if the token is invalid or missing.", @@ -45,7 +56,7 @@ "Setup": "This example assumes \u0060using Descript;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 5, + "Order": 6, "Title": "Import media and sequences", "Slug": "importprojectmedia", "Description": "Import media files into a new or existing project and create compositions.\n\nThis endpoint can:\n- Create a new project if \u0060project_id\u0060 is not provided\n- Import media files from URLs\n- Create multitrack sequences\n- Create compositions (timelines) from existing or new media in the project\n- Trigger transcription and other background processing tasks\n\n### Media URL requirements\n- URLs must be accessible by Descript servers\n- URLs must support HTTP Range requests\n- Recommended to sign URLs for 12-48 hours to reduce chance of failure\n- [Supported file types](https://help.descript.com/hc/en-us/articles/10164098416909-Supported-file-types)\n\n### Direct file upload\n\nInstead of providing a URL, you can upload files directly by specifying \u0060content_type\u0060 and \u0060file_size\u0060 for a media item. The response will include a signed \u0060upload_url\u0060 for each direct upload item. PUT the file bytes to that URL, and the import job will process it automatically. See the [Direct file upload](#tag/Direct-file-upload) guide for a full walkthrough.\n\n### Async Operations\n\nImports\u00A0run in the background and return a \u0060job_id\u0060. Monitor progress via the [GET /jobs/{job_id}](#operation/getJob) endpoint.\n\n### Dynamic webhook\n\nIf \u0060callback_url\u0060 is provided, Descript will POST the job status to that URL when the job finishes (successfully or not).\n\nThe payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob).", @@ -56,7 +67,7 @@ "Setup": "This example assumes \u0060using Descript;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 6, + "Order": 7, "Title": "List jobs", "Slug": "listjobs", "Description": "List recent jobs with optional filtering by project or job type.\n\nBy default, jobs created within the last 7 days are returned. Use \u0060created_after\u0060 and\n\u0060created_before\u0060 to customize the time range. The maximum lookback is 30 days.\n\nResults are paginated. Use the \u0060cursor\u0060 from the response \u0060pagination.next_cursor\u0060 to\nfetch subsequent pages.\n\nQuery parameters allow you to filter the results:\n* Filter by \u0060project_id\u0060 to see all jobs for a project\n* Filter by \u0060type\u0060 to see specific job types (import/project_media, agent)", @@ -67,7 +78,29 @@ "Setup": "This example assumes \u0060using Descript;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 7, + "Order": 8, + "Title": "List projects", + "Slug": "listprojects", + "Description": "List projects accessible to the authenticated user within a drive.\n\nThe drive is determined from the access token.\n\nResults are paginated. Use the \u0060cursor\u0060 from the response \u0060pagination.next_cursor\u0060\nto fetch subsequent pages.", + "Language": "csharp", + "Code": "using var client = new DescriptClient(apiKey);\nvar response = await client.ApiEndpoints.ListProjectsAsync();", + "Format": "sdk", + "OperationId": "listProjects", + "Setup": "This example assumes \u0060using Descript;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." + }, + { + "Order": 9, + "Title": "Publish project media", + "Slug": "publishjob", + "Description": "Publish a project composition to create a shareable link and download the exported file.\n\nPublishes a specific composition from a project, rendering the output as video or audio\nat the specified resolution. When the job completes successfully the result contains both:\n\n- \u0060share_url\u0060: a public URL that can be used to view the published content on Descript\u0027s share site.\n- \u0060download_url\u0060: a time-limited signed URL to download the exported media file directly,\n along with \u0060download_url_expires_at\u0060 indicating when the link expires.\n\n### Async Operations\n\nPublish jobs run in the background and return a \u0060job_id\u0060. Monitor progress via the [GET /jobs/{job_id}](#operation/getJob) endpoint,\nwhich returns the \u0060share_url\u0060, \u0060download_url\u0060, and \u0060download_url_expires_at\u0060 fields once the job finishes.\n\n### Dynamic webhook\n\nIf \u0060callback_url\u0060 is provided, Descript will POST the job status to that URL when the job completes or fails.\nThe payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob).", + "Language": "csharp", + "Code": "using var client = new DescriptClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Descript.PublishJobRequest\u003E(\n @\u0022{\n \u0022\u0022project_id\u0022\u0022: \u0022\u00229f36ee32-5a2c-47e7-b1a3-94991d3e3ddb\u0022\u0022,\n \u0022\u0022composition_id\u0022\u0022: \u0022\u002239677a40-1c43-4c36-8449-46cfbc4de2b5\u0022\u0022,\n \u0022\u0022media_type\u0022\u0022: \u0022\u0022Audio\u0022\u0022\n}\u0022)!;\n\nvar response = await client.ApiEndpoints.PublishJobAsync(\n request: request\n);", + "Format": "sdk", + "OperationId": "publishJob", + "Setup": "This example assumes \u0060using Descript;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." + }, + { + "Order": 10, "Title": "Create Import URL", "Slug": "posteditindescriptschema", "Description": "Create an Import URL by sending a Project schema to Descript API from your service\u0027s backend.\n\n### Import Schema\nOur import schemas are specified as a minimal JSON list of files which is detailed in full at the bottom of this\nsection. At it\u0027s smallest, the request body looks like:\n\n\u0060\u0060\u0060\n{\n \u0022partner_drive_id\u0022: \u0022162c61d1-6ced-4b25-a622-7dba922983ee\u0022,\n \u0022project_schema\u0022: {\n \u0022schema_version\u0022: \u00221.0.0\u0022,\n \u0022files\u0022: [{\u0022uri\u0022: \u0022https://descriptusercontent.com/jane.wav?signature=d182bca64bf94a1483d2fd16b579f955\u0022}]\n }\n}\n\u0060\u0060\u0060\n\n### File Access\nThe file paths provided in the schema need to either be public or pre-signed URIs with enough time before\nexpiration for failures and retries, we suggest URIs that won\u0027t expire for 48 hours. We ask that the files have\nalready been saved when the import link is generated to minimize cases where we\u0027re waiting for eventually\nconsistent storage of files that will never be written. We will, however, wait for eventual consistency of the\nstorage layer and retry fetching files before eventually timing out.\n\nFiles must be hosted on preapproved hosts as our import process has an allow list which it checks URIs against.\nFiles will be requested with \u0060User-Agent: Descriptbot/1.0\u0060 (version may change) for tracking purposes.\n\n### Import link expiration\nImport links are no longer valid after a user imports their data once. Viewing an already used import link will\nnot allow for importing again and will not provide access to a previously created Descript Project. Partners are\nable to generate a new import link at any time, regardless of if a previous import link has been used.\n\nThe API does not currently provide partners with a link to the Descript Project, though users will be redirected\nto it from Descript\u0027s web interface the first time they import files, and can always find the Project in Descript.\n\nImport links expire after 3 hours and attempting to use an import link after the pre-signed links in the schema\nfile have expired will result in an error, so we recommend generating the import link after the user has clicked\nthe Edit in Descript button.\n\n### Supported media specification\nWe recommend sending the highest quality, uncompressed versions of files available to you. If you have multiple\ntracks, we recommend prioritizing sending us the full multi-track sequence over a combined file.\n\n* Audio: WAV, FLAC, AAC, MP3\n* Video: h264, HEVC (container: MOV, MP4)", @@ -78,7 +111,7 @@ "Setup": null }, { - "Order": 8, + "Order": 11, "Title": "Get Published Project Metadata", "Slug": "getpublishedprojectmetadata", "Description": "Retrieve metadata for a published Descript project by its URL slug. This endpoint provides information\nabout the published project including title, duration, publisher details, privacy settings, and subtitles.\n\nThis endpoint requires authentication using a personal token and is subject to rate limiting of 1000\nrequests per hour per user.", diff --git a/src/libs/Descript/openapi.yaml b/src/libs/Descript/openapi.yaml index e2fdd8c..5ff3246 100644 --- a/src/libs/Descript/openapi.yaml +++ b/src/libs/Descript/openapi.yaml @@ -921,6 +921,200 @@ paths: message: Composition not found '429': $ref: '#/components/responses/Error429Response' + /jobs/publish: + post: + tags: + - API Endpoints + summary: Publish project media + security: + - bearerAuth: [] + description: | + Publish a project composition to create a shareable link and download the exported file. + + Publishes a specific composition from a project, rendering the output as video or audio + at the specified resolution. When the job completes successfully the result contains both: + + - `share_url`: a public URL that can be used to view the published content on Descript's share site. + - `download_url`: a time-limited signed URL to download the exported media file directly, + along with `download_url_expires_at` indicating when the link expires. + + ### Async Operations + + Publish jobs run in the background and return a `job_id`. Monitor progress via the [GET /jobs/{job_id}](#operation/getJob) endpoint, + which returns the `share_url`, `download_url`, and `download_url_expires_at` fields once the job finishes. + + ### Dynamic webhook + + If `callback_url` is provided, Descript will POST the job status to that URL when the job completes or fails. + The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob). + operationId: publishJob + requestBody: + content: + application/json: + schema: + type: object + description: | + Request to publish a project composition. + properties: + project_id: + type: string + format: uuid + description: The ID of the project to publish. + example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + composition_id: + type: string + format: uuid + description: The ID of the composition within the project to publish. + example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + media_type: + type: string + enum: + - Video + - Audio + default: Video + description: Media type of the published output. + resolution: + type: string + enum: + - 480p + - 720p + - 1080p + - 1440p + - 4K + description: Resolution for the published output. Only applicable when media_type is Video. + callback_url: + type: string + format: uri + description: | + Optional webhook URL to call when the job completes or fails. + Descript will POST the job status (same format as [GET /jobs/{job_id}](#operation/getJob)) to this URL. + example: https://example.com/webhooks/descript/job_callback + access_level: + type: string + enum: + - public + - unlisted + - drive + - private + description: | + Desired access level for the published share page. + If omitted, the drive's configured default is used. + Returns 403 if the requested level is not permitted by the drive's publish settings + (e.g. requesting `public` when search engine indexing is disabled). + required: + - project_id + additionalProperties: false + examples: + publish_video: + summary: Publish as 1080p video + value: + project_id: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + composition_id: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + media_type: Video + resolution: 1080p + publish_audio: + summary: Publish as audio only + value: + project_id: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + composition_id: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + media_type: Audio + with_callback: + summary: Publish with webhook callback + value: + project_id: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + composition_id: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + media_type: Video + resolution: 720p + callback_url: https://example.com/webhooks/descript/job_callback + description: Publish request + required: true + responses: + '201': + description: Publish job created successfully + content: + application/json: + schema: + type: object + properties: + job_id: + type: string + format: uuid + description: Unique identifier for the publish job + example: 6dc3f30a-58c2-4174-96a6-dc18cf3c7776 + drive_id: + type: string + format: uuid + description: Drive ID where the project is located + example: c9c5c47e-158a-49f7-846b-4f6ee2a229a2 + project_id: + type: string + format: uuid + description: The project ID being published + example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + project_url: + type: string + format: uri + description: URL to access the project in Descript web app + example: https://web.descript.com/9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + required: + - job_id + - drive_id + - project_id + - project_url + '400': + description: | + Invalid input: + - Malformed request body + - Invalid project_id or composition_id format + - Invalid media_type or resolution value + content: + application/json: + schema: + $ref: '#/components/schemas/Error400' + examples: + invalid_project: + summary: Invalid project ID + value: + error: invalid_input + message: Invalid project_id format + invalid_resolution: + summary: Invalid resolution + value: + error: invalid_input + message: '"resolution" must be one of [480p, 720p, 1080p, 1440p, 4K]' + '401': + description: Unauthorized - missing or invalid authentication token + content: + application/json: + schema: + $ref: '#/components/schemas/Error401' + examples: + unauthorized: + summary: Missing authentication token + value: + error: unauthorized + message: Missing or invalid authentication token + '403': + description: | + Forbidden: + - User doesn't have write access to the project + - Project doesn't belong to the token's drive + - Requested `access_level` is not permitted by the drive's publish settings + content: + application/json: + schema: + $ref: '#/components/schemas/Error403' + examples: + forbidden: + summary: No access to project + value: + error: forbidden + message: Forbidden + '422': + description: | + Unprocessable Entity + '429': + $ref: '#/components/responses/Error429Response' /jobs: get: tags: @@ -1173,6 +1367,52 @@ paths: progress: label: Applying Studio Sound to clip 2 last_update_at: '2025-11-18T10:32:00Z' + publish_success: + summary: Publish job completed successfully + value: + job_id: 6dc3f30a-58c2-4174-96a6-dc18cf3c7776 + job_type: publish + job_state: stopped + created_at: '2025-11-18T10:30:00Z' + stopped_at: '2025-11-18T10:35:00Z' + drive_id: c9c5c47e-158a-49f7-846b-4f6ee2a229a2 + project_id: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + project_url: https://web.descript.com/9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + result: + status: success + composition_id: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + share_url: https://share.descript.com/view/abc123 + download_url: https://storage.googleapis.com/bucket/object?X-Goog-Signature=... + download_url_expires_at: '2025-11-18T11:35:00Z' + publish_running: + summary: Publish job running with share URL in progress + value: + job_id: 6dc3f30a-58c2-4174-96a6-dc18cf3c7776 + job_type: publish + job_state: running + created_at: '2025-11-18T10:30:00Z' + drive_id: c9c5c47e-158a-49f7-846b-4f6ee2a229a2 + project_id: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + project_url: https://web.descript.com/9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + progress: + label: Rendering video export + last_update_at: '2025-11-18T10:32:00Z' + composition_id: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + share_url: https://share.descript.com/view/abc123 + publish_failed: + summary: Publish job failed + value: + job_id: 6dc3f30a-58c2-4174-96a6-dc18cf3c7776 + job_type: publish + job_state: stopped + created_at: '2025-11-18T10:30:00Z' + stopped_at: '2025-11-18T10:31:00Z' + drive_id: c9c5c47e-158a-49f7-846b-4f6ee2a229a2 + project_id: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + project_url: https://web.descript.com/9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + result: + status: error + error_message: Export failed during render job_failed: summary: Job failed value: @@ -1294,6 +1534,277 @@ paths: message: Job not found '429': $ref: '#/components/responses/Error429Response' + /projects: + get: + tags: + - API Endpoints + summary: List projects + description: | + List projects accessible to the authenticated user within a drive. + + The drive is determined from the access token. + + Results are paginated. Use the `cursor` from the response `pagination.next_cursor` + to fetch subsequent pages. + operationId: listProjects + security: + - bearerAuth: [] + parameters: + - in: query + name: name + description: Filter projects whose name contains this string (case-insensitive). + required: false + schema: + type: string + - in: query + name: created_by + description: Filter projects created by this user UUID. + required: false + schema: + type: string + format: uuid + - in: query + name: created_after + description: Filter projects created after this ISO 8601 timestamp. + required: false + schema: + type: string + format: date-time + - in: query + name: created_before + description: Filter projects created before this ISO 8601 timestamp. + required: false + schema: + type: string + format: date-time + - in: query + name: updated_after + description: Filter projects updated after this ISO 8601 timestamp. + required: false + schema: + type: string + format: date-time + - in: query + name: updated_before + description: Filter projects updated before this ISO 8601 timestamp. + required: false + schema: + type: string + format: date-time + - in: query + name: sort + description: Sort field. Defaults to created_at. + required: false + schema: + type: string + enum: + - name + - created_at + - updated_at + - last_viewed_at + default: created_at + - in: query + name: direction + description: Sort direction. Defaults to desc. + required: false + schema: + type: string + enum: + - asc + - desc + default: desc + - in: query + name: cursor + description: Pagination cursor from a previous response's `pagination.next_cursor`. + required: false + schema: + type: string + - in: query + name: limit + description: Number of projects per page (1-100). Defaults to 20. + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 20 + responses: + '200': + description: Projects listed successfully + content: + application/json: + schema: + type: object + required: + - data + - pagination + properties: + data: + type: array + items: + type: object + required: + - id + - name + - created_at + - updated_at + properties: + id: + type: string + format: uuid + description: Project ID + example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + name: + type: string + description: Project name + example: Marketing Video + created_at: + type: string + format: date-time + description: When the project was created + example: '2025-11-18T10:30:00Z' + updated_at: + type: string + format: date-time + description: When the project was last updated + example: '2025-11-19T14:00:00Z' + pagination: + type: object + properties: + next_cursor: + type: string + description: Cursor for the next page. Absent if no more results. + '401': + description: Unauthorized - invalid or missing authentication token + content: + application/json: + schema: + $ref: '#/components/schemas/Error401' + '429': + $ref: '#/components/responses/Error429Response' + /projects/{project_id}: + get: + tags: + - API Endpoints + summary: Get project details + description: | + Get a detailed project summary including all media files and compositions. + + Returns the project's id, name, drive_id, a map of media files (keyed by + display path) with type and duration, and a list of compositions with id, + name, duration, and media type. + + Use this to inspect a project's contents before editing or importing media. + operationId: getProject + security: + - bearerAuth: [] + parameters: + - in: path + name: project_id + description: The project UUID + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Project details retrieved successfully + content: + application/json: + schema: + type: object + required: + - id + - name + - drive_id + - created_at + - updated_at + - media_files + - compositions + properties: + id: + type: string + format: uuid + description: Project ID + name: + type: string + description: Project name + drive_id: + type: string + format: uuid + description: Drive ID the project belongs to + created_at: + type: string + format: date-time + description: When the project was created (ISO 8601) + updated_at: + type: string + format: date-time + description: When the project was last updated (ISO 8601) + media_files: + type: object + description: Map of display path to media file info + additionalProperties: + type: object + required: + - type + properties: + type: + type: string + enum: + - audio + - video + - image + - sequence + - other + description: Media type + duration: + type: number + format: float + description: Duration in seconds (absent for images) + compositions: + type: array + description: Compositions in the project + items: + type: object + required: + - id + - name + properties: + id: + type: string + format: uuid + description: Composition ID + name: + type: string + description: Composition name + duration: + type: number + format: float + description: Duration in seconds + media_type: + type: string + description: Media type of the composition + '401': + description: Unauthorized - invalid or missing authentication token + content: + application/json: + schema: + $ref: '#/components/schemas/Error401' + '403': + description: Forbidden - user does not have access to this project + content: + application/json: + schema: + $ref: '#/components/schemas/Error403' + '404': + description: Project not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error404' + '429': + $ref: '#/components/responses/Error429Response' /status: get: tags: @@ -2099,10 +2610,158 @@ components: - drive_id - project_id - project_url + PublishSuccessResult: + type: object + description: Result when publish completed successfully + properties: + status: + type: string + enum: + - success + description: Indicates successful completion + composition_id: + type: string + description: Identifier of the published composition + example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + share_url: + type: string + format: uri + description: Public URL to view the published content + example: https://share.descript.com/view/abc123 + download_url: + type: string + format: uri + description: | + Time-limited signed URL to download the original published media file. Present when the job completed successfully and signing succeeded. + example: https://storage.googleapis.com/bucket/object?X-Goog-Signature=... + download_url_expires_at: + type: string + format: date-time + description: ISO 8601 time when download_url expires (if download_url is set) + required: + - status + - composition_id + - share_url + PublishErrorResult: + type: object + description: Result when publish failed + properties: + status: + type: string + enum: + - error + description: Indicates the publish job failed + error_message: + type: string + description: Human-readable error message + example: Export failed during render + required: + - status + - error_message + PublishJobStatus: + type: object + description: Status of a publish job + properties: + job_id: + type: string + format: uuid + description: Unique identifier for the job + example: 6dc3f30a-58c2-4174-96a6-dc18cf3c7776 + job_type: + type: string + enum: + - publish + description: Type of job + job_state: + type: string + enum: + - queued + - running + - stopped + - cancelled + description: | + Current state of the job: + - queued: Job is waiting to start + - running: Job is actively processing + - stopped: Job has finished (check result.status for outcome) + - cancelled: Job was cancelled by user + example: stopped + created_at: + type: string + format: date-time + description: When the job was created + example: '2025-11-18T10:30:00Z' + stopped_at: + type: string + format: date-time + description: When the job stopped (only present when job_state is stopped or cancelled) + example: '2025-11-18T10:35:00Z' + drive_id: + type: string + format: uuid + description: The drive ID + example: c9c5c47e-158a-49f7-846b-4f6ee2a229a2 + project_id: + type: string + format: uuid + description: The project ID + example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + project_url: + type: string + format: uri + description: URL to access the project in Descript web app + example: https://web.descript.com/9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + progress: + type: object + description: Progress information for the workflow (only present when job_state is running) + properties: + label: + type: string + description: Human-readable label describing the current action + example: Exporting composition... + percent: + type: integer + description: Percentage of the workflow that has been completed + example: 50 + last_update_at: + type: string + format: date-time + description: When the progress was last updated + example: '2025-11-18T10:32:00Z' + composition_id: + type: string + description: Composition being published (present when known) + example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 + share_url: + type: string + format: uri + description: Share URL when available before the job completes + example: https://share.descript.com/view/abc123 + required: + - label + result: + description: Job result (only present when job_state is stopped) + oneOf: + - $ref: '#/components/schemas/PublishSuccessResult' + - $ref: '#/components/schemas/PublishErrorResult' + discriminator: + propertyName: status + mapping: + success: '#/components/schemas/PublishSuccessResult' + error: '#/components/schemas/PublishErrorResult' + required: + - job_id + - job_type + - job_state + - created_at + - drive_id + - project_id + - project_url JobStatus: oneOf: - $ref: '#/components/schemas/ImportJobStatus' - $ref: '#/components/schemas/AgentJobStatus' + - $ref: '#/components/schemas/PublishJobStatus' discriminator: propertyName: job_type mapping: