From effa7b67918a68e3b6b9ddf0ff5ddc0c8b2afe61 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Fri, 26 Jun 2026 04:54:35 +0100 Subject: [PATCH] feat: Complete software compilation refactor across client, UI, and importer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Continues the prior commit (model/migrations/server) by finishing every remaining consumer of the SoftwareCompilation entity introduced there. - Regenerate Marechai.ApiClient from the updated OpenAPI schema: new SoftwareCompilations request builders and DTOs (SoftwareCompilationDto, SoftwareCompilationSuccessorDto, SoftwareBySoftwareCompilationDto, SoftwareVersionBySoftwareCompilationDto), SoftwareReleaseDto's IsCompilation replaced with SoftwareCompilationId/ SoftwareCompilation. Commit the openapi.yaml snapshot used to drive the regeneration. - Marechai (Blazor): add SoftwareCompilationsService and a full admin UI for the new entity (SoftwareCompilations grid + SoftwareCompilationDialog with bundled-software/machine pickers, predecessor/relationship type, and tabs for included software, included versions, sub-compilations, and releases) plus a public detail page at /software-compilation/{id}. SoftwareReleaseDialog drops the old IsCompilation checkbox and per-release included-items management in favor of a SoftwareCompilation autocomplete picker, since compilation membership now lives on the compilation entity itself rather than on individual releases. Updated every remaining IsCompilation/old-junction-DTO reference in release dialogs, the public release/software view pages, and the suggestion dialog. Search.razor now routes compilation rows to /software-compilation/{id} instead of a release. - Marechai.App (Uno): mechanical fixes for the removed IsCompilation property and old junction DTOs, and the same scope cut as the Blazor app — included-items management removed from the release editor and read-only release view (that UI now belongs solely on the compilation), with the now-dead helper methods and XAML sections removed. - Marechai.MobyGames: CompilationRelationService and ImportService now create a real SoftwareCompilation row instead of flipping a release flag, and resolve each contained slug to either a Software or an existing SoftwareCompilation. This fixes a long-standing bug where a slug previously converted into a compilation had no replacement pointer recorded on MobyGamesImportState, so re-encountering it as a nested member of another compilation could never resolve. Nested compilations are now linked via SoftwareCompilationBySoftwareCompilation. StateService.MarkImportedAsync gained a softwareCompilationId parameter, and OrphanCleanupService's software-merge dedup pass was re-keyed from the old release-keyed junction to SoftwareBySoftwareCompilation. Full solution build is clean with no pending EF model changes against the three migrations from the prior commit. --- Marechai.ApiClient/Client.cs | 6 + .../SoftwareBySoftwareCompilationDto.cs | 73 + .../Models/SoftwareCompilationDto.cs | 129 + .../Models/SoftwareCompilationSuccessorDto.cs | 73 + .../Models/SoftwareReleaseDto.cs | 18 +- ...SoftwareVersionBySoftwareCompilationDto.cs | 83 + .../Count/CountRequestBuilder.cs | 100 + .../CompilationsRequestBuilder.cs | 113 + .../Item/WithChildItemRequestBuilder.cs | 141 + .../Item/Covers/CoversRequestBuilder.cs | 87 + .../Item/WithSoftwareItemRequestBuilder.cs | 93 + .../Item/Software/SoftwareRequestBuilder.cs | 166 + .../SoftwareCompilationsItemRequestBuilder.cs | 215 + .../Item/WithVersionItemRequestBuilder.cs | 93 + .../Item/Versions/VersionsRequestBuilder.cs | 166 + .../SoftwareCompilationsRequestBuilder.cs | 189 + Marechai.ApiClient/kiota-lock.json | 2 +- .../Admin/AdminSoftwareReleasesViewModel.cs | 202 +- .../SoftwareReleaseViewViewModel.cs | 25 +- .../Admin/AdminSoftwareReleasesPage.xaml | 38 - .../Admin/AdminSoftwareReleasesPage.xaml.cs | 5 - .../Views/SoftwareReleaseViewPage.xaml | 25 - .../Services/SoftwareBrowsingService.cs | 34 - .../Services/SoftwareReleasesService.cs | 57 - .../Services/CompilationRelationService.cs | 155 +- Marechai.MobyGames/Services/ImportService.cs | 110 +- .../Services/OrphanCleanupService.cs | 13 +- .../Services/SpecsReparseService.cs | 2 +- Marechai.MobyGames/Services/StateService.cs | 26 +- .../Admin/SoftwareCompilationDialog.razor | 417 + .../Admin/SoftwareCompilationDialogResult.cs | 10 + .../Pages/Admin/SoftwareCompilations.razor | 57 + .../Pages/Admin/SoftwareCompilations.razor.cs | 181 + .../SoftwareReleaseBulkCreateDialog.razor | 1 - .../Pages/Admin/SoftwareReleaseDialog.razor | 248 +- .../Admin/SoftwareReleaseDialogResult.cs | 2 +- .../Admin/SoftwareReleaseImportDialog.razor | 39 +- .../Pages/Admin/SoftwareReleases.razor.cs | 10 +- Marechai/Pages/Software/ReleaseView.razor | 44 +- Marechai/Pages/Software/ReleaseView.razor.cs | 10 +- Marechai/Pages/Software/Search.razor | 2 +- Marechai/Pages/Software/View.razor | 2 +- .../Pages/SoftwareCompilations/View.razor | 132 + .../Pages/SoftwareCompilations/View.razor.cs | 37 + .../SoftwareReleaseSuggestionDialog.razor | 2 +- Marechai/Services/Register.cs | 1 + .../Services/SoftwareCompilationsService.cs | 338 + Marechai/Services/SoftwareReleasesService.cs | 106 - Marechai/Services/SoftwareService.cs | 30 - Marechai/Shared/AdminNavMenu.razor | 1 + openapi.yaml | 74489 ++++++++++++++++ 51 files changed, 77686 insertions(+), 912 deletions(-) create mode 100644 Marechai.ApiClient/Models/SoftwareBySoftwareCompilationDto.cs create mode 100644 Marechai.ApiClient/Models/SoftwareCompilationDto.cs create mode 100644 Marechai.ApiClient/Models/SoftwareCompilationSuccessorDto.cs create mode 100644 Marechai.ApiClient/Models/SoftwareVersionBySoftwareCompilationDto.cs create mode 100644 Marechai.ApiClient/SoftwareCompilations/Count/CountRequestBuilder.cs create mode 100644 Marechai.ApiClient/SoftwareCompilations/Item/Compilations/CompilationsRequestBuilder.cs create mode 100644 Marechai.ApiClient/SoftwareCompilations/Item/Compilations/Item/WithChildItemRequestBuilder.cs create mode 100644 Marechai.ApiClient/SoftwareCompilations/Item/Covers/CoversRequestBuilder.cs create mode 100644 Marechai.ApiClient/SoftwareCompilations/Item/Software/Item/WithSoftwareItemRequestBuilder.cs create mode 100644 Marechai.ApiClient/SoftwareCompilations/Item/Software/SoftwareRequestBuilder.cs create mode 100644 Marechai.ApiClient/SoftwareCompilations/Item/SoftwareCompilationsItemRequestBuilder.cs create mode 100644 Marechai.ApiClient/SoftwareCompilations/Item/Versions/Item/WithVersionItemRequestBuilder.cs create mode 100644 Marechai.ApiClient/SoftwareCompilations/Item/Versions/VersionsRequestBuilder.cs create mode 100644 Marechai.ApiClient/SoftwareCompilations/SoftwareCompilationsRequestBuilder.cs create mode 100644 Marechai/Pages/Admin/SoftwareCompilationDialog.razor create mode 100644 Marechai/Pages/Admin/SoftwareCompilationDialogResult.cs create mode 100644 Marechai/Pages/Admin/SoftwareCompilations.razor create mode 100644 Marechai/Pages/Admin/SoftwareCompilations.razor.cs create mode 100644 Marechai/Pages/SoftwareCompilations/View.razor create mode 100644 Marechai/Pages/SoftwareCompilations/View.razor.cs create mode 100644 Marechai/Services/SoftwareCompilationsService.cs create mode 100644 openapi.yaml diff --git a/Marechai.ApiClient/Client.cs b/Marechai.ApiClient/Client.cs index 23ec6d85..118526dd 100644 --- a/Marechai.ApiClient/Client.cs +++ b/Marechai.ApiClient/Client.cs @@ -50,6 +50,7 @@ using Marechai.ApiClient.Search; using Marechai.ApiClient.Sitemap; using Marechai.ApiClient.Smartphones; using Marechai.ApiClient.Software; +using Marechai.ApiClient.SoftwareCompilations; using Marechai.ApiClient.SoftwarePlatformsByMachine; using Marechai.ApiClient.SoundSynths; using Marechai.ApiClient.SoundSynthsByMachine; @@ -327,6 +328,11 @@ namespace Marechai.ApiClient { get => new global::Marechai.ApiClient.Software.SoftwareRequestBuilder(PathParameters, RequestAdapter); } + /// The softwareCompilations property + public global::Marechai.ApiClient.SoftwareCompilations.SoftwareCompilationsRequestBuilder SoftwareCompilations + { + get => new global::Marechai.ApiClient.SoftwareCompilations.SoftwareCompilationsRequestBuilder(PathParameters, RequestAdapter); + } /// The softwarePlatformsByMachine property public global::Marechai.ApiClient.SoftwarePlatformsByMachine.SoftwarePlatformsByMachineRequestBuilder SoftwarePlatformsByMachine { diff --git a/Marechai.ApiClient/Models/SoftwareBySoftwareCompilationDto.cs b/Marechai.ApiClient/Models/SoftwareBySoftwareCompilationDto.cs new file mode 100644 index 00000000..236d1ced --- /dev/null +++ b/Marechai.ApiClient/Models/SoftwareBySoftwareCompilationDto.cs @@ -0,0 +1,73 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace Marechai.ApiClient.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SoftwareBySoftwareCompilationDto : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The software_compilation_id property + public int? SoftwareCompilationId { get; set; } + /// The software_id property + public int? SoftwareId { get; set; } + /// The software_name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SoftwareName { get; set; } +#nullable restore +#else + public string SoftwareName { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SoftwareBySoftwareCompilationDto() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::Marechai.ApiClient.Models.SoftwareBySoftwareCompilationDto CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Marechai.ApiClient.Models.SoftwareBySoftwareCompilationDto(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "software_compilation_id", n => { SoftwareCompilationId = n.GetIntValue(); } }, + { "software_id", n => { SoftwareId = n.GetIntValue(); } }, + { "software_name", n => { SoftwareName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("software_compilation_id", SoftwareCompilationId); + writer.WriteIntValue("software_id", SoftwareId); + writer.WriteStringValue("software_name", SoftwareName); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Models/SoftwareCompilationDto.cs b/Marechai.ApiClient/Models/SoftwareCompilationDto.cs new file mode 100644 index 00000000..a2012680 --- /dev/null +++ b/Marechai.ApiClient/Models/SoftwareCompilationDto.cs @@ -0,0 +1,129 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace Marechai.ApiClient.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SoftwareCompilationDto : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The front_cover_id property + public Guid? FrontCoverId { get; set; } + /// The id property + public int? Id { get; set; } + /// The machine property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Machine { get; set; } +#nullable restore +#else + public string Machine { get; set; } +#endif + /// The machine_id property + public int? MachineId { get; set; } + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The predecessor property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Predecessor { get; set; } +#nullable restore +#else + public string Predecessor { get; set; } +#endif + /// The predecessor_id property + public int? PredecessorId { get; set; } + /// The relationship_type property + public int? RelationshipType { get; set; } + /// The software property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Software { get; set; } +#nullable restore +#else + public string Software { get; set; } +#endif + /// The software_id property + public int? SoftwareId { get; set; } + /// The successors property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Successors { get; set; } +#nullable restore +#else + public List Successors { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SoftwareCompilationDto() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::Marechai.ApiClient.Models.SoftwareCompilationDto CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Marechai.ApiClient.Models.SoftwareCompilationDto(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "front_cover_id", n => { FrontCoverId = n.GetGuidValue(); } }, + { "id", n => { Id = n.GetIntValue(); } }, + { "machine", n => { Machine = n.GetStringValue(); } }, + { "machine_id", n => { MachineId = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "predecessor", n => { Predecessor = n.GetStringValue(); } }, + { "predecessor_id", n => { PredecessorId = n.GetIntValue(); } }, + { "relationship_type", n => { RelationshipType = n.GetIntValue(); } }, + { "software", n => { Software = n.GetStringValue(); } }, + { "software_id", n => { SoftwareId = n.GetIntValue(); } }, + { "successors", n => { Successors = n.GetCollectionOfObjectValues(global::Marechai.ApiClient.Models.SoftwareCompilationSuccessorDto.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("front_cover_id", FrontCoverId); + writer.WriteIntValue("id", Id); + writer.WriteStringValue("machine", Machine); + writer.WriteIntValue("machine_id", MachineId); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("predecessor", Predecessor); + writer.WriteIntValue("predecessor_id", PredecessorId); + writer.WriteIntValue("relationship_type", RelationshipType); + writer.WriteStringValue("software", Software); + writer.WriteIntValue("software_id", SoftwareId); + writer.WriteCollectionOfObjectValues("successors", Successors); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Models/SoftwareCompilationSuccessorDto.cs b/Marechai.ApiClient/Models/SoftwareCompilationSuccessorDto.cs new file mode 100644 index 00000000..4162de70 --- /dev/null +++ b/Marechai.ApiClient/Models/SoftwareCompilationSuccessorDto.cs @@ -0,0 +1,73 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace Marechai.ApiClient.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SoftwareCompilationSuccessorDto : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The id property + public int? Id { get; set; } + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The relationship_type property + public int? RelationshipType { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public SoftwareCompilationSuccessorDto() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::Marechai.ApiClient.Models.SoftwareCompilationSuccessorDto CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Marechai.ApiClient.Models.SoftwareCompilationSuccessorDto(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "relationship_type", n => { RelationshipType = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("id", Id); + writer.WriteStringValue("name", Name); + writer.WriteIntValue("relationship_type", RelationshipType); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Models/SoftwareReleaseDto.cs b/Marechai.ApiClient/Models/SoftwareReleaseDto.cs index 27ab4368..01384f2f 100644 --- a/Marechai.ApiClient/Models/SoftwareReleaseDto.cs +++ b/Marechai.ApiClient/Models/SoftwareReleaseDto.cs @@ -16,8 +16,6 @@ namespace Marechai.ApiClient.Models public IDictionary AdditionalData { get; set; } /// The id property public int? Id { get; set; } - /// The is_compilation property - public bool? IsCompilation { get; set; } /// The languages property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -66,6 +64,16 @@ namespace Marechai.ApiClient.Models #else public string Software { get; set; } #endif + /// The software_compilation property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SoftwareCompilation { get; set; } +#nullable restore +#else + public string SoftwareCompilation { get; set; } +#endif + /// The software_compilation_id property + public int? SoftwareCompilationId { get; set; } /// The software_id property public int? SoftwareId { get; set; } /// The software_version property @@ -112,7 +120,6 @@ namespace Marechai.ApiClient.Models return new Dictionary> { { "id", n => { Id = n.GetIntValue(); } }, - { "is_compilation", n => { IsCompilation = n.GetBoolValue(); } }, { "languages", n => { Languages = n.GetCollectionOfObjectValues(global::Marechai.ApiClient.Models.LanguageBySoftwareReleaseDto.CreateFromDiscriminatorValue)?.AsList(); } }, { "platform", n => { Platform = n.GetStringValue(); } }, { "platform_id", n => { PlatformId = n.GetIntValue(); } }, @@ -122,6 +129,8 @@ namespace Marechai.ApiClient.Models { "release_date", n => { ReleaseDate = n.GetDateTimeOffsetValue(); } }, { "release_date_precision", n => { ReleaseDatePrecision = n.GetIntValue(); } }, { "software", n => { Software = n.GetStringValue(); } }, + { "software_compilation", n => { SoftwareCompilation = n.GetStringValue(); } }, + { "software_compilation_id", n => { SoftwareCompilationId = n.GetIntValue(); } }, { "software_id", n => { SoftwareId = n.GetIntValue(); } }, { "software_version", n => { SoftwareVersion = n.GetStringValue(); } }, { "software_version_id", n => { SoftwareVersionId = n.GetIntValue(); } }, @@ -136,7 +145,6 @@ namespace Marechai.ApiClient.Models { if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); writer.WriteIntValue("id", Id); - writer.WriteBoolValue("is_compilation", IsCompilation); writer.WriteCollectionOfObjectValues("languages", Languages); writer.WriteStringValue("platform", Platform); writer.WriteIntValue("platform_id", PlatformId); @@ -146,6 +154,8 @@ namespace Marechai.ApiClient.Models writer.WriteDateTimeOffsetValue("release_date", ReleaseDate); writer.WriteIntValue("release_date_precision", ReleaseDatePrecision); writer.WriteStringValue("software", Software); + writer.WriteStringValue("software_compilation", SoftwareCompilation); + writer.WriteIntValue("software_compilation_id", SoftwareCompilationId); writer.WriteIntValue("software_id", SoftwareId); writer.WriteStringValue("software_version", SoftwareVersion); writer.WriteIntValue("software_version_id", SoftwareVersionId); diff --git a/Marechai.ApiClient/Models/SoftwareVersionBySoftwareCompilationDto.cs b/Marechai.ApiClient/Models/SoftwareVersionBySoftwareCompilationDto.cs new file mode 100644 index 00000000..b72d338c --- /dev/null +++ b/Marechai.ApiClient/Models/SoftwareVersionBySoftwareCompilationDto.cs @@ -0,0 +1,83 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace Marechai.ApiClient.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SoftwareVersionBySoftwareCompilationDto : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The software_compilation_id property + public int? SoftwareCompilationId { get; set; } + /// The software_name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SoftwareName { get; set; } +#nullable restore +#else + public string SoftwareName { get; set; } +#endif + /// The software_version property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SoftwareVersion { get; set; } +#nullable restore +#else + public string SoftwareVersion { get; set; } +#endif + /// The software_version_id property + public int? SoftwareVersionId { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public SoftwareVersionBySoftwareCompilationDto() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::Marechai.ApiClient.Models.SoftwareVersionBySoftwareCompilationDto CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Marechai.ApiClient.Models.SoftwareVersionBySoftwareCompilationDto(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "software_compilation_id", n => { SoftwareCompilationId = n.GetIntValue(); } }, + { "software_name", n => { SoftwareName = n.GetStringValue(); } }, + { "software_version", n => { SoftwareVersion = n.GetStringValue(); } }, + { "software_version_id", n => { SoftwareVersionId = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("software_compilation_id", SoftwareCompilationId); + writer.WriteStringValue("software_name", SoftwareName); + writer.WriteStringValue("software_version", SoftwareVersion); + writer.WriteIntValue("software_version_id", SoftwareVersionId); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/SoftwareCompilations/Count/CountRequestBuilder.cs b/Marechai.ApiClient/SoftwareCompilations/Count/CountRequestBuilder.cs new file mode 100644 index 00000000..ced4a167 --- /dev/null +++ b/Marechai.ApiClient/SoftwareCompilations/Count/CountRequestBuilder.cs @@ -0,0 +1,100 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Marechai.ApiClient.SoftwareCompilations.Count +{ + /// + /// Builds and executes requests for operations under \software-compilations\count + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CountRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CountRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/count{?search*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CountRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/count{?search*}", rawUrl) + { + } + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::Marechai.ApiClient.SoftwareCompilations.Count.CountRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.SoftwareCompilations.Count.CountRequestBuilder(rawUrl, RequestAdapter); + } + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class CountRequestBuilderGetQueryParameters + #pragma warning restore CS1591 + { +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("search")] + public string Search { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CountRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/SoftwareCompilations/Item/Compilations/CompilationsRequestBuilder.cs b/Marechai.ApiClient/SoftwareCompilations/Item/Compilations/CompilationsRequestBuilder.cs new file mode 100644 index 00000000..302504d9 --- /dev/null +++ b/Marechai.ApiClient/SoftwareCompilations/Item/Compilations/CompilationsRequestBuilder.cs @@ -0,0 +1,113 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Models; +using Marechai.ApiClient.SoftwareCompilations.Item.Compilations.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Marechai.ApiClient.SoftwareCompilations.Item.Compilations +{ + /// + /// Builds and executes requests for operations under \software-compilations\{id}\compilations + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CompilationsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the Marechai.ApiClient.softwareCompilations.item.compilations.item collection + /// Unique identifier of the item + /// A + public global::Marechai.ApiClient.SoftwareCompilations.Item.Compilations.Item.WithChildItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("childId", position); + return new global::Marechai.ApiClient.SoftwareCompilations.Item.Compilations.Item.WithChildItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the Marechai.ApiClient.softwareCompilations.item.compilations.item collection + /// Unique identifier of the item + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::Marechai.ApiClient.SoftwareCompilations.Item.Compilations.Item.WithChildItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("childId", position); + return new global::Marechai.ApiClient.SoftwareCompilations.Item.Compilations.Item.WithChildItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CompilationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}/compilations", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CompilationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}/compilations", rawUrl) + { + } + /// A List<global::Marechai.ApiClient.Models.SoftwareCompilationDto> + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, global::Marechai.ApiClient.Models.SoftwareCompilationDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.AsList(); + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::Marechai.ApiClient.SoftwareCompilations.Item.Compilations.CompilationsRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.SoftwareCompilations.Item.Compilations.CompilationsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CompilationsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/SoftwareCompilations/Item/Compilations/Item/WithChildItemRequestBuilder.cs b/Marechai.ApiClient/SoftwareCompilations/Item/Compilations/Item/WithChildItemRequestBuilder.cs new file mode 100644 index 00000000..d1e8e31d --- /dev/null +++ b/Marechai.ApiClient/SoftwareCompilations/Item/Compilations/Item/WithChildItemRequestBuilder.cs @@ -0,0 +1,141 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Marechai.ApiClient.SoftwareCompilations.Item.Compilations.Item +{ + /// + /// Builds and executes requests for operations under \software-compilations\{id}\compilations\{childId} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithChildItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithChildItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}/compilations/{childId}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithChildItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}/compilations/{childId}", rawUrl) + { + } + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "401", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9"); + return requestInfo; + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::Marechai.ApiClient.SoftwareCompilations.Item.Compilations.Item.WithChildItemRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.SoftwareCompilations.Item.Compilations.Item.WithChildItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithChildItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithChildItemRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/SoftwareCompilations/Item/Covers/CoversRequestBuilder.cs b/Marechai.ApiClient/SoftwareCompilations/Item/Covers/CoversRequestBuilder.cs new file mode 100644 index 00000000..be0f86ea --- /dev/null +++ b/Marechai.ApiClient/SoftwareCompilations/Item/Covers/CoversRequestBuilder.cs @@ -0,0 +1,87 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Marechai.ApiClient.SoftwareCompilations.Item.Covers +{ + /// + /// Builds and executes requests for operations under \software-compilations\{id}\covers + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CoversRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CoversRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}/covers", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CoversRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}/covers", rawUrl) + { + } + /// A List<global::Marechai.ApiClient.Models.SoftwareCoverDto> + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, global::Marechai.ApiClient.Models.SoftwareCoverDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.AsList(); + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::Marechai.ApiClient.SoftwareCompilations.Item.Covers.CoversRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.SoftwareCompilations.Item.Covers.CoversRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CoversRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/SoftwareCompilations/Item/Software/Item/WithSoftwareItemRequestBuilder.cs b/Marechai.ApiClient/SoftwareCompilations/Item/Software/Item/WithSoftwareItemRequestBuilder.cs new file mode 100644 index 00000000..33188d30 --- /dev/null +++ b/Marechai.ApiClient/SoftwareCompilations/Item/Software/Item/WithSoftwareItemRequestBuilder.cs @@ -0,0 +1,93 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Marechai.ApiClient.SoftwareCompilations.Item.Software.Item +{ + /// + /// Builds and executes requests for operations under \software-compilations\{id}\software\{softwareId} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSoftwareItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithSoftwareItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}/software/{softwareId}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithSoftwareItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}/software/{softwareId}", rawUrl) + { + } + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::Marechai.ApiClient.SoftwareCompilations.Item.Software.Item.WithSoftwareItemRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.SoftwareCompilations.Item.Software.Item.WithSoftwareItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithSoftwareItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/SoftwareCompilations/Item/Software/SoftwareRequestBuilder.cs b/Marechai.ApiClient/SoftwareCompilations/Item/Software/SoftwareRequestBuilder.cs new file mode 100644 index 00000000..a1d081fb --- /dev/null +++ b/Marechai.ApiClient/SoftwareCompilations/Item/Software/SoftwareRequestBuilder.cs @@ -0,0 +1,166 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Models; +using Marechai.ApiClient.SoftwareCompilations.Item.Software.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Marechai.ApiClient.SoftwareCompilations.Item.Software +{ + /// + /// Builds and executes requests for operations under \software-compilations\{id}\software + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SoftwareRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the Marechai.ApiClient.softwareCompilations.item.software.item collection + /// Unique identifier of the item + /// A + public global::Marechai.ApiClient.SoftwareCompilations.Item.Software.Item.WithSoftwareItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("softwareId", position); + return new global::Marechai.ApiClient.SoftwareCompilations.Item.Software.Item.WithSoftwareItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the Marechai.ApiClient.softwareCompilations.item.software.item collection + /// Unique identifier of the item + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::Marechai.ApiClient.SoftwareCompilations.Item.Software.Item.WithSoftwareItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("softwareId", position); + return new global::Marechai.ApiClient.SoftwareCompilations.Item.Software.Item.WithSoftwareItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SoftwareRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}/software", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SoftwareRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}/software", rawUrl) + { + } + /// A List<global::Marechai.ApiClient.Models.SoftwareBySoftwareCompilationDto> + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, global::Marechai.ApiClient.Models.SoftwareBySoftwareCompilationDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.AsList(); + } + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::Marechai.ApiClient.Models.SoftwareBySoftwareCompilationDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::Marechai.ApiClient.Models.SoftwareBySoftwareCompilationDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "401", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::Marechai.ApiClient.Models.SoftwareBySoftwareCompilationDto body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::Marechai.ApiClient.Models.SoftwareBySoftwareCompilationDto body, Action> requestConfiguration = default) + { +#endif + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::Marechai.ApiClient.SoftwareCompilations.Item.Software.SoftwareRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.SoftwareCompilations.Item.Software.SoftwareRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SoftwareRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SoftwareRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/SoftwareCompilations/Item/SoftwareCompilationsItemRequestBuilder.cs b/Marechai.ApiClient/SoftwareCompilations/Item/SoftwareCompilationsItemRequestBuilder.cs new file mode 100644 index 00000000..a128593c --- /dev/null +++ b/Marechai.ApiClient/SoftwareCompilations/Item/SoftwareCompilationsItemRequestBuilder.cs @@ -0,0 +1,215 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Models; +using Marechai.ApiClient.SoftwareCompilations.Item.Compilations; +using Marechai.ApiClient.SoftwareCompilations.Item.Covers; +using Marechai.ApiClient.SoftwareCompilations.Item.Releases; +using Marechai.ApiClient.SoftwareCompilations.Item.Software; +using Marechai.ApiClient.SoftwareCompilations.Item.Versions; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Marechai.ApiClient.SoftwareCompilations.Item +{ + /// + /// Builds and executes requests for operations under \software-compilations\{id} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SoftwareCompilationsItemRequestBuilder : BaseRequestBuilder + { + /// The compilations property + public global::Marechai.ApiClient.SoftwareCompilations.Item.Compilations.CompilationsRequestBuilder Compilations + { + get => new global::Marechai.ApiClient.SoftwareCompilations.Item.Compilations.CompilationsRequestBuilder(PathParameters, RequestAdapter); + } + /// The covers property + public global::Marechai.ApiClient.SoftwareCompilations.Item.Covers.CoversRequestBuilder Covers + { + get => new global::Marechai.ApiClient.SoftwareCompilations.Item.Covers.CoversRequestBuilder(PathParameters, RequestAdapter); + } + /// The releases property + public global::Marechai.ApiClient.SoftwareCompilations.Item.Releases.ReleasesRequestBuilder Releases + { + get => new global::Marechai.ApiClient.SoftwareCompilations.Item.Releases.ReleasesRequestBuilder(PathParameters, RequestAdapter); + } + /// The software property + public global::Marechai.ApiClient.SoftwareCompilations.Item.Software.SoftwareRequestBuilder Software + { + get => new global::Marechai.ApiClient.SoftwareCompilations.Item.Software.SoftwareRequestBuilder(PathParameters, RequestAdapter); + } + /// The versions property + public global::Marechai.ApiClient.SoftwareCompilations.Item.Versions.VersionsRequestBuilder Versions + { + get => new global::Marechai.ApiClient.SoftwareCompilations.Item.Versions.VersionsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SoftwareCompilationsItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SoftwareCompilationsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}", rawUrl) + { + } + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, global::Marechai.ApiClient.Models.SoftwareCompilationDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PutAsync(global::Marechai.ApiClient.Models.SoftwareCompilationDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PutAsync(global::Marechai.ApiClient.Models.SoftwareCompilationDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPutRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "401", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9"); + return requestInfo; + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9"); + return requestInfo; + } + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(global::Marechai.ApiClient.Models.SoftwareCompilationDto body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(global::Marechai.ApiClient.Models.SoftwareCompilationDto body, Action> requestConfiguration = default) + { +#endif + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::Marechai.ApiClient.SoftwareCompilations.Item.SoftwareCompilationsItemRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.SoftwareCompilations.Item.SoftwareCompilationsItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SoftwareCompilationsItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SoftwareCompilationsItemRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SoftwareCompilationsItemRequestBuilderPutRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/SoftwareCompilations/Item/Versions/Item/WithVersionItemRequestBuilder.cs b/Marechai.ApiClient/SoftwareCompilations/Item/Versions/Item/WithVersionItemRequestBuilder.cs new file mode 100644 index 00000000..ed1b24cb --- /dev/null +++ b/Marechai.ApiClient/SoftwareCompilations/Item/Versions/Item/WithVersionItemRequestBuilder.cs @@ -0,0 +1,93 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Marechai.ApiClient.SoftwareCompilations.Item.Versions.Item +{ + /// + /// Builds and executes requests for operations under \software-compilations\{id}\versions\{versionId} + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVersionItemRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithVersionItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}/versions/{versionId}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithVersionItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}/versions/{versionId}", rawUrl) + { + } + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 401 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "401", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::Marechai.ApiClient.SoftwareCompilations.Item.Versions.Item.WithVersionItemRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.SoftwareCompilations.Item.Versions.Item.WithVersionItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class WithVersionItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/SoftwareCompilations/Item/Versions/VersionsRequestBuilder.cs b/Marechai.ApiClient/SoftwareCompilations/Item/Versions/VersionsRequestBuilder.cs new file mode 100644 index 00000000..abc684a2 --- /dev/null +++ b/Marechai.ApiClient/SoftwareCompilations/Item/Versions/VersionsRequestBuilder.cs @@ -0,0 +1,166 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Models; +using Marechai.ApiClient.SoftwareCompilations.Item.Versions.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Marechai.ApiClient.SoftwareCompilations.Item.Versions +{ + /// + /// Builds and executes requests for operations under \software-compilations\{id}\versions + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VersionsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the Marechai.ApiClient.softwareCompilations.item.versions.item collection + /// Unique identifier of the item + /// A + public global::Marechai.ApiClient.SoftwareCompilations.Item.Versions.Item.WithVersionItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("versionId", position); + return new global::Marechai.ApiClient.SoftwareCompilations.Item.Versions.Item.WithVersionItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the Marechai.ApiClient.softwareCompilations.item.versions.item collection + /// Unique identifier of the item + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::Marechai.ApiClient.SoftwareCompilations.Item.Versions.Item.WithVersionItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("versionId", position); + return new global::Marechai.ApiClient.SoftwareCompilations.Item.Versions.Item.WithVersionItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public VersionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}/versions", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public VersionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations/{id}/versions", rawUrl) + { + } + /// A List<global::Marechai.ApiClient.Models.SoftwareVersionBySoftwareCompilationDto> + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, global::Marechai.ApiClient.Models.SoftwareVersionBySoftwareCompilationDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.AsList(); + } + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::Marechai.ApiClient.Models.SoftwareVersionBySoftwareCompilationDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::Marechai.ApiClient.Models.SoftwareVersionBySoftwareCompilationDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "401", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::Marechai.ApiClient.Models.SoftwareVersionBySoftwareCompilationDto body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::Marechai.ApiClient.Models.SoftwareVersionBySoftwareCompilationDto body, Action> requestConfiguration = default) + { +#endif + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::Marechai.ApiClient.SoftwareCompilations.Item.Versions.VersionsRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.SoftwareCompilations.Item.Versions.VersionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VersionsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class VersionsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/SoftwareCompilations/SoftwareCompilationsRequestBuilder.cs b/Marechai.ApiClient/SoftwareCompilations/SoftwareCompilationsRequestBuilder.cs new file mode 100644 index 00000000..f5863cb9 --- /dev/null +++ b/Marechai.ApiClient/SoftwareCompilations/SoftwareCompilationsRequestBuilder.cs @@ -0,0 +1,189 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Models; +using Marechai.ApiClient.SoftwareCompilations.Count; +using Marechai.ApiClient.SoftwareCompilations.Item; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Marechai.ApiClient.SoftwareCompilations +{ + /// + /// Builds and executes requests for operations under \software-compilations + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SoftwareCompilationsRequestBuilder : BaseRequestBuilder + { + /// The count property + public global::Marechai.ApiClient.SoftwareCompilations.Count.CountRequestBuilder Count + { + get => new global::Marechai.ApiClient.SoftwareCompilations.Count.CountRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Marechai.ApiClient.softwareCompilations.item collection + /// Unique identifier of the item + /// A + public global::Marechai.ApiClient.SoftwareCompilations.Item.SoftwareCompilationsItemRequestBuilder this[int position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("id", position); + return new global::Marechai.ApiClient.SoftwareCompilations.Item.SoftwareCompilationsItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// Gets an item from the Marechai.ApiClient.softwareCompilations.item collection + /// Unique identifier of the item + /// A + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public global::Marechai.ApiClient.SoftwareCompilations.Item.SoftwareCompilationsItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("id", position); + return new global::Marechai.ApiClient.SoftwareCompilations.Item.SoftwareCompilationsItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SoftwareCompilationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations{?search*,skip*,take*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SoftwareCompilationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/software-compilations{?search*,skip*,take*}", rawUrl) + { + } + /// A List<global::Marechai.ApiClient.Models.SoftwareCompilationDto> + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, global::Marechai.ApiClient.Models.SoftwareCompilationDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.AsList(); + } + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 401 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::Marechai.ApiClient.Models.SoftwareCompilationDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::Marechai.ApiClient.Models.SoftwareCompilationDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + { "401", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::Marechai.ApiClient.Models.SoftwareCompilationDto body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::Marechai.ApiClient.Models.SoftwareCompilationDto body, Action> requestConfiguration = default) + { +#endif + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::Marechai.ApiClient.SoftwareCompilations.SoftwareCompilationsRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.SoftwareCompilations.SoftwareCompilationsRequestBuilder(rawUrl, RequestAdapter); + } + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class SoftwareCompilationsRequestBuilderGetQueryParameters + #pragma warning restore CS1591 + { +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("search")] + public string Search { get; set; } +#endif + [QueryParameter("skip")] + public int? Skip { get; set; } + [QueryParameter("take")] + public int? Take { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SoftwareCompilationsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SoftwareCompilationsRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/kiota-lock.json b/Marechai.ApiClient/kiota-lock.json index 9030b1c8..20efba2f 100644 --- a/Marechai.ApiClient/kiota-lock.json +++ b/Marechai.ApiClient/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "B073097511A9F1609FF417BA45DD7A9A405EF7A5C8F1CEFD47572B6FDB30C675C9706104B1C0ABC22DA1A6645EA7B1BDC8A3394B7A7A31AC53AE9476420DDACF", + "descriptionHash": "3D337767FA6373F382CEEACB98C9C3E789A760131EC1A4FE918AF9F2725263B2A9EEC893480759A7E4CA0D820AD5ECE7CE4D55A983E77ADF51B62E457D423397", "descriptionLocation": "../openapi.yaml", "lockFileVersion": "1.0.0", "kiotaVersion": "1.31.1", diff --git a/Marechai.App/Presentation/ViewModels/Admin/AdminSoftwareReleasesViewModel.cs b/Marechai.App/Presentation/ViewModels/Admin/AdminSoftwareReleasesViewModel.cs index c63325d4..1ae4b654 100644 --- a/Marechai.App/Presentation/ViewModels/Admin/AdminSoftwareReleasesViewModel.cs +++ b/Marechai.App/Presentation/ViewModels/Admin/AdminSoftwareReleasesViewModel.cs @@ -94,21 +94,11 @@ public partial class AdminSoftwareReleasesViewModel : ObservableObject, IRegionA [ObservableProperty] private string _soundSynthSearchText = string.Empty; [ObservableProperty] private ObservableCollection _soundSynthSuggestions = []; - // Compilation support + // Compilation support: a release may belong to a SoftwareCompilation, but + // compilation membership (included software/versions) is managed on the + // compilation itself, not on individual releases. [ObservableProperty] private string _title = string.Empty; [ObservableProperty] private bool _isCompilation; - [ObservableProperty] private ObservableCollection _includedVersions = []; - [ObservableProperty] private ObservableCollection _includedVersionDisplays = []; - [ObservableProperty] private SoftwareVersionDto? _selectedIncludedVersion; - [ObservableProperty] private string _includedVersionSearchText = string.Empty; - [ObservableProperty] private ObservableCollection _includedVersionSuggestions = []; - - // Versionless compilation support - [ObservableProperty] private ObservableCollection _includedSoftware = []; - [ObservableProperty] private ObservableCollection _includedSoftwareDisplays = []; - [ObservableProperty] private SoftwareDto? _selectedIncludedSoftware; - [ObservableProperty] private string _includedSoftwareSearchText = string.Empty; - [ObservableProperty] private ObservableCollection _includedSoftwareSuggestions = []; // Software picker for single releases [ObservableProperty] private SoftwareDto? _selectedSoftware; @@ -117,6 +107,7 @@ public partial class AdminSoftwareReleasesViewModel : ObservableObject, IRegionA private List? _allSoftware; private int? _editingId; + private int? _editingCompilationId; private List? _allReleases; private List? _allVersions; private List? _allPlatforms; @@ -161,8 +152,6 @@ public partial class AdminSoftwareReleasesViewModel : ObservableObject, IRegionA RemoveRecommendedGpuCommand = new AsyncRelayCommand(RemoveRecommendedGpuByDisplayAsync); AddSoundSynthCommand = new AsyncRelayCommand(AddSoundSynthAsync); RemoveSoundSynthCommand = new AsyncRelayCommand(RemoveSoundSynthByDisplayAsync); - AddIncludedVersionCommand = new AsyncRelayCommand(AddIncludedVersionAsync); - RemoveIncludedVersionCommand = new AsyncRelayCommand(RemoveIncludedVersionByDisplayAsync); AddRegionCommand = new AsyncRelayCommand(AddRegionAsync); RemoveRegionCommand = new AsyncRelayCommand(RemoveRegionByDisplayAsync); AddLanguageCommand = new AsyncRelayCommand(AddLanguageAsync); @@ -188,8 +177,6 @@ public partial class AdminSoftwareReleasesViewModel : ObservableObject, IRegionA public IAsyncRelayCommand RemoveRecommendedGpuCommand { get; } public IAsyncRelayCommand AddSoundSynthCommand { get; } public IAsyncRelayCommand RemoveSoundSynthCommand { get; } - public IAsyncRelayCommand AddIncludedVersionCommand { get; } - public IAsyncRelayCommand RemoveIncludedVersionCommand { get; } public IAsyncRelayCommand AddRegionCommand { get; } public IAsyncRelayCommand RemoveRegionCommand { get; } public IAsyncRelayCommand AddLanguageCommand { get; } @@ -311,7 +298,8 @@ public partial class AdminSoftwareReleasesViewModel : ObservableObject, IRegionA ReleaseDate = item.ReleaseDate; ReleaseDatePrecision = item.ReleaseDatePrecision ?? 0; Title = item.Title ?? string.Empty; - IsCompilation = item.IsCompilation == true; + IsCompilation = item.SoftwareCompilationId is not null; + _editingCompilationId = item.SoftwareCompilationId; // Version picker if(item.SoftwareVersionId.HasValue && _allVersions != null) @@ -373,12 +361,6 @@ public partial class AdminSoftwareReleasesViewModel : ObservableObject, IRegionA await LoadSoundSynthsAsync(item.Id.Value); await LoadReleaseRegionsAsync(item.Id.Value); await LoadReleaseLanguagesAsync(item.Id.Value); - - if(IsCompilation) - { - await LoadIncludedVersionsAsync(item.Id.Value); - await LoadIncludedSoftwareAsync(item.Id.Value); - } } } @@ -406,7 +388,7 @@ public partial class AdminSoftwareReleasesViewModel : ObservableObject, IRegionA var dto = new SoftwareReleaseDto { Title = string.IsNullOrWhiteSpace(Title) ? null : Title, - IsCompilation = IsCompilation, + SoftwareCompilationId = IsCompilation ? _editingCompilationId : null, SoftwareId = IsCompilation ? null : SelectedSoftware?.Id, SoftwareVersionId = IsCompilation ? null : SelectedVersion?.Id, PlatformId = SelectedPlatform?.Id, @@ -994,180 +976,12 @@ public partial class AdminSoftwareReleasesViewModel : ObservableObject, IRegionA SoundSynthSearchText = string.Empty; Title = string.Empty; IsCompilation = false; - IncludedVersions.Clear(); - IncludedVersionDisplays.Clear(); - SelectedIncludedVersion = null; - IncludedVersionSearchText = string.Empty; - IncludedSoftware.Clear(); - IncludedSoftwareDisplays.Clear(); - SelectedIncludedSoftware = null; - IncludedSoftwareSearchText = string.Empty; + _editingCompilationId = null; SelectedSoftware = null; SoftwareSearchText = string.Empty; HasError = false; ErrorMessage = string.Empty; } - // ── Included Version management (compilations only) ── - - public void UpdateIncludedVersionSuggestions(string query) - { - IncludedVersionSuggestions.Clear(); - if(_allVersions == null) return; - IEnumerable source = _allVersions; - if(!string.IsNullOrWhiteSpace(query)) - source = source.Where(v => - (v.VersionString != null && v.VersionString.Contains(query, StringComparison.OrdinalIgnoreCase)) || - (v.Software != null && v.Software.Contains(query, StringComparison.OrdinalIgnoreCase))); - foreach(SoftwareVersionDto match in source) IncludedVersionSuggestions.Add(match); - } - - private async Task LoadIncludedVersionsAsync(int releaseId) - { - IncludedVersions.Clear(); - IncludedVersionDisplays.Clear(); - - try - { - List items = await _service.GetIncludedVersionsAsync(releaseId); - - foreach(SoftwareVersionBySoftwareReleaseDto item in items) - { - IncludedVersions.Add(item); - IncludedVersionDisplays.Add($"{item.SoftwareName} — {item.SoftwareVersion}"); - } - } - catch(Exception ex) - { - _logger.LogError(ex, "Error loading included versions for release {ReleaseId}", releaseId); - } - } - - private async Task AddIncludedVersionAsync() - { - if(SelectedIncludedVersion?.Id == null || _editingId == null) return; - - try - { - var dto = new SoftwareVersionBySoftwareReleaseDto - { - ReleaseId = _editingId.Value, - SoftwareVersionId = SelectedIncludedVersion.Id - }; - - await _service.AddIncludedVersionAsync(dto); - await LoadIncludedVersionsAsync(_editingId.Value); - SelectedIncludedVersion = null; - IncludedVersionSearchText = string.Empty; - } - catch(Exception ex) - { - _logger.LogError(ex, "Error adding included version"); - ErrorMessage = _localizer["FailedToAddIncludedVersion"]; - HasError = true; - } - } - - private async Task RemoveIncludedVersionByDisplayAsync(string? display) - { - if(display == null || _editingId == null) return; - int idx = IncludedVersionDisplays.IndexOf(display); - if(idx < 0 || idx >= IncludedVersions.Count) return; - - SoftwareVersionBySoftwareReleaseDto iv = IncludedVersions[idx]; - - try - { - await _service.RemoveIncludedVersionAsync(_editingId.Value, (int)(iv.SoftwareVersionId ?? 0)); - await LoadIncludedVersionsAsync(_editingId.Value); - } - catch(Exception ex) - { - _logger.LogError(ex, "Error removing included version"); - ErrorMessage = _localizer["FailedToRemoveIncludedVersion"]; - HasError = true; - } - } - - // --- Versionless compilation included software --- - - private async Task LoadIncludedSoftwareAsync(int releaseId) - { - IncludedSoftware.Clear(); - IncludedSoftwareDisplays.Clear(); - - try - { - List items = await _service.GetIncludedSoftwareAsync(releaseId); - - foreach(SoftwareBySoftwareReleaseDto item in items) - { - IncludedSoftware.Add(item); - IncludedSoftwareDisplays.Add(item.SoftwareName ?? string.Empty); - } - } - catch(Exception ex) - { - _logger.LogError(ex, "Error loading included software for release {ReleaseId}", releaseId); - } - } - - private async Task AddIncludedSoftwareAsync() - { - if(SelectedIncludedSoftware?.Id == null || _editingId == null) return; - - try - { - var dto = new SoftwareBySoftwareReleaseDto - { - ReleaseId = _editingId.Value, - SoftwareId = SelectedIncludedSoftware.Id - }; - - await _service.AddIncludedSoftwareAsync(dto); - await LoadIncludedSoftwareAsync(_editingId.Value); - SelectedIncludedSoftware = null; - IncludedSoftwareSearchText = string.Empty; - } - catch(Exception ex) - { - _logger.LogError(ex, "Error adding included software"); - ErrorMessage = _localizer["FailedToAddIncludedSoftware"]; - HasError = true; - } - } - - private async Task RemoveIncludedSoftwareByDisplayAsync(string? display) - { - if(display == null || _editingId == null) return; - int idx = IncludedSoftwareDisplays.IndexOf(display); - if(idx < 0 || idx >= IncludedSoftware.Count) return; - - SoftwareBySoftwareReleaseDto sw = IncludedSoftware[idx]; - - try - { - await _service.RemoveIncludedSoftwareAsync(_editingId.Value, (int)(sw.SoftwareId ?? 0)); - await LoadIncludedSoftwareAsync(_editingId.Value); - } - catch(Exception ex) - { - _logger.LogError(ex, "Error removing included software"); - ErrorMessage = _localizer["FailedToRemoveIncludedSoftware"]; - HasError = true; - } - } - - private void UpdateIncludedSoftwareSuggestions(string query) - { - IncludedSoftwareSuggestions.Clear(); - if(_allSoftware == null) return; - IEnumerable source = _allSoftware; - if(!string.IsNullOrWhiteSpace(query)) - source = source.Where(s => - s.Name != null && s.Name.Contains(query, StringComparison.OrdinalIgnoreCase)); - foreach(SoftwareDto match in source) IncludedSoftwareSuggestions.Add(match); - } - private void UpdateSoftwareSuggestions(string query) { SoftwareSuggestions.Clear(); diff --git a/Marechai.App/Presentation/ViewModels/SoftwareReleaseViewViewModel.cs b/Marechai.App/Presentation/ViewModels/SoftwareReleaseViewViewModel.cs index 34b6683d..2c19fd31 100644 --- a/Marechai.App/Presentation/ViewModels/SoftwareReleaseViewViewModel.cs +++ b/Marechai.App/Presentation/ViewModels/SoftwareReleaseViewViewModel.cs @@ -92,9 +92,6 @@ public partial class SoftwareReleaseViewViewModel : ObservableObject, IRegionAwa [ObservableProperty] private Visibility _showCompanies = Visibility.Collapsed; - [ObservableProperty] - private Visibility _showIncludedVersions = Visibility.Collapsed; - [ObservableProperty] private bool _isCompilation; @@ -112,7 +109,6 @@ public partial class SoftwareReleaseViewViewModel : ObservableObject, IRegionAwa public ObservableCollection Barcodes { get; } = []; public ObservableCollection ProductCodes { get; } = []; public ObservableCollection Companies { get; } = []; - public ObservableCollection IncludedVersions { get; } = []; public bool IsNavigationTarget(NavigationContext navigationContext) => false; @@ -161,7 +157,6 @@ public partial class SoftwareReleaseViewViewModel : ObservableObject, IRegionAwa Barcodes.Clear(); ProductCodes.Clear(); Companies.Clear(); - IncludedVersions.Clear(); SoftwareReleaseDto? release = await _browsingService.GetReleaseByIdAsync(releaseId); @@ -188,26 +183,13 @@ public partial class SoftwareReleaseViewViewModel : ObservableObject, IRegionAwa ReleaseDateDisplay = (release.ReleaseDatePrecision ?? 0) == 2 ? $"{release.ReleaseDate.Value.Year}" : (release.ReleaseDatePrecision ?? 0) == 1 ? release.ReleaseDate.Value.ToString("MMMM yyyy") : release.ReleaseDate.Value.DateTime.ToString("MMMM d, yyyy"); // Determine if this is a compilation - IsCompilation = release.IsCompilation == true; + IsCompilation = release.SoftwareCompilationId is not null; if(IsCompilation) { - // Compilation: use Title or fallback + // Compilation: use Title or fallback. Included software/versions are + // managed and displayed on the compilation's own page, not here. ReleaseTitle = release.Title ?? _localizer["Compilation"]; - - // Load included versions (versioned compilations) - List includedVersions = - await _browsingService.GetIncludedVersionsAsync(releaseId); - - foreach(SoftwareVersionBySoftwareReleaseDto iv in includedVersions) - IncludedVersions.Add($"{iv.SoftwareName} — {iv.SoftwareVersion}"); - - // Load included software (versionless compilations) - List includedSoftware = - await _browsingService.GetIncludedSoftwareAsync(releaseId); - - foreach(SoftwareBySoftwareReleaseDto sw in includedSoftware) - IncludedVersions.Add(sw.SoftwareName ?? string.Empty); } else { @@ -277,7 +259,6 @@ public partial class SoftwareReleaseViewViewModel : ObservableObject, IRegionAwa ShowBarcodes = Barcodes.Count > 0 ? Visibility.Visible : Visibility.Collapsed; ShowProductCodes = ProductCodes.Count > 0 ? Visibility.Visible : Visibility.Collapsed; ShowCompanies = Companies.Count > 0 ? Visibility.Visible : Visibility.Collapsed; - ShowIncludedVersions = IncludedVersions.Count > 0 ? Visibility.Visible : Visibility.Collapsed; } private async Task LoadAllCompaniesAsync(SoftwareReleaseDto release) diff --git a/Marechai.App/Presentation/Views/Admin/AdminSoftwareReleasesPage.xaml b/Marechai.App/Presentation/Views/Admin/AdminSoftwareReleasesPage.xaml index 86c02816..509ad8cc 100644 --- a/Marechai.App/Presentation/Views/Admin/AdminSoftwareReleasesPage.xaml +++ b/Marechai.App/Presentation/Views/Admin/AdminSoftwareReleasesPage.xaml @@ -76,9 +76,6 @@ - - - - - - - - - - - -