From 5923029aa6fcb8622a47ad07891eda979ad612b7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 18 Sep 2026 15:53:47 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Commands/APIEndpointsApiGroupCommand.g.cs | 1 + .../ApiEndpointsSearchCommandApiCommand.g.cs | 172 +++++ .../Descript.ApiEndpointsClient.Search.g.cs | 661 ++++++++++++++++++ ....EditInDescript.JsonSerializerContext.g.cs | 4 +- ...ortFromDescript.JsonSerializerContext.g.cs | 4 +- .../Descript.IApiEndpointsClient.Search.g.cs | 74 ++ .../Descript.JsonConverters.OneOf5.g.cs | 326 +++++++++ ...script.JsonConverters.SearchMatchItem.g.cs | 53 ++ ...sonConverters.SearchMatchItemNullable.g.cs | 60 ++ ...ponseResultLayoutPackSearchResultType.g.cs | 53 ++ ...ultLayoutPackSearchResultTypeNullable.g.cs | 60 ++ ...ediaLibraryFolderSearchResultLocation.g.cs | 53 ++ ...aryFolderSearchResultLocationNullable.g.cs | 60 ++ ...ultMediaLibraryFolderSearchResultType.g.cs | 53 ++ ...LibraryFolderSearchResultTypeNullable.g.cs | 60 ++ ...sponseResultMediaSearchResultLocation.g.cs | 53 ++ ...sultMediaSearchResultLocationNullable.g.cs | 60 ++ ...chResponseResultMediaSearchResultType.g.cs | 53 ++ ...seResultMediaSearchResultTypeNullable.g.cs | 60 ++ ...seResultProjectFolderSearchResultType.g.cs | 53 ++ ...ProjectFolderSearchResultTypeNullable.g.cs | 60 ++ ...ResponseResultProjectSearchResultType.g.cs | 53 ++ ...ResultProjectSearchResultTypeNullable.g.cs | 60 ++ .../Descript.JsonConverters.SearchSort.g.cs | 53 ++ ...ipt.JsonConverters.SearchSortNullable.g.cs | 60 ++ ...escript.JsonConverters.SearchTypeItem.g.cs | 53 ++ ...JsonConverters.SearchTypeItemNullable.g.cs | 60 ++ .../Descript.JsonSerializerContext.g.cs | 75 +- .../Descript.JsonSerializerContextTypes.g.cs | 350 ++++++---- .../Descript.Models.SearchMatchItem.g.cs | 51 ++ .../Descript.Models.SearchOwner.Json.g.cs | 141 ++++ .../Descript.Models.SearchOwner.g.cs | 59 ++ .../Descript.Models.SearchResponse.Json.g.cs | 141 ++++ .../Descript.Models.SearchResponse.g.cs | 47 ++ ...onseResultLayoutPackSearchResult.Json.g.cs | 141 ++++ ...hResponseResultLayoutPackSearchResult.g.cs | 98 +++ ...ponseResultLayoutPackSearchResultType.g.cs | 45 ++ ...ltMediaLibraryFolderSearchResult.Json.g.cs | 141 ++++ ...eResultMediaLibraryFolderSearchResult.g.cs | 112 +++ ...ediaLibraryFolderSearchResultLocation.g.cs | 45 ++ ...ultMediaLibraryFolderSearchResultType.g.cs | 46 ++ ...hResponseResultMediaSearchResult.Json.g.cs | 141 ++++ ...SearchResponseResultMediaSearchResult.g.cs | 156 +++++ ...sponseResultMediaSearchResultLocation.g.cs | 59 ++ ...chResponseResultMediaSearchResultType.g.cs | 57 ++ ...eResultProjectFolderSearchResult.Json.g.cs | 141 ++++ ...sponseResultProjectFolderSearchResult.g.cs | 98 +++ ...seResultProjectFolderSearchResultType.g.cs | 45 ++ ...esponseResultProjectSearchResult.Json.g.cs | 141 ++++ ...archResponseResultProjectSearchResult.g.cs | 100 +++ ...ResponseResultProjectSearchResultType.g.cs | 45 ++ .../Generated/Descript.Models.SearchSort.g.cs | 57 ++ .../Descript.Models.SearchTypeItem.g.cs | 81 +++ .../Generated/Descript.OneOf.5.Json.g.cs | 141 ++++ .../Descript/Generated/Descript.OneOf.5.g.cs | 543 ++++++++++++++ .../Generated/autosdk.generated-examples.json | 13 +- src/libs/Descript/openapi.yaml | 420 +++++++++++ 57 files changed, 5965 insertions(+), 137 deletions(-) create mode 100644 src/cli/Descript.CLI/Commands/ApiEndpointsSearchCommandApiCommand.g.cs create mode 100644 src/libs/Descript/Generated/Descript.ApiEndpointsClient.Search.g.cs create mode 100644 src/libs/Descript/Generated/Descript.IApiEndpointsClient.Search.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.OneOf5.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchMatchItem.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchMatchItemNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultLayoutPackSearchResultType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultLayoutPackSearchResultTypeNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultLocation.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultLocationNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultTypeNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultLocation.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultLocationNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultTypeNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectFolderSearchResultType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectFolderSearchResultTypeNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectSearchResultType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectSearchResultTypeNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchSort.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchSortNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchTypeItem.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.SearchTypeItemNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchMatchItem.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchOwner.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchOwner.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponse.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponse.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultLayoutPackSearchResult.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultLayoutPackSearchResult.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultLayoutPackSearchResultType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResult.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResult.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResultLocation.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResultType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResult.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResult.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResultLocation.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResultType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectFolderSearchResult.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectFolderSearchResult.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectFolderSearchResultType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectSearchResult.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectSearchResult.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectSearchResultType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchSort.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.SearchTypeItem.g.cs create mode 100644 src/libs/Descript/Generated/Descript.OneOf.5.Json.g.cs create mode 100644 src/libs/Descript/Generated/Descript.OneOf.5.g.cs diff --git a/src/cli/Descript.CLI/Commands/APIEndpointsApiGroupCommand.g.cs b/src/cli/Descript.CLI/Commands/APIEndpointsApiGroupCommand.g.cs index b6505a7..1e0937d 100644 --- a/src/cli/Descript.CLI/Commands/APIEndpointsApiGroupCommand.g.cs +++ b/src/cli/Descript.CLI/Commands/APIEndpointsApiGroupCommand.g.cs @@ -21,6 +21,7 @@ public static Command Create() command.Subcommands.Add(ApiEndpointsListJobsCommandApiCommand.Create()); command.Subcommands.Add(ApiEndpointsListProjectsCommandApiCommand.Create()); command.Subcommands.Add(ApiEndpointsPublishJobCommandApiCommand.Create()); + command.Subcommands.Add(ApiEndpointsSearchCommandApiCommand.Create()); return command; } } \ No newline at end of file diff --git a/src/cli/Descript.CLI/Commands/ApiEndpointsSearchCommandApiCommand.g.cs b/src/cli/Descript.CLI/Commands/ApiEndpointsSearchCommandApiCommand.g.cs new file mode 100644 index 0000000..faa078e --- /dev/null +++ b/src/cli/Descript.CLI/Commands/ApiEndpointsSearchCommandApiCommand.g.cs @@ -0,0 +1,172 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Descript.CLI.Commands; + +internal static partial class ApiEndpointsSearchCommandApiCommand +{ + private static Option Query { get; } = new( + name: @"--query") + { + Description = @"Search term. Matched against names and contents. Must be non-empty. +", + Required = true, + }; + + private static Option UpdatedAfter { get; } = new( + name: @"--updated-after") + { + Description = @"Return results updated at or after this time. Accepts an ISO 8601 +date (`2026-08-01`, interpreted as the start of that UTC day) or +timestamp (`2026-08-01T09:30:00Z`). Values without a timezone +offset are read as UTC. +", + }; + + private static Option UpdatedBefore { get; } = new( + name: @"--updated-before") + { + Description = @"Return results updated at or before this time. Accepts an ISO 8601 +date (`2026-08-01`, interpreted as the end of that UTC day) or +timestamp (`2026-08-01T23:59:59Z`). Values without a timezone +offset are read as UTC. +", + }; + + private static Option?> Owner { get; } = new( + name: @"--owner") + { + Description = @"Return items owned by these user UUIDs. Repeat this parameter to +include more than one owner. If omitted, results from all owners +are returned. +", + }; + + private static Option?> Type { get; } = new( + name: @"--type") + { + Description = @"Result types to search. Repeat this parameter to search more than +one type. If omitted, all result types are returned. + +- `project`: Projects +- `layout_pack`: Layout packs +- `project_folder`: Folders that hold projects +- `media_library_folder`: Folders in the drive media library +- `video`, `image`, `audio`: Files of that media type in the drive + media library, Brand Studio, and inside projects +", + }; + + private static Option?> Match { get; } = new( + name: @"--match") + { + Description = @"How the query may match. Repeat this parameter to allow more than +one kind. `name` matches project, file, folder, and layout pack +names. `content` matches transcripts and composition text. If +omitted, names and contents both contribute. +", + }; + + private static Option Sort { get; } = new( + name: @"--sort") + { + Description = @"How to sort results: + +- `relevance`: closest matches first. This is the default. +- `newest`: most recently modified first. +- `oldest`: least recently modified first. +", + }; + + private static Option Limit { get; } = new( + name: @"--limit") + { + Description = @"Maximum number of results to return. Defaults to 30. Maximum is +100. +", + }; + + private static string FormatResponse(ParseResult parseResult, global::Descript.SearchResponse value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::Descript.SearchResponse value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"search", @"Search a drive +Search the drive tied to the personal API token. Matches project names, +folder names, layout pack names, media file names, composition text, +and transcripts across projects, the drive media library, and Brand +Studio. Returns up to 100 results ranked by relevance. +"); + command.Options.Add(Query); + command.Options.Add(UpdatedAfter); + command.Options.Add(UpdatedBefore); + command.Options.Add(Owner); + command.Options.Add(Type); + command.Options.Add(Match); + command.Options.Add(Sort); + command.Options.Add(Limit); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var query = parseResult.GetRequiredValue(Query); + var updatedAfter = parseResult.GetValue(UpdatedAfter); + var updatedBefore = parseResult.GetValue(UpdatedBefore); + var owner = parseResult.GetValue(Owner); + var type = parseResult.GetValue(Type); + var match = parseResult.GetValue(Match); + var sort = parseResult.GetValue(Sort); + var limit = parseResult.GetValue(Limit); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ApiEndpoints.SearchAsync( + query: query, + updatedAfter: updatedAfter, + updatedBefore: updatedBefore, + owner: owner, + type: type, + match: match, + sort: sort, + limit: limit, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::Descript.SourceGenerationContext.Default, + @"Results", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::Descript.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.Search.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.Search.g.cs new file mode 100644 index 0000000..2b6774d --- /dev/null +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.Search.g.cs @@ -0,0 +1,661 @@ + +#nullable enable + +namespace Descript +{ + public partial class ApiEndpointsClient + { + + + private static readonly global::Descript.EndPointSecurityRequirement s_SearchSecurityRequirement0 = + 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_SearchSecurityRequirements = + new global::Descript.EndPointSecurityRequirement[] + { s_SearchSecurityRequirement0, + }; + partial void PrepareSearchArguments( + global::System.Net.Http.HttpClient httpClient, + ref string query, + ref global::System.DateTime? updatedAfter, + ref global::System.DateTime? updatedBefore, + global::System.Collections.Generic.IList? owner, + global::System.Collections.Generic.IList? type, + global::System.Collections.Generic.IList? match, + ref global::Descript.SearchSort? sort, + ref int? limit); + partial void PrepareSearchRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string query, + global::System.DateTime? updatedAfter, + global::System.DateTime? updatedBefore, + global::System.Collections.Generic.IList? owner, + global::System.Collections.Generic.IList? type, + global::System.Collections.Generic.IList? match, + global::Descript.SearchSort? sort, + int? limit); + partial void ProcessSearchResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessSearchResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Search a drive
+ /// Search the drive tied to the personal API token. Matches project names,
+ /// folder names, layout pack names, media file names, composition text,
+ /// and transcripts across projects, the drive media library, and Brand
+ /// Studio. Returns up to 100 results ranked by relevance. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// Default Value: relevance + /// + /// + /// Default Value: 30 + /// + /// 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 SearchAsync( + string query, + global::System.DateTime? updatedAfter = default, + global::System.DateTime? updatedBefore = default, + global::System.Collections.Generic.IList? owner = default, + global::System.Collections.Generic.IList? type = default, + global::System.Collections.Generic.IList? match = default, + global::Descript.SearchSort? sort = default, + int? limit = default, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SearchAsResponseAsync( + query: query, + updatedAfter: updatedAfter, + updatedBefore: updatedBefore, + owner: owner, + type: type, + match: match, + sort: sort, + limit: limit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Search a drive
+ /// Search the drive tied to the personal API token. Matches project names,
+ /// folder names, layout pack names, media file names, composition text,
+ /// and transcripts across projects, the drive media library, and Brand
+ /// Studio. Returns up to 100 results ranked by relevance. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// Default Value: relevance + /// + /// + /// Default Value: 30 + /// + /// 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> SearchAsResponseAsync( + string query, + global::System.DateTime? updatedAfter = default, + global::System.DateTime? updatedBefore = default, + global::System.Collections.Generic.IList? owner = default, + global::System.Collections.Generic.IList? type = default, + global::System.Collections.Generic.IList? match = default, + global::Descript.SearchSort? sort = default, + int? limit = default, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareSearchArguments( + httpClient: HttpClient, + query: ref query, + updatedAfter: ref updatedAfter, + updatedBefore: ref updatedBefore, + owner: owner, + type: type, + match: match, + sort: ref sort, + limit: ref limit); + + + var __authorizations = global::Descript.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_SearchSecurityRequirements, + operationName: "SearchAsync"); + + 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: "/search", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("query", query) + .AddOptionalParameter("updated_after", updatedAfter?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("updated_before", updatedBefore?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("owner", owner, selector: static x => x.ToString()!, delimiter: ",", explode: true) + .AddOptionalParameter("type", type, selector: static x => x.ToValueString(), delimiter: ",", explode: true) + .AddOptionalParameter("match", match, selector: static x => x.ToValueString(), delimiter: ",", explode: true) + .AddOptionalParameter("sort", sort?.ToValueString()) + .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); + PrepareSearchRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + query: query!, + updatedAfter: updatedAfter, + updatedBefore: updatedBefore, + owner: owner, + type: type, + match: match, + sort: sort, + 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: "Search", + methodName: "SearchAsync", + pathTemplate: "\"/search\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + 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 __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Search", + methodName: "SearchAsync", + pathTemplate: "\"/search\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Descript.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Search", + methodName: "SearchAsync", + pathTemplate: "\"/search\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessSearchResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Search", + methodName: "SearchAsync", + pathTemplate: "\"/search\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Search", + methodName: "SearchAsync", + pathTemplate: "\"/search\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // The query is missing or the token is not associated with a drive. + 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 global::Descript.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The personal API token is missing or invalid. + 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 global::Descript.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The search endpoint is not enabled for the authenticated user. + 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 global::Descript.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + 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 global::Descript.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + 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); + ProcessSearchResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Descript.SearchResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Descript.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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); + + var __value = await global::Descript.SearchResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + 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 global::Descript.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + 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.EditInDescript.JsonSerializerContext.g.cs b/src/libs/Descript/Generated/Descript.EditInDescript.JsonSerializerContext.g.cs index 7eee242..efdb7a5 100644 --- a/src/libs/Descript/Generated/Descript.EditInDescript.JsonSerializerContext.g.cs +++ b/src/libs/Descript/Generated/Descript.EditInDescript.JsonSerializerContext.g.cs @@ -20,13 +20,13 @@ namespace Descript [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.Error429))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.EditInDescriptSchemaPostBody))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.EditInDescriptSchemaPostBody))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.EditInDescriptSchemaPostBodyProjectSchema))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.EditInDescriptSchemaPostBodyProjectSchemaFile))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.EditInDescriptSchemaPostBodyProjectSchemaFileStartOffset))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.EditInDescriptSchemaPostResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] diff --git a/src/libs/Descript/Generated/Descript.ExportFromDescript.JsonSerializerContext.g.cs b/src/libs/Descript/Generated/Descript.ExportFromDescript.JsonSerializerContext.g.cs index 8e57f7a..cae7a37 100644 --- a/src/libs/Descript/Generated/Descript.ExportFromDescript.JsonSerializerContext.g.cs +++ b/src/libs/Descript/Generated/Descript.ExportFromDescript.JsonSerializerContext.g.cs @@ -21,9 +21,9 @@ namespace Descript [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.Error429))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishedProjectMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishedProjectMetadataPublishType), TypeInfoPropertyName = "PublishedProjectMetadataPublishType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishedProjectMetadataPrivacy), TypeInfoPropertyName = "PublishedProjectMetadataPrivacy2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishedProjectMetadataMetadata))] @@ -38,8 +38,8 @@ namespace Descript [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishedProjectConflictErrorError), TypeInfoPropertyName = "PublishedProjectConflictErrorError2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishedProjectConflictErrorState), TypeInfoPropertyName = "PublishedProjectConflictErrorState2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishedProjectMetadataPublishType?), TypeInfoPropertyName = "NullablePublishedProjectMetadataPublishType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishedProjectMetadataPrivacy?), TypeInfoPropertyName = "NullablePublishedProjectMetadataPrivacy2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishedProjectErrorError?), TypeInfoPropertyName = "NullablePublishedProjectErrorError2")] diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.Search.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.Search.g.cs new file mode 100644 index 0000000..8310f7e --- /dev/null +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.Search.g.cs @@ -0,0 +1,74 @@ +#nullable enable + +namespace Descript +{ + public partial interface IApiEndpointsClient + { + /// + /// Search a drive
+ /// Search the drive tied to the personal API token. Matches project names,
+ /// folder names, layout pack names, media file names, composition text,
+ /// and transcripts across projects, the drive media library, and Brand
+ /// Studio. Returns up to 100 results ranked by relevance. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// Default Value: relevance + /// + /// + /// Default Value: 30 + /// + /// 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 SearchAsync( + string query, + global::System.DateTime? updatedAfter = default, + global::System.DateTime? updatedBefore = default, + global::System.Collections.Generic.IList? owner = default, + global::System.Collections.Generic.IList? type = default, + global::System.Collections.Generic.IList? match = default, + global::Descript.SearchSort? sort = default, + int? limit = default, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Search a drive
+ /// Search the drive tied to the personal API token. Matches project names,
+ /// folder names, layout pack names, media file names, composition text,
+ /// and transcripts across projects, the drive media library, and Brand
+ /// Studio. Returns up to 100 results ranked by relevance. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// Default Value: relevance + /// + /// + /// Default Value: 30 + /// + /// 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> SearchAsResponseAsync( + string query, + global::System.DateTime? updatedAfter = default, + global::System.DateTime? updatedBefore = default, + global::System.Collections.Generic.IList? owner = default, + global::System.Collections.Generic.IList? type = default, + global::System.Collections.Generic.IList? match = default, + global::Descript.SearchSort? sort = 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.JsonConverters.OneOf5.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.OneOf5.g.cs new file mode 100644 index 0000000..4ab2dce --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.OneOf5.g.cs @@ -0,0 +1,326 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public class OneOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> + { + /// + public override global::Descript.OneOf 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."); + + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + } + } + + var __score0 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T1), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score0++; + } + } + } + var __score1 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T2), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score1++; + } + } + } + var __score2 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T3), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score2++; + } + } + } + var __score3 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T4), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score3++; + } + } + } + var __score4 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T5), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score4++; + } + } + } + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; } + if (__score3 > __bestScore) { __bestScore = __score3; __bestIndex = 3; } + if (__score4 > __bestScore) { __bestScore = __score4; __bestIndex = 4; } + + T1? value1 = default; + T2? value2 = default; + T3? value3 = default; + T4? value4 = default; + T5? value5 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 1) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 2) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 3) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); + value4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 4) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); + value5 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); + value4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); + value5 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Descript.OneOf( + value1, + + value2, + + value3, + + value4, + + value5 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.OneOf 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.IsValue1) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1!, typeInfo); + } + else if (value.IsValue2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2!, typeInfo); + } + else if (value.IsValue3) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value3!, typeInfo); + } + else if (value.IsValue4) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value4!, typeInfo); + } + else if (value.IsValue5) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value5!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchMatchItem.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchMatchItem.g.cs new file mode 100644 index 0000000..518fbda --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchMatchItem.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchMatchItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchMatchItem 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.SearchMatchItemExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchMatchItem)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchMatchItem); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchMatchItem value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.SearchMatchItemExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchMatchItemNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchMatchItemNullable.g.cs new file mode 100644 index 0000000..e68ebd3 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchMatchItemNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchMatchItemNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchMatchItem? 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.SearchMatchItemExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchMatchItem)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchMatchItem?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchMatchItem? 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.SearchMatchItemExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultLayoutPackSearchResultType.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultLayoutPackSearchResultType.g.cs new file mode 100644 index 0000000..d992f85 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultLayoutPackSearchResultType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchResponseResultLayoutPackSearchResultTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchResponseResultLayoutPackSearchResultType 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.SearchResponseResultLayoutPackSearchResultTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchResponseResultLayoutPackSearchResultType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchResponseResultLayoutPackSearchResultType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchResponseResultLayoutPackSearchResultType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.SearchResponseResultLayoutPackSearchResultTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultLayoutPackSearchResultTypeNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultLayoutPackSearchResultTypeNullable.g.cs new file mode 100644 index 0000000..3c542ee --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultLayoutPackSearchResultTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchResponseResultLayoutPackSearchResultTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchResponseResultLayoutPackSearchResultType? 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.SearchResponseResultLayoutPackSearchResultTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchResponseResultLayoutPackSearchResultType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchResponseResultLayoutPackSearchResultType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchResponseResultLayoutPackSearchResultType? 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.SearchResponseResultLayoutPackSearchResultTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultLocation.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultLocation.g.cs new file mode 100644 index 0000000..15edfcc --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultLocation.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchResponseResultMediaLibraryFolderSearchResultLocationJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchResponseResultMediaLibraryFolderSearchResultLocation 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.SearchResponseResultMediaLibraryFolderSearchResultLocationExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchResponseResultMediaLibraryFolderSearchResultLocation)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchResponseResultMediaLibraryFolderSearchResultLocation); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchResponseResultMediaLibraryFolderSearchResultLocation value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.SearchResponseResultMediaLibraryFolderSearchResultLocationExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultLocationNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultLocationNullable.g.cs new file mode 100644 index 0000000..3547d02 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultLocationNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchResponseResultMediaLibraryFolderSearchResultLocationNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchResponseResultMediaLibraryFolderSearchResultLocation? 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.SearchResponseResultMediaLibraryFolderSearchResultLocationExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchResponseResultMediaLibraryFolderSearchResultLocation)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchResponseResultMediaLibraryFolderSearchResultLocation?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchResponseResultMediaLibraryFolderSearchResultLocation? 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.SearchResponseResultMediaLibraryFolderSearchResultLocationExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultType.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultType.g.cs new file mode 100644 index 0000000..126f77d --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchResponseResultMediaLibraryFolderSearchResultTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchResponseResultMediaLibraryFolderSearchResultType 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.SearchResponseResultMediaLibraryFolderSearchResultTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchResponseResultMediaLibraryFolderSearchResultType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchResponseResultMediaLibraryFolderSearchResultType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchResponseResultMediaLibraryFolderSearchResultType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.SearchResponseResultMediaLibraryFolderSearchResultTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultTypeNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultTypeNullable.g.cs new file mode 100644 index 0000000..d3af5c3 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchResponseResultMediaLibraryFolderSearchResultTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchResponseResultMediaLibraryFolderSearchResultType? 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.SearchResponseResultMediaLibraryFolderSearchResultTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchResponseResultMediaLibraryFolderSearchResultType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchResponseResultMediaLibraryFolderSearchResultType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchResponseResultMediaLibraryFolderSearchResultType? 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.SearchResponseResultMediaLibraryFolderSearchResultTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultLocation.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultLocation.g.cs new file mode 100644 index 0000000..82062a9 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultLocation.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchResponseResultMediaSearchResultLocationJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchResponseResultMediaSearchResultLocation 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.SearchResponseResultMediaSearchResultLocationExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchResponseResultMediaSearchResultLocation)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchResponseResultMediaSearchResultLocation); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchResponseResultMediaSearchResultLocation value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.SearchResponseResultMediaSearchResultLocationExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultLocationNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultLocationNullable.g.cs new file mode 100644 index 0000000..a7b44aa --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultLocationNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchResponseResultMediaSearchResultLocationNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchResponseResultMediaSearchResultLocation? 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.SearchResponseResultMediaSearchResultLocationExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchResponseResultMediaSearchResultLocation)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchResponseResultMediaSearchResultLocation?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchResponseResultMediaSearchResultLocation? 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.SearchResponseResultMediaSearchResultLocationExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultType.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultType.g.cs new file mode 100644 index 0000000..55072b0 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchResponseResultMediaSearchResultTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchResponseResultMediaSearchResultType 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.SearchResponseResultMediaSearchResultTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchResponseResultMediaSearchResultType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchResponseResultMediaSearchResultType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchResponseResultMediaSearchResultType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.SearchResponseResultMediaSearchResultTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultTypeNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultTypeNullable.g.cs new file mode 100644 index 0000000..9957bf4 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultMediaSearchResultTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchResponseResultMediaSearchResultTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchResponseResultMediaSearchResultType? 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.SearchResponseResultMediaSearchResultTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchResponseResultMediaSearchResultType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchResponseResultMediaSearchResultType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchResponseResultMediaSearchResultType? 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.SearchResponseResultMediaSearchResultTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectFolderSearchResultType.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectFolderSearchResultType.g.cs new file mode 100644 index 0000000..e032ffd --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectFolderSearchResultType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchResponseResultProjectFolderSearchResultTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchResponseResultProjectFolderSearchResultType 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.SearchResponseResultProjectFolderSearchResultTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchResponseResultProjectFolderSearchResultType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchResponseResultProjectFolderSearchResultType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchResponseResultProjectFolderSearchResultType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.SearchResponseResultProjectFolderSearchResultTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectFolderSearchResultTypeNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectFolderSearchResultTypeNullable.g.cs new file mode 100644 index 0000000..4ec58ca --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectFolderSearchResultTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchResponseResultProjectFolderSearchResultTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchResponseResultProjectFolderSearchResultType? 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.SearchResponseResultProjectFolderSearchResultTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchResponseResultProjectFolderSearchResultType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchResponseResultProjectFolderSearchResultType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchResponseResultProjectFolderSearchResultType? 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.SearchResponseResultProjectFolderSearchResultTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectSearchResultType.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectSearchResultType.g.cs new file mode 100644 index 0000000..c506e6a --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectSearchResultType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchResponseResultProjectSearchResultTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchResponseResultProjectSearchResultType 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.SearchResponseResultProjectSearchResultTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchResponseResultProjectSearchResultType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchResponseResultProjectSearchResultType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchResponseResultProjectSearchResultType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.SearchResponseResultProjectSearchResultTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectSearchResultTypeNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectSearchResultTypeNullable.g.cs new file mode 100644 index 0000000..e4e830a --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchResponseResultProjectSearchResultTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchResponseResultProjectSearchResultTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchResponseResultProjectSearchResultType? 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.SearchResponseResultProjectSearchResultTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchResponseResultProjectSearchResultType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchResponseResultProjectSearchResultType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchResponseResultProjectSearchResultType? 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.SearchResponseResultProjectSearchResultTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchSort.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchSort.g.cs new file mode 100644 index 0000000..43b61df --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchSort.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchSortJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchSort 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.SearchSortExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchSort)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchSort); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchSort value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.SearchSortExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchSortNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchSortNullable.g.cs new file mode 100644 index 0000000..e3c597d --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchSortNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchSortNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchSort? 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.SearchSortExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchSort)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchSort?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchSort? 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.SearchSortExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchTypeItem.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchTypeItem.g.cs new file mode 100644 index 0000000..18b0bf9 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchTypeItem.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchTypeItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchTypeItem 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.SearchTypeItemExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchTypeItem)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchTypeItem); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchTypeItem value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.SearchTypeItemExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.SearchTypeItemNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.SearchTypeItemNullable.g.cs new file mode 100644 index 0000000..fdc63b5 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.SearchTypeItemNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class SearchTypeItemNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.SearchTypeItem? 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.SearchTypeItemExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.SearchTypeItem)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.SearchTypeItem?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.SearchTypeItem? 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.SearchTypeItemExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonSerializerContext.g.cs b/src/libs/Descript/Generated/Descript.JsonSerializerContext.g.cs index b4fb9a9..2aab69b 100644 --- a/src/libs/Descript/Generated/Descript.JsonSerializerContext.g.cs +++ b/src/libs/Descript/Generated/Descript.JsonSerializerContext.g.cs @@ -13,6 +13,34 @@ namespace Descript DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, Converters = new global::System.Type[] { + typeof(global::Descript.JsonConverters.SearchResponseResultProjectSearchResultTypeJsonConverter), + + typeof(global::Descript.JsonConverters.SearchResponseResultProjectSearchResultTypeNullableJsonConverter), + + typeof(global::Descript.JsonConverters.SearchResponseResultMediaSearchResultTypeJsonConverter), + + typeof(global::Descript.JsonConverters.SearchResponseResultMediaSearchResultTypeNullableJsonConverter), + + typeof(global::Descript.JsonConverters.SearchResponseResultMediaSearchResultLocationJsonConverter), + + typeof(global::Descript.JsonConverters.SearchResponseResultMediaSearchResultLocationNullableJsonConverter), + + typeof(global::Descript.JsonConverters.SearchResponseResultLayoutPackSearchResultTypeJsonConverter), + + typeof(global::Descript.JsonConverters.SearchResponseResultLayoutPackSearchResultTypeNullableJsonConverter), + + typeof(global::Descript.JsonConverters.SearchResponseResultProjectFolderSearchResultTypeJsonConverter), + + typeof(global::Descript.JsonConverters.SearchResponseResultProjectFolderSearchResultTypeNullableJsonConverter), + + typeof(global::Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultTypeJsonConverter), + + typeof(global::Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultTypeNullableJsonConverter), + + typeof(global::Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultLocationJsonConverter), + + typeof(global::Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultLocationNullableJsonConverter), + typeof(global::Descript.JsonConverters.PublishedProjectMetadataPublishTypeJsonConverter), typeof(global::Descript.JsonConverters.PublishedProjectMetadataPublishTypeNullableJsonConverter), @@ -153,6 +181,18 @@ namespace Descript typeof(global::Descript.JsonConverters.ListProjectsDirectionNullableJsonConverter), + typeof(global::Descript.JsonConverters.SearchTypeItemJsonConverter), + + typeof(global::Descript.JsonConverters.SearchTypeItemNullableJsonConverter), + + typeof(global::Descript.JsonConverters.SearchMatchItemJsonConverter), + + typeof(global::Descript.JsonConverters.SearchMatchItemNullableJsonConverter), + + typeof(global::Descript.JsonConverters.SearchSortJsonConverter), + + typeof(global::Descript.JsonConverters.SearchSortNullableJsonConverter), + typeof(global::Descript.JsonConverters.ListAgentModelsResponseAvailableModelCostJsonConverter), typeof(global::Descript.JsonConverters.ListAgentModelsResponseAvailableModelCostNullableJsonConverter), @@ -181,6 +221,8 @@ namespace Descript typeof(global::Descript.JsonConverters.JobStatusJsonConverter), + typeof(global::Descript.JsonConverters.OneOfJsonConverter), + typeof(global::Descript.JsonConverters.OneOfJsonConverter), typeof(global::Descript.JsonConverters.UnixTimestampJsonConverter), @@ -194,16 +236,32 @@ namespace Descript [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.Error403))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.Error404))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.Error429))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.EditInDescriptSchemaPostBody))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>), TypeInfoPropertyName = "SearchResponseResultMediaLibraryFolderSearchResult_3772f94da0bc6d36")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.OneOf), TypeInfoPropertyName = "SearchResponseResultMediaLibraryFolderSearchResult_bfc3201b218202a0")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchResponseResultProjectSearchResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchResponseResultProjectSearchResultType), TypeInfoPropertyName = "SearchResponseResultProjectSearchResultType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchOwner))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchResponseResultMediaSearchResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchResponseResultMediaSearchResultType), TypeInfoPropertyName = "SearchResponseResultMediaSearchResultType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchResponseResultMediaSearchResultLocation), TypeInfoPropertyName = "SearchResponseResultMediaSearchResultLocation2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchResponseResultLayoutPackSearchResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchResponseResultLayoutPackSearchResultType), TypeInfoPropertyName = "SearchResponseResultLayoutPackSearchResultType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchResponseResultProjectFolderSearchResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchResponseResultProjectFolderSearchResultType), TypeInfoPropertyName = "SearchResponseResultProjectFolderSearchResultType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchResponseResultMediaLibraryFolderSearchResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchResponseResultMediaLibraryFolderSearchResultType), TypeInfoPropertyName = "SearchResponseResultMediaLibraryFolderSearchResultType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchResponseResultMediaLibraryFolderSearchResultLocation), TypeInfoPropertyName = "SearchResponseResultMediaLibraryFolderSearchResultLocation2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.EditInDescriptSchemaPostBody))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.EditInDescriptSchemaPostBodyProjectSchema))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.EditInDescriptSchemaPostBodyProjectSchemaFile))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.EditInDescriptSchemaPostBodyProjectSchemaFileStartOffset))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.EditInDescriptSchemaPostResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishedProjectMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishedProjectMetadataPublishType), TypeInfoPropertyName = "PublishedProjectMetadataPublishType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishedProjectMetadataPrivacy), TypeInfoPropertyName = "PublishedProjectMetadataPrivacy2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishedProjectMetadataMetadata))] @@ -288,6 +346,12 @@ namespace Descript [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::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchTypeItem), TypeInfoPropertyName = "SearchTypeItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchMatchItem), TypeInfoPropertyName = "SearchMatchItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.SearchSort), TypeInfoPropertyName = "SearchSort2")] [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))] @@ -319,12 +383,17 @@ namespace Descript [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.GetProjectResponsePublisheAccessLevel), TypeInfoPropertyName = "GetProjectResponsePublisheAccessLevel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.GetProjectResponsePublisheMediaType), TypeInfoPropertyName = "GetProjectResponsePublisheMediaType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.GetStatusResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.OneOf?), TypeInfoPropertyName = "SearchResponseResultMediaLibraryFolderSearchResult_7de459a6117e24a6")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.OneOf?), TypeInfoPropertyName = "ImportProjectMediaRequestAddMediaMultitrackSequence_a84f7d44496d84a5")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>), TypeInfoPropertyName = "SearchResponseResultMediaLibraryFolderSearchResult_07217df44b83550a")] [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))] + [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))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] diff --git a/src/libs/Descript/Generated/Descript.JsonSerializerContextTypes.g.cs b/src/libs/Descript/Generated/Descript.JsonSerializerContextTypes.g.cs index b116913..0cbc05a 100644 --- a/src/libs/Descript/Generated/Descript.JsonSerializerContextTypes.g.cs +++ b/src/libs/Descript/Generated/Descript.JsonSerializerContextTypes.g.cs @@ -61,495 +61,575 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Descript.EditInDescriptSchemaPostBody? Type7 { get; set; } + public global::Descript.SearchResponse? Type7 { get; set; } /// /// /// - public global::System.Guid? Type8 { get; set; } + public global::Descript.SearchResponseResultProjectSearchResult? Type8 { get; set; } /// /// /// - public global::Descript.EditInDescriptSchemaPostBodyProjectSchema? Type9 { get; set; } + public global::Descript.SearchResponseResultProjectSearchResultType? Type9 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type10 { get; set; } + public global::System.Guid? Type10 { get; set; } /// /// /// - public global::Descript.EditInDescriptSchemaPostBodyProjectSchemaFile? Type11 { get; set; } + public global::Descript.SearchOwner? Type11 { get; set; } /// /// /// - public global::Descript.EditInDescriptSchemaPostBodyProjectSchemaFileStartOffset? Type12 { get; set; } + public global::System.DateTime? Type12 { get; set; } /// /// /// - public double? Type13 { get; set; } + public global::Descript.SearchResponseResultMediaSearchResult? Type13 { get; set; } /// /// /// - public global::Descript.EditInDescriptSchemaPostResponse? Type14 { get; set; } + public global::Descript.SearchResponseResultMediaSearchResultType? Type14 { get; set; } /// /// /// - public global::Descript.PublishedProjectMetadata? Type15 { get; set; } + public global::Descript.SearchResponseResultMediaSearchResultLocation? Type15 { get; set; } /// /// /// - public global::System.DateTime? Type16 { get; set; } + public double? Type16 { get; set; } /// /// /// - public global::Descript.PublishedProjectMetadataPublishType? Type17 { get; set; } + public global::Descript.SearchResponseResultLayoutPackSearchResult? Type17 { get; set; } /// /// /// - public global::Descript.PublishedProjectMetadataPrivacy? Type18 { get; set; } + public global::Descript.SearchResponseResultLayoutPackSearchResultType? Type18 { get; set; } /// /// /// - public global::Descript.PublishedProjectMetadataMetadata? Type19 { get; set; } + public global::Descript.SearchResponseResultProjectFolderSearchResult? Type19 { get; set; } /// /// /// - public global::Descript.PublishedProjectMetadataMetadataPublishedBy? Type20 { get; set; } + public global::Descript.SearchResponseResultProjectFolderSearchResultType? Type20 { get; set; } /// /// /// - public global::Descript.PublishedProjectError? Type21 { get; set; } + public global::Descript.SearchResponseResultMediaLibraryFolderSearchResult? Type21 { get; set; } /// /// /// - public global::Descript.PublishedProjectErrorError? Type22 { get; set; } + public global::Descript.SearchResponseResultMediaLibraryFolderSearchResultType? Type22 { get; set; } /// /// /// - public global::Descript.PublishedProjectPrivateError? Type23 { get; set; } + public global::Descript.SearchResponseResultMediaLibraryFolderSearchResultLocation? Type23 { get; set; } /// /// /// - public global::Descript.PublishedProjectPrivateErrorError? Type24 { get; set; } + public global::Descript.EditInDescriptSchemaPostBody? Type24 { get; set; } /// /// /// - public global::Descript.PublishedProjectForbiddenError? Type25 { get; set; } + public global::Descript.EditInDescriptSchemaPostBodyProjectSchema? Type25 { get; set; } /// /// /// - public global::Descript.PublishedProjectForbiddenErrorError? Type26 { get; set; } + public global::System.Collections.Generic.IList? Type26 { get; set; } /// /// /// - public global::Descript.PublishedProjectConflictError? Type27 { get; set; } + public global::Descript.EditInDescriptSchemaPostBodyProjectSchemaFile? Type27 { get; set; } /// /// /// - public global::Descript.PublishedProjectConflictErrorError? Type28 { get; set; } + public global::Descript.EditInDescriptSchemaPostBodyProjectSchemaFileStartOffset? Type28 { get; set; } /// /// /// - public global::Descript.PublishedProjectConflictErrorState? Type29 { get; set; } + public global::Descript.EditInDescriptSchemaPostResponse? Type29 { get; set; } /// /// /// - public global::Descript.ImportSuccessResult? Type30 { get; set; } + public global::Descript.PublishedProjectMetadata? Type30 { get; set; } /// /// /// - public global::Descript.ImportSuccessResultStatus? Type31 { get; set; } + public global::Descript.PublishedProjectMetadataPublishType? Type31 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type32 { get; set; } + public global::Descript.PublishedProjectMetadataPrivacy? Type32 { get; set; } /// /// /// - public global::Descript.ImportSuccessResultMediaStatus2? Type33 { get; set; } + public global::Descript.PublishedProjectMetadataMetadata? Type33 { get; set; } /// /// /// - public global::Descript.ImportSuccessResultMediaStatusStatus? Type34 { get; set; } + public global::Descript.PublishedProjectMetadataMetadataPublishedBy? Type34 { get; set; } /// /// /// - public float? Type35 { get; set; } + public global::Descript.PublishedProjectError? Type35 { get; set; } /// /// /// - public int? Type36 { get; set; } + public global::Descript.PublishedProjectErrorError? Type36 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type37 { get; set; } + public global::Descript.PublishedProjectPrivateError? Type37 { get; set; } /// /// /// - public global::Descript.ImportSuccessResultCreatedComposition? Type38 { get; set; } + public global::Descript.PublishedProjectPrivateErrorError? Type38 { get; set; } /// /// /// - public global::Descript.ImportErrorResult? Type39 { get; set; } + public global::Descript.PublishedProjectForbiddenError? Type39 { get; set; } /// /// /// - public global::Descript.ImportErrorResultStatus? Type40 { get; set; } + public global::Descript.PublishedProjectForbiddenErrorError? Type40 { get; set; } /// /// /// - public global::Descript.ImportJobStatus? Type41 { get; set; } + public global::Descript.PublishedProjectConflictError? Type41 { get; set; } /// /// /// - public global::Descript.ImportJobStatusJobType? Type42 { get; set; } + public global::Descript.PublishedProjectConflictErrorError? Type42 { get; set; } /// /// /// - public global::Descript.ImportJobStatusJobState? Type43 { get; set; } + public global::Descript.PublishedProjectConflictErrorState? Type43 { get; set; } /// /// /// - public global::Descript.ImportJobStatusProgress? Type44 { get; set; } + public global::Descript.ImportSuccessResult? Type44 { get; set; } /// /// /// - public global::Descript.Result? Type45 { get; set; } + public global::Descript.ImportSuccessResultStatus? Type45 { get; set; } /// /// /// - public global::Descript.ImportJobStatusResultDiscriminator? Type46 { get; set; } + public global::System.Collections.Generic.Dictionary? Type46 { get; set; } /// /// /// - public global::Descript.ImportJobStatusResultDiscriminatorStatus? Type47 { get; set; } + public global::Descript.ImportSuccessResultMediaStatus2? Type47 { get; set; } /// /// /// - public global::Descript.AgentSuccessResult? Type48 { get; set; } + public global::Descript.ImportSuccessResultMediaStatusStatus? Type48 { get; set; } /// /// /// - public global::Descript.AgentSuccessResultStatus? Type49 { get; set; } + public float? Type49 { get; set; } /// /// /// - public bool? Type50 { get; set; } + public int? Type50 { get; set; } /// /// /// - public global::Descript.AgentErrorResult? Type51 { get; set; } + public global::System.Collections.Generic.IList? Type51 { get; set; } /// /// /// - public global::Descript.AgentErrorResultStatus? Type52 { get; set; } + public global::Descript.ImportSuccessResultCreatedComposition? Type52 { get; set; } /// /// /// - public global::Descript.AgentJobStatus? Type53 { get; set; } + public global::Descript.ImportErrorResult? Type53 { get; set; } /// /// /// - public global::Descript.AgentJobStatusJobType? Type54 { get; set; } + public global::Descript.ImportErrorResultStatus? Type54 { get; set; } /// /// /// - public global::Descript.AgentJobStatusJobState? Type55 { get; set; } + public global::Descript.ImportJobStatus? Type55 { get; set; } /// /// /// - public global::Descript.AgentJobStatusProgress? Type56 { get; set; } + public global::Descript.ImportJobStatusJobType? Type56 { get; set; } /// /// /// - public global::Descript.Result2? Type57 { get; set; } + public global::Descript.ImportJobStatusJobState? Type57 { get; set; } /// /// /// - public global::Descript.AgentJobStatusResultDiscriminator? Type58 { get; set; } + public global::Descript.ImportJobStatusProgress? Type58 { get; set; } /// /// /// - public global::Descript.AgentJobStatusResultDiscriminatorStatus? Type59 { get; set; } + public global::Descript.Result? Type59 { get; set; } /// /// /// - public global::Descript.PublishSuccessResult? Type60 { get; set; } + public global::Descript.ImportJobStatusResultDiscriminator? Type60 { get; set; } /// /// /// - public global::Descript.PublishSuccessResultStatus? Type61 { get; set; } + public global::Descript.ImportJobStatusResultDiscriminatorStatus? Type61 { get; set; } /// /// /// - public global::Descript.PublishSuccessResultMediaType? Type62 { get; set; } + public global::Descript.AgentSuccessResult? Type62 { get; set; } /// /// /// - public global::Descript.PublishErrorResult? Type63 { get; set; } + public global::Descript.AgentSuccessResultStatus? Type63 { get; set; } /// /// /// - public global::Descript.PublishErrorResultStatus? Type64 { get; set; } + public bool? Type64 { get; set; } /// /// /// - public global::Descript.PublishJobStatus? Type65 { get; set; } + public global::Descript.AgentErrorResult? Type65 { get; set; } /// /// /// - public global::Descript.PublishJobStatusJobType? Type66 { get; set; } + public global::Descript.AgentErrorResultStatus? Type66 { get; set; } /// /// /// - public global::Descript.PublishJobStatusJobState? Type67 { get; set; } + public global::Descript.AgentJobStatus? Type67 { get; set; } /// /// /// - public global::Descript.PublishJobStatusProgress? Type68 { get; set; } + public global::Descript.AgentJobStatusJobType? Type68 { get; set; } /// /// /// - public global::Descript.Result3? Type69 { get; set; } + public global::Descript.AgentJobStatusJobState? Type69 { get; set; } /// /// /// - public global::Descript.PublishJobStatusResultDiscriminator? Type70 { get; set; } + public global::Descript.AgentJobStatusProgress? Type70 { get; set; } /// /// /// - public global::Descript.PublishJobStatusResultDiscriminatorStatus? Type71 { get; set; } + public global::Descript.Result2? Type71 { get; set; } /// /// /// - public global::Descript.JobStatus? Type72 { get; set; } + public global::Descript.AgentJobStatusResultDiscriminator? Type72 { get; set; } /// /// /// - public global::Descript.JobStatusDiscriminator? Type73 { get; set; } + public global::Descript.AgentJobStatusResultDiscriminatorStatus? Type73 { get; set; } /// /// /// - public global::Descript.JobStatusDiscriminatorJobType? Type74 { get; set; } + public global::Descript.PublishSuccessResult? Type74 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequest? Type75 { get; set; } + public global::Descript.PublishSuccessResultStatus? Type75 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestTeamAccess? Type76 { get; set; } + public global::Descript.PublishSuccessResultMediaType? Type76 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddMediaUrlImport? Type77 { get; set; } + public global::Descript.PublishErrorResult? Type77 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddMediaDirectUpload? Type78 { get; set; } + public global::Descript.PublishErrorResultStatus? Type78 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddMediaMultitrackSequence? Type79 { get; set; } + public global::Descript.PublishJobStatus? Type79 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type80 { get; set; } + public global::Descript.PublishJobStatusJobType? Type80 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddMediaMultitrackSequenceTrack? Type81 { get; set; } + public global::Descript.PublishJobStatusJobState? Type81 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type82 { get; set; } + public global::Descript.PublishJobStatusProgress? Type82 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddComposition? Type83 { get; set; } + public global::Descript.Result3? Type83 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type84 { get; set; } + public global::Descript.PublishJobStatusResultDiscriminator? Type84 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddCompositionClip? Type85 { get; set; } + public global::Descript.PublishJobStatusResultDiscriminatorStatus? Type85 { get; set; } /// /// /// - public global::Descript.AgentEditJobRequest? Type86 { get; set; } + public global::Descript.JobStatus? Type86 { get; set; } /// /// /// - public global::Descript.AgentEditJobRequestTeamAccess? Type87 { get; set; } + public global::Descript.JobStatusDiscriminator? Type87 { get; set; } /// /// /// - public global::Descript.PublishJobRequest? Type88 { get; set; } + public global::Descript.JobStatusDiscriminatorJobType? Type88 { get; set; } /// /// /// - public global::Descript.PublishJobRequestMediaType? Type89 { get; set; } + public global::Descript.ImportProjectMediaRequest? Type89 { get; set; } /// /// /// - public global::Descript.PublishJobRequestResolution? Type90 { get; set; } + public global::Descript.ImportProjectMediaRequestTeamAccess? Type90 { get; set; } /// /// /// - public global::Descript.PublishJobRequestAccessLevel? Type91 { get; set; } + public global::Descript.ImportProjectMediaRequestAddMediaUrlImport? Type91 { get; set; } /// /// /// - public global::Descript.ExportTranscriptRequest? Type92 { get; set; } + public global::Descript.ImportProjectMediaRequestAddMediaDirectUpload? Type92 { get; set; } /// /// /// - public global::Descript.ExportTranscriptRequestFormat? Type93 { get; set; } + public global::Descript.ImportProjectMediaRequestAddMediaMultitrackSequence? Type93 { get; set; } /// /// /// - public global::Descript.ExportTranscriptRequestIncludeSpeakerLabels? Type94 { get; set; } + public global::System.Collections.Generic.IList? Type94 { get; set; } /// /// /// - public global::Descript.ExportTranscriptRequestTimecodes? Type95 { get; set; } + public global::Descript.ImportProjectMediaRequestAddMediaMultitrackSequenceTrack? Type95 { get; set; } /// /// /// - public global::Descript.ListJobsType? Type96 { get; set; } + public global::System.Collections.Generic.IList? Type96 { get; set; } /// /// /// - public global::Descript.ListProjectsSort? Type97 { get; set; } + public global::Descript.ImportProjectMediaRequestAddComposition? Type97 { get; set; } /// /// /// - public global::Descript.ListProjectsDirection? Type98 { get; set; } + public global::System.Collections.Generic.IList? Type98 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaResponse? Type99 { get; set; } + public global::Descript.ImportProjectMediaRequestAddCompositionClip? Type99 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type100 { get; set; } + public global::Descript.AgentEditJobRequest? Type100 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaResponseUploadUrls2? Type101 { get; set; } + public global::Descript.AgentEditJobRequestTeamAccess? Type101 { get; set; } /// /// /// - public global::Descript.AgentEditJobResponse? Type102 { get; set; } + public global::Descript.PublishJobRequest? Type102 { get; set; } /// /// /// - public global::Descript.ListAgentModelsResponse? Type103 { get; set; } + public global::Descript.PublishJobRequestMediaType? Type103 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type104 { get; set; } + public global::Descript.PublishJobRequestResolution? Type104 { get; set; } /// /// /// - public global::Descript.ListAgentModelsResponseAvailableModel? Type105 { get; set; } + public global::Descript.PublishJobRequestAccessLevel? Type105 { get; set; } /// /// /// - public global::Descript.ListAgentModelsResponseAvailableModelCost? Type106 { get; set; } + public global::Descript.ExportTranscriptRequest? Type106 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type107 { get; set; } + public global::Descript.ExportTranscriptRequestFormat? Type107 { get; set; } /// /// /// - public global::Descript.ListAgentModelsResponseAliase? Type108 { get; set; } + public global::Descript.ExportTranscriptRequestIncludeSpeakerLabels? Type108 { get; set; } /// /// /// - public global::Descript.ListAgentModelsResponseAliaseCost? Type109 { get; set; } + public global::Descript.ExportTranscriptRequestTimecodes? Type109 { get; set; } /// /// /// - public global::Descript.PublishJobResponse? Type110 { get; set; } + public global::Descript.ListJobsType? Type110 { get; set; } /// /// /// - public byte[]? Type111 { get; set; } + public global::Descript.ListProjectsSort? Type111 { get; set; } /// /// /// - public global::Descript.ListJobsResponse? Type112 { get; set; } + public global::Descript.ListProjectsDirection? Type112 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type113 { get; set; } + public global::System.Collections.Generic.IList? Type113 { get; set; } /// /// /// - public global::Descript.ListJobsResponsePagination? Type114 { get; set; } + public global::System.Collections.Generic.IList? Type114 { get; set; } /// /// /// - public global::Descript.ListProjectsResponse? Type115 { get; set; } + public global::Descript.SearchTypeItem? Type115 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type116 { get; set; } + public global::System.Collections.Generic.IList? Type116 { get; set; } /// /// /// - public global::Descript.ListProjectsResponseDataItem? Type117 { get; set; } + public global::Descript.SearchMatchItem? Type117 { get; set; } /// /// /// - public global::Descript.ListProjectsResponsePagination? Type118 { get; set; } + public global::Descript.SearchSort? Type118 { get; set; } /// /// /// - public global::Descript.GetProjectResponse? Type119 { get; set; } + public global::Descript.ImportProjectMediaResponse? Type119 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type120 { get; set; } + public global::System.Collections.Generic.Dictionary? Type120 { get; set; } /// /// /// - public global::Descript.GetProjectResponseMediaFiles2? Type121 { get; set; } + public global::Descript.ImportProjectMediaResponseUploadUrls2? Type121 { get; set; } /// /// /// - public global::Descript.GetProjectResponseMediaFilesType? Type122 { get; set; } + public global::Descript.AgentEditJobResponse? Type122 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type123 { get; set; } + public global::Descript.ListAgentModelsResponse? Type123 { get; set; } /// /// /// - public global::Descript.GetProjectResponseComposition? Type124 { get; set; } + public global::System.Collections.Generic.IList? Type124 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type125 { get; set; } + public global::Descript.ListAgentModelsResponseAvailableModel? Type125 { get; set; } /// /// /// - public global::Descript.GetProjectResponsePublishe? Type126 { get; set; } + public global::Descript.ListAgentModelsResponseAvailableModelCost? Type126 { get; set; } /// /// /// - public global::Descript.GetProjectResponsePublisheAccessLevel? Type127 { get; set; } + public global::System.Collections.Generic.IList? Type127 { get; set; } /// /// /// - public global::Descript.GetProjectResponsePublisheMediaType? Type128 { get; set; } + public global::Descript.ListAgentModelsResponseAliase? Type128 { get; set; } /// /// /// - public global::Descript.GetStatusResponse? Type129 { get; set; } + public global::Descript.ListAgentModelsResponseAliaseCost? Type129 { get; set; } + /// + /// + /// + public global::Descript.PublishJobResponse? Type130 { get; set; } + /// + /// + /// + public byte[]? Type131 { get; set; } + /// + /// + /// + public global::Descript.ListJobsResponse? Type132 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type133 { get; set; } + /// + /// + /// + public global::Descript.ListJobsResponsePagination? Type134 { get; set; } + /// + /// + /// + public global::Descript.ListProjectsResponse? Type135 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type136 { get; set; } + /// + /// + /// + public global::Descript.ListProjectsResponseDataItem? Type137 { get; set; } + /// + /// + /// + public global::Descript.ListProjectsResponsePagination? Type138 { get; set; } + /// + /// + /// + public global::Descript.GetProjectResponse? Type139 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.Dictionary? Type140 { get; set; } + /// + /// + /// + public global::Descript.GetProjectResponseMediaFiles2? Type141 { get; set; } + /// + /// + /// + public global::Descript.GetProjectResponseMediaFilesType? Type142 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type143 { get; set; } + /// + /// + /// + public global::Descript.GetProjectResponseComposition? Type144 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type145 { get; set; } + /// + /// + /// + public global::Descript.GetProjectResponsePublishe? Type146 { get; set; } + /// + /// + /// + public global::Descript.GetProjectResponsePublisheAccessLevel? Type147 { get; set; } + /// + /// + /// + public global::Descript.GetProjectResponsePublisheMediaType? Type148 { get; set; } + /// + /// + /// + public global::Descript.GetStatusResponse? Type149 { get; set; } /// /// @@ -574,26 +654,38 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType5 { get; set; } + 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; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType8 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType6 { get; set; } + public global::System.Collections.Generic.List? ListType9 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType7 { get; set; } + public global::System.Collections.Generic.List? ListType10 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType8 { get; set; } + public global::System.Collections.Generic.List? ListType11 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType9 { get; set; } + public global::System.Collections.Generic.List? ListType12 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType10 { get; set; } + public global::System.Collections.Generic.List? ListType13 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchMatchItem.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchMatchItem.g.cs new file mode 100644 index 0000000..ef7bdfb --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchMatchItem.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Descript +{ + /// + /// + /// + public enum SearchMatchItem + { + /// + /// + /// + Content, + /// + /// + /// + Name, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class SearchMatchItemExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this SearchMatchItem value) + { + return value switch + { + SearchMatchItem.Content => "content", + SearchMatchItem.Name => "name", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static SearchMatchItem? ToEnum(string value) + { + return value switch + { + "content" => SearchMatchItem.Content, + "name" => SearchMatchItem.Name, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchOwner.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchOwner.Json.g.cs new file mode 100644 index 0000000..9eb86d5 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchOwner.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class SearchOwner + { + /// + /// 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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.SearchOwner? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.SearchOwner), + jsonSerializerContext) as global::Descript.SearchOwner; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Descript.SearchOwner? FromJson( + string json) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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.SearchOwner? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + 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.SearchOwner), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.SearchOwner; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.SearchOwner.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchOwner.g.cs new file mode 100644 index 0000000..cc2fb18 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchOwner.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Owner of the search result. Omitted when the owner is unavailable. + /// + public sealed partial class SearchOwner + { + /// + /// User ID of the owner. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid Id { get; set; } + + /// + /// Display name of the owner. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { 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. + /// + /// + /// User ID of the owner. + /// + /// + /// Display name of the owner. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SearchOwner( + global::System.Guid id, + string name) + { + this.Id = id; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + } + + /// + /// Initializes a new instance of the class. + /// + public SearchOwner() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponse.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponse.Json.g.cs new file mode 100644 index 0000000..f00ba74 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class SearchResponse + { + /// + /// 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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.SearchResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.SearchResponse), + jsonSerializerContext) as global::Descript.SearchResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Descript.SearchResponse? FromJson( + string json) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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.SearchResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + 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.SearchResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.SearchResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponse.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponse.g.cs new file mode 100644 index 0000000..e6ffd68 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponse.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Ranked search results. + /// + public sealed partial class SearchResponse + { + /// + /// Search results ranked by relevance, best match first. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("results")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList> Results { 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. + /// + /// + /// Search results ranked by relevance, best match first. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SearchResponse( + global::System.Collections.Generic.IList> results) + { + this.Results = results ?? throw new global::System.ArgumentNullException(nameof(results)); + } + + /// + /// Initializes a new instance of the class. + /// + public SearchResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultLayoutPackSearchResult.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultLayoutPackSearchResult.Json.g.cs new file mode 100644 index 0000000..47735a9 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultLayoutPackSearchResult.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class SearchResponseResultLayoutPackSearchResult + { + /// + /// 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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.SearchResponseResultLayoutPackSearchResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.SearchResponseResultLayoutPackSearchResult), + jsonSerializerContext) as global::Descript.SearchResponseResultLayoutPackSearchResult; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Descript.SearchResponseResultLayoutPackSearchResult? FromJson( + string json) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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.SearchResponseResultLayoutPackSearchResult? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + 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.SearchResponseResultLayoutPackSearchResult), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.SearchResponseResultLayoutPackSearchResult; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultLayoutPackSearchResult.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultLayoutPackSearchResult.g.cs new file mode 100644 index 0000000..4db11eb --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultLayoutPackSearchResult.g.cs @@ -0,0 +1,98 @@ + +#nullable enable + +namespace Descript +{ + /// + /// A layout pack matched. + /// + public sealed partial class SearchResponseResultLayoutPackSearchResult + { + /// + /// Always `layout_pack` for a layout pack result. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.SearchResponseResultLayoutPackSearchResultTypeJsonConverter))] + public global::Descript.SearchResponseResultLayoutPackSearchResultType Type { get; set; } + + /// + /// ID of the layout pack. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("project_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid ProjectId { get; set; } + + /// + /// Name of the layout pack. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Owner of the search result. Omitted when the owner is unavailable. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("owner")] + public global::Descript.SearchOwner? Owner { get; set; } + + /// + /// When the layout pack was last modified. This is
+ /// the field `updated_after` and `updated_before`
+ /// filter on. + ///
+ [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. + /// + /// + /// ID of the layout pack. + /// + /// + /// Name of the layout pack. + /// + /// + /// When the layout pack was last modified. This is
+ /// the field `updated_after` and `updated_before`
+ /// filter on. + /// + /// + /// Always `layout_pack` for a layout pack result. + /// + /// + /// Owner of the search result. Omitted when the owner is unavailable. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SearchResponseResultLayoutPackSearchResult( + global::System.Guid projectId, + string name, + global::System.DateTime updatedAt, + global::Descript.SearchResponseResultLayoutPackSearchResultType type, + global::Descript.SearchOwner? owner) + { + this.Type = type; + this.ProjectId = projectId; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Owner = owner; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public SearchResponseResultLayoutPackSearchResult() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultLayoutPackSearchResultType.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultLayoutPackSearchResultType.g.cs new file mode 100644 index 0000000..67d0beb --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultLayoutPackSearchResultType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Always `layout_pack` for a layout pack result. + /// + public enum SearchResponseResultLayoutPackSearchResultType + { + /// + /// + /// + LayoutPack, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class SearchResponseResultLayoutPackSearchResultTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this SearchResponseResultLayoutPackSearchResultType value) + { + return value switch + { + SearchResponseResultLayoutPackSearchResultType.LayoutPack => "layout_pack", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static SearchResponseResultLayoutPackSearchResultType? ToEnum(string value) + { + return value switch + { + "layout_pack" => SearchResponseResultLayoutPackSearchResultType.LayoutPack, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResult.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResult.Json.g.cs new file mode 100644 index 0000000..9ec8e51 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResult.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class SearchResponseResultMediaLibraryFolderSearchResult + { + /// + /// 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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.SearchResponseResultMediaLibraryFolderSearchResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.SearchResponseResultMediaLibraryFolderSearchResult), + jsonSerializerContext) as global::Descript.SearchResponseResultMediaLibraryFolderSearchResult; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Descript.SearchResponseResultMediaLibraryFolderSearchResult? FromJson( + string json) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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.SearchResponseResultMediaLibraryFolderSearchResult? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + 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.SearchResponseResultMediaLibraryFolderSearchResult), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.SearchResponseResultMediaLibraryFolderSearchResult; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResult.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResult.g.cs new file mode 100644 index 0000000..11d8183 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResult.g.cs @@ -0,0 +1,112 @@ + +#nullable enable + +namespace Descript +{ + /// + /// A folder in the drive media library. + /// + public sealed partial class SearchResponseResultMediaLibraryFolderSearchResult + { + /// + /// Always `media_library_folder`. The folder holds
+ /// media library files. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultTypeJsonConverter))] + public global::Descript.SearchResponseResultMediaLibraryFolderSearchResultType Type { get; set; } + + /// + /// ID of the folder. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("folder_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid FolderId { get; set; } + + /// + /// Name of the folder. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Always `media_library` for a media-library folder. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("location")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.SearchResponseResultMediaLibraryFolderSearchResultLocationJsonConverter))] + public global::Descript.SearchResponseResultMediaLibraryFolderSearchResultLocation Location { get; set; } + + /// + /// Owner of the search result. Omitted when the owner is unavailable. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("owner")] + public global::Descript.SearchOwner? Owner { get; set; } + + /// + /// When the folder was last modified. This is the
+ /// field `updated_after` and `updated_before` filter
+ /// on. + ///
+ [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. + /// + /// + /// ID of the folder. + /// + /// + /// Name of the folder. + /// + /// + /// When the folder was last modified. This is the
+ /// field `updated_after` and `updated_before` filter
+ /// on. + /// + /// + /// Always `media_library_folder`. The folder holds
+ /// media library files. + /// + /// + /// Always `media_library` for a media-library folder. + /// + /// + /// Owner of the search result. Omitted when the owner is unavailable. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SearchResponseResultMediaLibraryFolderSearchResult( + global::System.Guid folderId, + string name, + global::System.DateTime updatedAt, + global::Descript.SearchResponseResultMediaLibraryFolderSearchResultType type, + global::Descript.SearchResponseResultMediaLibraryFolderSearchResultLocation location, + global::Descript.SearchOwner? owner) + { + this.Type = type; + this.FolderId = folderId; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Location = location; + this.Owner = owner; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public SearchResponseResultMediaLibraryFolderSearchResult() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResultLocation.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResultLocation.g.cs new file mode 100644 index 0000000..5b97ea1 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResultLocation.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Always `media_library` for a media-library folder. + /// + public enum SearchResponseResultMediaLibraryFolderSearchResultLocation + { + /// + /// + /// + MediaLibrary, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class SearchResponseResultMediaLibraryFolderSearchResultLocationExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this SearchResponseResultMediaLibraryFolderSearchResultLocation value) + { + return value switch + { + SearchResponseResultMediaLibraryFolderSearchResultLocation.MediaLibrary => "media_library", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static SearchResponseResultMediaLibraryFolderSearchResultLocation? ToEnum(string value) + { + return value switch + { + "media_library" => SearchResponseResultMediaLibraryFolderSearchResultLocation.MediaLibrary, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResultType.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResultType.g.cs new file mode 100644 index 0000000..ce68989 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaLibraryFolderSearchResultType.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Always `media_library_folder`. The folder holds
+ /// media library files. + ///
+ public enum SearchResponseResultMediaLibraryFolderSearchResultType + { + /// + /// + /// + MediaLibraryFolder, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class SearchResponseResultMediaLibraryFolderSearchResultTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this SearchResponseResultMediaLibraryFolderSearchResultType value) + { + return value switch + { + SearchResponseResultMediaLibraryFolderSearchResultType.MediaLibraryFolder => "media_library_folder", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static SearchResponseResultMediaLibraryFolderSearchResultType? ToEnum(string value) + { + return value switch + { + "media_library_folder" => SearchResponseResultMediaLibraryFolderSearchResultType.MediaLibraryFolder, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResult.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResult.Json.g.cs new file mode 100644 index 0000000..c45d187 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResult.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class SearchResponseResultMediaSearchResult + { + /// + /// 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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.SearchResponseResultMediaSearchResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.SearchResponseResultMediaSearchResult), + jsonSerializerContext) as global::Descript.SearchResponseResultMediaSearchResult; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Descript.SearchResponseResultMediaSearchResult? FromJson( + string json) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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.SearchResponseResultMediaSearchResult? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + 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.SearchResponseResultMediaSearchResult), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.SearchResponseResultMediaSearchResult; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResult.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResult.g.cs new file mode 100644 index 0000000..da7d221 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResult.g.cs @@ -0,0 +1,156 @@ + +#nullable enable + +namespace Descript +{ + /// + /// A video, audio, or image file in the drive media library,
+ /// Brand Studio, or a project. + ///
+ public sealed partial class SearchResponseResultMediaSearchResult + { + /// + /// The kind of media: `video`, `audio`, or `image`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.SearchResponseResultMediaSearchResultTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Descript.SearchResponseResultMediaSearchResultType Type { get; set; } + + /// + /// ID of the file. Endpoints that take an `asset_id` accept it. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("asset_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid AssetId { get; set; } + + /// + /// ID of the project that contains the file. Present
+ /// only when `location` is `project`. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("project_id")] + public global::System.Guid? ProjectId { get; set; } + + /// + /// ID of the Brand Studio that contains the file.
+ /// Present only when `location` is `brand_studio`. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("brand_studio_id")] + public global::System.Guid? BrandStudioId { get; set; } + + /// + /// File name of the media file. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Where the file lives: `media_library` in the drive
+ /// media library, `project` inside a project, or
+ /// `brand_studio` in Brand Studio. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("location")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.SearchResponseResultMediaSearchResultLocationJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Descript.SearchResponseResultMediaSearchResultLocation Location { get; set; } + + /// + /// Owner of the search result. Omitted when the owner is unavailable. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("owner")] + public global::Descript.SearchOwner? Owner { get; set; } + + /// + /// When the file was last modified. This is the
+ /// field `updated_after` and `updated_before` filter
+ /// on. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { get; set; } + + /// + /// Playback length of the file in seconds. Omitted
+ /// for images and for files with no duration. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("duration")] + public double? 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. + /// + /// + /// The kind of media: `video`, `audio`, or `image`. + /// + /// + /// ID of the file. Endpoints that take an `asset_id` accept it. + /// + /// + /// File name of the media file. + /// + /// + /// Where the file lives: `media_library` in the drive
+ /// media library, `project` inside a project, or
+ /// `brand_studio` in Brand Studio. + /// + /// + /// When the file was last modified. This is the
+ /// field `updated_after` and `updated_before` filter
+ /// on. + /// + /// + /// ID of the project that contains the file. Present
+ /// only when `location` is `project`. + /// + /// + /// ID of the Brand Studio that contains the file.
+ /// Present only when `location` is `brand_studio`. + /// + /// + /// Owner of the search result. Omitted when the owner is unavailable. + /// + /// + /// Playback length of the file in seconds. Omitted
+ /// for images and for files with no duration. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SearchResponseResultMediaSearchResult( + global::Descript.SearchResponseResultMediaSearchResultType type, + global::System.Guid assetId, + string name, + global::Descript.SearchResponseResultMediaSearchResultLocation location, + global::System.DateTime updatedAt, + global::System.Guid? projectId, + global::System.Guid? brandStudioId, + global::Descript.SearchOwner? owner, + double? duration) + { + this.Type = type; + this.AssetId = assetId; + this.ProjectId = projectId; + this.BrandStudioId = brandStudioId; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Location = location; + this.Owner = owner; + this.UpdatedAt = updatedAt; + this.Duration = duration; + } + + /// + /// Initializes a new instance of the class. + /// + public SearchResponseResultMediaSearchResult() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResultLocation.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResultLocation.g.cs new file mode 100644 index 0000000..5a8ee2a --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResultLocation.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Where the file lives: `media_library` in the drive
+ /// media library, `project` inside a project, or
+ /// `brand_studio` in Brand Studio. + ///
+ public enum SearchResponseResultMediaSearchResultLocation + { + /// + /// + /// + BrandStudio, + /// + /// `media_library` in the drive + /// + MediaLibrary, + /// + /// + /// + Project, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class SearchResponseResultMediaSearchResultLocationExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this SearchResponseResultMediaSearchResultLocation value) + { + return value switch + { + SearchResponseResultMediaSearchResultLocation.BrandStudio => "brand_studio", + SearchResponseResultMediaSearchResultLocation.MediaLibrary => "media_library", + SearchResponseResultMediaSearchResultLocation.Project => "project", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static SearchResponseResultMediaSearchResultLocation? ToEnum(string value) + { + return value switch + { + "brand_studio" => SearchResponseResultMediaSearchResultLocation.BrandStudio, + "media_library" => SearchResponseResultMediaSearchResultLocation.MediaLibrary, + "project" => SearchResponseResultMediaSearchResultLocation.Project, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResultType.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResultType.g.cs new file mode 100644 index 0000000..bc8d5d6 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultMediaSearchResultType.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Descript +{ + /// + /// The kind of media: `video`, `audio`, or `image`. + /// + public enum SearchResponseResultMediaSearchResultType + { + /// + /// `video`, `audio`, or `image`. + /// + Audio, + /// + /// `video`, `audio`, or `image`. + /// + Image, + /// + /// `video`, `audio`, or `image`. + /// + Video, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class SearchResponseResultMediaSearchResultTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this SearchResponseResultMediaSearchResultType value) + { + return value switch + { + SearchResponseResultMediaSearchResultType.Audio => "audio", + SearchResponseResultMediaSearchResultType.Image => "image", + SearchResponseResultMediaSearchResultType.Video => "video", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static SearchResponseResultMediaSearchResultType? ToEnum(string value) + { + return value switch + { + "audio" => SearchResponseResultMediaSearchResultType.Audio, + "image" => SearchResponseResultMediaSearchResultType.Image, + "video" => SearchResponseResultMediaSearchResultType.Video, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectFolderSearchResult.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectFolderSearchResult.Json.g.cs new file mode 100644 index 0000000..d73a4a7 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectFolderSearchResult.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class SearchResponseResultProjectFolderSearchResult + { + /// + /// 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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.SearchResponseResultProjectFolderSearchResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.SearchResponseResultProjectFolderSearchResult), + jsonSerializerContext) as global::Descript.SearchResponseResultProjectFolderSearchResult; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Descript.SearchResponseResultProjectFolderSearchResult? FromJson( + string json) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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.SearchResponseResultProjectFolderSearchResult? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + 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.SearchResponseResultProjectFolderSearchResult), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.SearchResponseResultProjectFolderSearchResult; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectFolderSearchResult.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectFolderSearchResult.g.cs new file mode 100644 index 0000000..61017ed --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectFolderSearchResult.g.cs @@ -0,0 +1,98 @@ + +#nullable enable + +namespace Descript +{ + /// + /// A folder that holds projects. + /// + public sealed partial class SearchResponseResultProjectFolderSearchResult + { + /// + /// Always `project_folder`. The folder holds projects. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.SearchResponseResultProjectFolderSearchResultTypeJsonConverter))] + public global::Descript.SearchResponseResultProjectFolderSearchResultType Type { get; set; } + + /// + /// ID of the folder. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("folder_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid FolderId { get; set; } + + /// + /// Name of the folder. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Owner of the search result. Omitted when the owner is unavailable. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("owner")] + public global::Descript.SearchOwner? Owner { get; set; } + + /// + /// When the folder was last modified. This is the
+ /// field `updated_after` and `updated_before` filter
+ /// on. + ///
+ [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. + /// + /// + /// ID of the folder. + /// + /// + /// Name of the folder. + /// + /// + /// When the folder was last modified. This is the
+ /// field `updated_after` and `updated_before` filter
+ /// on. + /// + /// + /// Always `project_folder`. The folder holds projects. + /// + /// + /// Owner of the search result. Omitted when the owner is unavailable. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SearchResponseResultProjectFolderSearchResult( + global::System.Guid folderId, + string name, + global::System.DateTime updatedAt, + global::Descript.SearchResponseResultProjectFolderSearchResultType type, + global::Descript.SearchOwner? owner) + { + this.Type = type; + this.FolderId = folderId; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Owner = owner; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public SearchResponseResultProjectFolderSearchResult() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectFolderSearchResultType.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectFolderSearchResultType.g.cs new file mode 100644 index 0000000..2444358 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectFolderSearchResultType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Always `project_folder`. The folder holds projects. + /// + public enum SearchResponseResultProjectFolderSearchResultType + { + /// + /// + /// + ProjectFolder, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class SearchResponseResultProjectFolderSearchResultTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this SearchResponseResultProjectFolderSearchResultType value) + { + return value switch + { + SearchResponseResultProjectFolderSearchResultType.ProjectFolder => "project_folder", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static SearchResponseResultProjectFolderSearchResultType? ToEnum(string value) + { + return value switch + { + "project_folder" => SearchResponseResultProjectFolderSearchResultType.ProjectFolder, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectSearchResult.Json.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectSearchResult.Json.g.cs new file mode 100644 index 0000000..f4e4c4a --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectSearchResult.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Descript +{ + public sealed partial class SearchResponseResultProjectSearchResult + { + /// + /// 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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.SearchResponseResultProjectSearchResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.SearchResponseResultProjectSearchResult), + jsonSerializerContext) as global::Descript.SearchResponseResultProjectSearchResult; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Descript.SearchResponseResultProjectSearchResult? FromJson( + string json) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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.SearchResponseResultProjectSearchResult? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + 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.SearchResponseResultProjectSearchResult), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.SearchResponseResultProjectSearchResult; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectSearchResult.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectSearchResult.g.cs new file mode 100644 index 0000000..c8a88ec --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectSearchResult.g.cs @@ -0,0 +1,100 @@ + +#nullable enable + +namespace Descript +{ + /// + /// A project matched. + /// + public sealed partial class SearchResponseResultProjectSearchResult + { + /// + /// Always `project` for a project result. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.SearchResponseResultProjectSearchResultTypeJsonConverter))] + public global::Descript.SearchResponseResultProjectSearchResultType Type { get; set; } + + /// + /// ID of the project. Endpoints that take a
+ /// `project_id` accept it. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("project_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid ProjectId { get; set; } + + /// + /// Name of the project. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Owner of the search result. Omitted when the owner is unavailable. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("owner")] + public global::Descript.SearchOwner? Owner { get; set; } + + /// + /// When the project was last modified. This is the
+ /// field `updated_after` and `updated_before` filter
+ /// on. + ///
+ [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. + /// + /// + /// ID of the project. Endpoints that take a
+ /// `project_id` accept it. + /// + /// + /// Name of the project. + /// + /// + /// When the project was last modified. This is the
+ /// field `updated_after` and `updated_before` filter
+ /// on. + /// + /// + /// Always `project` for a project result. + /// + /// + /// Owner of the search result. Omitted when the owner is unavailable. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SearchResponseResultProjectSearchResult( + global::System.Guid projectId, + string name, + global::System.DateTime updatedAt, + global::Descript.SearchResponseResultProjectSearchResultType type, + global::Descript.SearchOwner? owner) + { + this.Type = type; + this.ProjectId = projectId; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Owner = owner; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public SearchResponseResultProjectSearchResult() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectSearchResultType.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectSearchResultType.g.cs new file mode 100644 index 0000000..8dd7cec --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchResponseResultProjectSearchResultType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Always `project` for a project result. + /// + public enum SearchResponseResultProjectSearchResultType + { + /// + /// + /// + Project, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class SearchResponseResultProjectSearchResultTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this SearchResponseResultProjectSearchResultType value) + { + return value switch + { + SearchResponseResultProjectSearchResultType.Project => "project", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static SearchResponseResultProjectSearchResultType? ToEnum(string value) + { + return value switch + { + "project" => SearchResponseResultProjectSearchResultType.Project, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchSort.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchSort.g.cs new file mode 100644 index 0000000..70d6fed --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchSort.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Descript +{ + /// + /// Default Value: relevance + /// + public enum SearchSort + { + /// + /// most recently modified first. + /// + Newest, + /// + /// least recently modified first. + /// + Oldest, + /// + /// closest matches first. This is the default. + /// + Relevance, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class SearchSortExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this SearchSort value) + { + return value switch + { + SearchSort.Newest => "newest", + SearchSort.Oldest => "oldest", + SearchSort.Relevance => "relevance", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static SearchSort? ToEnum(string value) + { + return value switch + { + "newest" => SearchSort.Newest, + "oldest" => SearchSort.Oldest, + "relevance" => SearchSort.Relevance, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.Models.SearchTypeItem.g.cs b/src/libs/Descript/Generated/Descript.Models.SearchTypeItem.g.cs new file mode 100644 index 0000000..f748160 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.SearchTypeItem.g.cs @@ -0,0 +1,81 @@ + +#nullable enable + +namespace Descript +{ + /// + /// + /// + public enum SearchTypeItem + { + /// + /// + /// + Audio, + /// + /// + /// + Image, + /// + /// + /// + LayoutPack, + /// + /// + /// + MediaLibraryFolder, + /// + /// + /// + Project, + /// + /// + /// + ProjectFolder, + /// + /// + /// + Video, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class SearchTypeItemExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this SearchTypeItem value) + { + return value switch + { + SearchTypeItem.Audio => "audio", + SearchTypeItem.Image => "image", + SearchTypeItem.LayoutPack => "layout_pack", + SearchTypeItem.MediaLibraryFolder => "media_library_folder", + SearchTypeItem.Project => "project", + SearchTypeItem.ProjectFolder => "project_folder", + SearchTypeItem.Video => "video", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static SearchTypeItem? ToEnum(string value) + { + return value switch + { + "audio" => SearchTypeItem.Audio, + "image" => SearchTypeItem.Image, + "layout_pack" => SearchTypeItem.LayoutPack, + "media_library_folder" => SearchTypeItem.MediaLibraryFolder, + "project" => SearchTypeItem.Project, + "project_folder" => SearchTypeItem.ProjectFolder, + "video" => SearchTypeItem.Video, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.OneOf.5.Json.g.cs b/src/libs/Descript/Generated/Descript.OneOf.5.Json.g.cs new file mode 100644 index 0000000..b9d3056 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.OneOf.5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Descript +{ + public readonly partial struct OneOf + { + /// + /// 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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Descript.OneOf? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Descript.OneOf), + jsonSerializerContext) as global::Descript.OneOf?; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Descript.OneOf? FromJson( + string json) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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.OneOf? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Descript.SourceGenerationContext.Default); + } + + 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.OneOf), + jsonSerializerContext).ConfigureAwait(false)) as global::Descript.OneOf?; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Descript.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.OneOf.5.g.cs b/src/libs/Descript/Generated/Descript.OneOf.5.g.cs new file mode 100644 index 0000000..bcb3eb7 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.OneOf.5.g.cs @@ -0,0 +1,543 @@ + +#nullable enable + +namespace Descript +{ + /// + /// + /// + public readonly partial struct OneOf : global::System.IEquatable> + { + /// + /// + /// +#if NET6_0_OR_GREATER + public T1? Value1 { get; init; } +#else + public T1? Value1 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] +#endif + public bool IsValue1 => Value1 != null; + + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T2? Value2 { get; init; } +#else + public T2? Value2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] +#endif + public bool IsValue2 => Value2 != null; + + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T3? Value3 { get; init; } +#else + public T3? Value3 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] +#endif + public bool IsValue3 => Value3 != null; + + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } + + /// + /// + /// + public T3 PickValue3() => IsValue3 + ? Value3! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T4? Value4 { get; init; } +#else + public T4? Value4 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] +#endif + public bool IsValue4 => Value4 != null; + + /// + /// + /// + public bool TryPickValue4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T4? value) + { + value = Value4; + return IsValue4; + } + + /// + /// + /// + public T4 PickValue4() => IsValue4 + ? Value4! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value4' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T5? Value5 { get; init; } +#else + public T5? Value5 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value5))] +#endif + public bool IsValue5 => Value5 != null; + + /// + /// + /// + public bool TryPickValue5( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T5? value) + { + value = Value5; + return IsValue5; + } + + /// + /// + /// + public T5 PickValue5() => IsValue5 + ? Value5! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value5' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator OneOf(T1 value) => new OneOf((T1?)value); + + /// + /// + /// + public static implicit operator T1?(OneOf @this) => @this.Value1; + + /// + /// + /// + public OneOf(T1? value) + { + Value1 = value; + } + + /// + /// + /// + public static OneOf FromValue1(T1? value) => new OneOf(value); + + /// + /// + /// + public static implicit operator OneOf(T2 value) => new OneOf((T2?)value); + + /// + /// + /// + public static implicit operator T2?(OneOf @this) => @this.Value2; + + /// + /// + /// + public OneOf(T2? value) + { + Value2 = value; + } + + /// + /// + /// + public static OneOf FromValue2(T2? value) => new OneOf(value); + + /// + /// + /// + public static implicit operator OneOf(T3 value) => new OneOf((T3?)value); + + /// + /// + /// + public static implicit operator T3?(OneOf @this) => @this.Value3; + + /// + /// + /// + public OneOf(T3? value) + { + Value3 = value; + } + + /// + /// + /// + public static OneOf FromValue3(T3? value) => new OneOf(value); + + /// + /// + /// + public static implicit operator OneOf(T4 value) => new OneOf((T4?)value); + + /// + /// + /// + public static implicit operator T4?(OneOf @this) => @this.Value4; + + /// + /// + /// + public OneOf(T4? value) + { + Value4 = value; + } + + /// + /// + /// + public static OneOf FromValue4(T4? value) => new OneOf(value); + + /// + /// + /// + public static implicit operator OneOf(T5 value) => new OneOf((T5?)value); + + /// + /// + /// + public static implicit operator T5?(OneOf @this) => @this.Value5; + + /// + /// + /// + public OneOf(T5? value) + { + Value5 = value; + } + + /// + /// + /// + public static OneOf FromValue5(T5? value) => new OneOf(value); + + /// + /// + /// + public OneOf( + T1? value1, + T2? value2, + T3? value3, + T4? value4, + T5? value5 + ) + { + Value1 = value1; + Value2 = value2; + Value3 = value3; + Value4 = value4; + Value5 = value5; + } + + /// + /// + /// + public object? Object => + Value5 as object ?? + Value4 as object ?? + Value3 as object ?? + Value2 as object ?? + Value1 as object + ; + + /// + /// + /// + public override string? ToString() => + Value1?.ToString() ?? + Value2?.ToString() ?? + Value3?.ToString() ?? + Value4?.ToString() ?? + Value5?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 || !IsValue1 && IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 || !IsValue1 && !IsValue2 && IsValue3 && !IsValue4 && !IsValue5 || !IsValue1 && !IsValue2 && !IsValue3 && IsValue4 && !IsValue5 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && IsValue5; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + global::System.Func? value3 = null, + global::System.Func? value4 = null, + global::System.Func? value5 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1 && value1 != null) + { + return value1(Value1!); + } + else if (IsValue2 && value2 != null) + { + return value2(Value2!); + } + else if (IsValue3 && value3 != null) + { + return value3(Value3!); + } + else if (IsValue4 && value4 != null) + { + return value4(Value4!); + } + else if (IsValue5 && value5 != null) + { + return value5(Value5!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + + global::System.Action? value4 = null, + + global::System.Action? value5 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + else if (IsValue5) + { + value5?.Invoke(Value5!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, + global::System.Action? value2 = null, + global::System.Action? value3 = null, + global::System.Action? value4 = null, + global::System.Action? value5 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + else if (IsValue5) + { + value5?.Invoke(Value5!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Value1, + typeof(T1), + Value2, + typeof(T2), + Value3, + typeof(T3), + Value4, + typeof(T4), + Value5, + typeof(T5), + }; + 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(OneOf other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value3, other.Value3) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value4, other.Value4) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value5, other.Value5) + ; + } + + /// + /// + /// + public static bool operator ==(OneOf obj1, OneOf obj2) + { + return global::System.Collections.Generic.EqualityComparer>.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(OneOf obj1, OneOf obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is OneOf o && Equals(o); + } + } +} diff --git a/src/libs/Descript/Generated/autosdk.generated-examples.json b/src/libs/Descript/Generated/autosdk.generated-examples.json index 56f4e74..9bcd89b 100644 --- a/src/libs/Descript/Generated/autosdk.generated-examples.json +++ b/src/libs/Descript/Generated/autosdk.generated-examples.json @@ -123,6 +123,17 @@ }, { "Order": 12, + "Title": "Search a drive", + "Slug": "search", + "Description": "Search the drive tied to the personal API token. Matches project names,\nfolder names, layout pack names, media file names, composition text,\nand transcripts across projects, the drive media library, and Brand\nStudio. Returns up to 100 results ranked by relevance.", + "Language": "csharp", + "Code": "using var client = new DescriptClient(apiKey);\n\nvar response = await client.ApiEndpoints.SearchAsync(\n query: \u0022quarterly update\u0022,\n updatedAfter: global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::System.DateTime\u003E(\n @\u0022\u0022\u00222026-08-01T00:00:00Z\u0022\u0022\u0022)!,\n updatedBefore: global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::System.DateTime\u003E(\n @\u0022\u0022\u00222026-08-31T23:59:59Z\u0022\u0022\u0022)!,\n owner: global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::System.Collections.Generic.IList\u003Cglobal::System.Guid\u003E\u003E(\n @\u0022[\n \u0022\u00223fa85f64-5717-4562-b3fc-2c963f66afa6\u0022\u0022\n]\u0022)!,\n type: global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::System.Collections.Generic.IList\u003Cglobal::Descript.SearchTypeItem\u003E\u003E(\n @\u0022[\n \u0022\u0022project\u0022\u0022,\n \u0022\u0022media_library_folder\u0022\u0022\n]\u0022)!,\n match: global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::System.Collections.Generic.IList\u003Cglobal::Descript.SearchMatchItem\u003E\u003E(\n @\u0022[\n \u0022\u0022content\u0022\u0022\n]\u0022)!,\n sort: global::Descript.SearchSort.Newest,\n limit: 30\n);\n\n// Example response:\n// {\n// \u0022results\u0022: [\n// {\n// \u0022type\u0022: \u0022image\u0022,\n// \u0022asset_id\u0022: \u00226dc3f30a-58c2-4174-96a6-dc18cf3c7776\u0022,\n// \u0022brand_studio_id\u0022: \u00227c1e2a90-4b3d-4f6a-9c8e-1a2b3c4d5e6f\u0022,\n// \u0022name\u0022: \u0022logo.png\u0022,\n// \u0022location\u0022: \u0022brand_studio\u0022,\n// \u0022owner\u0022: {\n// \u0022id\u0022: \u00223fa85f64-5717-4562-b3fc-2c963f66afa6\u0022,\n// \u0022name\u0022: \u0022Ada Lovelace\u0022\n// },\n// \u0022updated_at\u0022: \u00222026-08-12T09:30:00.000Z\u0022\n// }\n// ]\n// }", + "Format": "sdk", + "OperationId": "search", + "Setup": "This example assumes \u0060using Descript;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." + }, + { + "Order": 13, "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)", @@ -133,7 +144,7 @@ "Setup": null }, { - "Order": 13, + "Order": 14, "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 e78d21b..7beb151 100644 --- a/src/libs/Descript/openapi.yaml +++ b/src/libs/Descript/openapi.yaml @@ -2315,6 +2315,208 @@ paths: $ref: '#/components/schemas/Error404' '429': $ref: '#/components/responses/Error429Response' + /search: + get: + tags: + - API Endpoints + summary: Search a drive + description: | + Search the drive tied to the personal API token. Matches project names, + folder names, layout pack names, media file names, composition text, + and transcripts across projects, the drive media library, and Brand + Studio. Returns up to 100 results ranked by relevance. + operationId: search + security: + - bearerAuth: [] + parameters: + - in: query + name: query + description: | + Search term. Matched against names and contents. Must be non-empty. + required: true + schema: + type: string + minLength: 1 + example: quarterly update + - in: query + name: updated_after + description: | + Return results updated at or after this time. Accepts an ISO 8601 + date (`2026-08-01`, interpreted as the start of that UTC day) or + timestamp (`2026-08-01T09:30:00Z`). Values without a timezone + offset are read as UTC. + required: false + schema: + type: string + format: date-time + example: '2026-08-01T00:00:00Z' + - in: query + name: updated_before + description: | + Return results updated at or before this time. Accepts an ISO 8601 + date (`2026-08-01`, interpreted as the end of that UTC day) or + timestamp (`2026-08-01T23:59:59Z`). Values without a timezone + offset are read as UTC. + required: false + schema: + type: string + format: date-time + example: '2026-08-31T23:59:59Z' + - in: query + name: owner + description: | + Return items owned by these user UUIDs. Repeat this parameter to + include more than one owner. If omitted, results from all owners + are returned. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + format: uuid + example: + - 3fa85f64-5717-4562-b3fc-2c963f66afa6 + - in: query + name: type + description: | + Result types to search. Repeat this parameter to search more than + one type. If omitted, all result types are returned. + + - `project`: Projects + - `layout_pack`: Layout packs + - `project_folder`: Folders that hold projects + - `media_library_folder`: Folders in the drive media library + - `video`, `image`, `audio`: Files of that media type in the drive + media library, Brand Studio, and inside projects + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - project + - video + - image + - audio + - project_folder + - media_library_folder + - layout_pack + example: + - project + - media_library_folder + - in: query + name: match + description: | + How the query may match. Repeat this parameter to allow more than + one kind. `name` matches project, file, folder, and layout pack + names. `content` matches transcripts and composition text. If + omitted, names and contents both contribute. + required: false + style: form + explode: true + schema: + type: array + items: + type: string + enum: + - name + - content + example: + - content + - in: query + name: sort + description: | + How to sort results: + + - `relevance`: closest matches first. This is the default. + - `newest`: most recently modified first. + - `oldest`: least recently modified first. + required: false + schema: + type: string + enum: + - relevance + - newest + - oldest + default: relevance + example: newest + - in: query + name: limit + description: | + Maximum number of results to return. Defaults to 30. Maximum is + 100. + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 30 + example: 30 + responses: + '200': + description: Search completed successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/SearchResponse' + examples: + mixed: + summary: A project hit and a media-library file hit + value: + results: + - type: project + project_id: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb + name: Quarterly update + owner: + id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + name: Ada Lovelace + updated_at: '2026-08-15T14:00:00.000Z' + - type: video + asset_id: 6dc3f30a-58c2-4174-96a6-dc18cf3c7776 + name: standup.mp4 + location: media_library + owner: + id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + name: Ada Lovelace + updated_at: '2026-08-12T09:30:00.000Z' + duration: 184.5 + brand_studio: + summary: A media file in Brand Studio + value: + results: + - type: image + asset_id: 6dc3f30a-58c2-4174-96a6-dc18cf3c7776 + brand_studio_id: 7c1e2a90-4b3d-4f6a-9c8e-1a2b3c4d5e6f + name: logo.png + location: brand_studio + owner: + id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + name: Ada Lovelace + updated_at: '2026-08-12T09:30:00.000Z' + '400': + description: The query is missing or the token is not associated with a drive. + content: + application/json: + schema: + $ref: '#/components/schemas/Error400' + '401': + description: The personal API token is missing or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/Error401' + '404': + description: The search endpoint is not enabled for the authenticated user. + content: + application/json: + schema: + $ref: '#/components/schemas/Error404' + '429': + $ref: '#/components/responses/Error429Response' /status: get: tags: @@ -2598,6 +2800,210 @@ components: required: - error - message + SearchResponse: + type: object + description: Ranked search results. + required: + - results + properties: + results: + type: array + description: Search results ranked by relevance, best match first. + items: + oneOf: + - type: object + title: Project search result + description: A project matched. + required: + - type + - project_id + - name + - updated_at + properties: + type: + type: string + description: Always `project` for a project result. + enum: + - project + project_id: + type: string + format: uuid + description: | + ID of the project. Endpoints that take a + `project_id` accept it. + name: + type: string + description: Name of the project. + owner: + $ref: '#/components/schemas/SearchOwner' + updated_at: + type: string + format: date-time + description: | + When the project was last modified. This is the + field `updated_after` and `updated_before` filter + on. + - type: object + title: Media search result + description: | + A video, audio, or image file in the drive media library, + Brand Studio, or a project. + required: + - type + - asset_id + - name + - location + - updated_at + properties: + type: + type: string + description: | + The kind of media: `video`, `audio`, or `image`. + enum: + - video + - image + - audio + asset_id: + type: string + format: uuid + description: ID of the file. Endpoints that take an `asset_id` accept it. + project_id: + type: string + format: uuid + description: | + ID of the project that contains the file. Present + only when `location` is `project`. + brand_studio_id: + type: string + format: uuid + description: | + ID of the Brand Studio that contains the file. + Present only when `location` is `brand_studio`. + name: + type: string + description: File name of the media file. + location: + type: string + description: | + Where the file lives: `media_library` in the drive + media library, `project` inside a project, or + `brand_studio` in Brand Studio. + enum: + - media_library + - project + - brand_studio + owner: + $ref: '#/components/schemas/SearchOwner' + updated_at: + type: string + format: date-time + description: | + When the file was last modified. This is the + field `updated_after` and `updated_before` filter + on. + duration: + type: number + description: | + Playback length of the file in seconds. Omitted + for images and for files with no duration. + - type: object + title: Layout pack search result + description: A layout pack matched. + required: + - type + - project_id + - name + - updated_at + properties: + type: + type: string + description: Always `layout_pack` for a layout pack result. + enum: + - layout_pack + project_id: + type: string + format: uuid + description: ID of the layout pack. + name: + type: string + description: Name of the layout pack. + owner: + $ref: '#/components/schemas/SearchOwner' + updated_at: + type: string + format: date-time + description: | + When the layout pack was last modified. This is + the field `updated_after` and `updated_before` + filter on. + - type: object + title: Project folder search result + description: A folder that holds projects. + required: + - type + - folder_id + - name + - updated_at + properties: + type: + type: string + description: Always `project_folder`. The folder holds projects. + enum: + - project_folder + folder_id: + type: string + format: uuid + description: ID of the folder. + name: + type: string + description: Name of the folder. + owner: + $ref: '#/components/schemas/SearchOwner' + updated_at: + type: string + format: date-time + description: | + When the folder was last modified. This is the + field `updated_after` and `updated_before` filter + on. + - type: object + title: Media library folder search result + description: A folder in the drive media library. + required: + - type + - folder_id + - name + - location + - updated_at + properties: + type: + type: string + description: | + Always `media_library_folder`. The folder holds + media library files. + enum: + - media_library_folder + folder_id: + type: string + format: uuid + description: ID of the folder. + name: + type: string + description: Name of the folder. + location: + type: string + description: Always `media_library` for a media-library folder. + enum: + - media_library + owner: + $ref: '#/components/schemas/SearchOwner' + updated_at: + type: string + format: date-time + description: | + When the folder was last modified. This is the + field `updated_after` and `updated_before` filter + on. EditInDescriptSchemaPostBody: type: object properties: @@ -3338,6 +3744,20 @@ components: description: | Status of an async job. The response structure varies based on the job type. Use the `job_type` field to determine which fields will be present. + SearchOwner: + type: object + description: Owner of the search result. Omitted when the owner is unavailable. + required: + - id + - name + properties: + id: + type: string + format: uuid + description: User ID of the owner. + name: + type: string + description: Display name of the owner. responses: Error429Response: description: |