From fb71b7977f01bda70641bd3534d36ea9e46eb7fc Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 10 Jun 2026 18:12:36 +0100 Subject: [PATCH] feat: Add duplicate functionality for Wwpc imports - Implemented DuplicateRequestBuilder to handle duplication requests for Wwpc imports. - Added DuplicateAsync method in WwpcPromotionService to create a copy of a WwpcSoftware entry with a new name. - Introduced DuplicateWwpcImportDto for request body validation. - Updated WwpcImportsController to include a new endpoint for duplicating Wwpc imports. - Enhanced WwpcImportsQueue to allow duplication of entries via a dialog interface. - Created WwpcDuplicateDialog component for user input on duplicate names. - Updated kiota-lock.json and WwpcPendingDtos.cs to reflect new DTOs and service methods. --- Marechai.ApiClient/Client.cs | 6 ++ .../Models/DuplicateWwpcImportDto.cs | 65 ++++++++++++ .../Sitemap/Books/BooksRequestBuilder.cs | 41 ++++++++ .../Sitemap/Books/Ids/IdsRequestBuilder.cs | 96 ++++++++++++++++++ .../Companies/CompaniesRequestBuilder.cs | 41 ++++++++ .../Companies/Ids/IdsRequestBuilder.cs | 96 ++++++++++++++++++ .../Documents/DocumentsRequestBuilder.cs | 41 ++++++++ .../Documents/Ids/IdsRequestBuilder.cs | 96 ++++++++++++++++++ .../Sitemap/Gpus/GpusRequestBuilder.cs | 41 ++++++++ .../Sitemap/Gpus/Ids/IdsRequestBuilder.cs | 96 ++++++++++++++++++ .../Sitemap/Machines/Ids/IdsRequestBuilder.cs | 96 ++++++++++++++++++ .../Machines/MachinesRequestBuilder.cs | 41 ++++++++ .../Magazines/Ids/IdsRequestBuilder.cs | 96 ++++++++++++++++++ .../Magazines/MagazinesRequestBuilder.cs | 41 ++++++++ .../Sitemap/People/Ids/IdsRequestBuilder.cs | 96 ++++++++++++++++++ .../Sitemap/People/PeopleRequestBuilder.cs | 41 ++++++++ .../Processors/Ids/IdsRequestBuilder.cs | 96 ++++++++++++++++++ .../Processors/ProcessorsRequestBuilder.cs | 41 ++++++++ .../Sitemap/SitemapRequestBuilder.cs | 95 ++++++++++++++++++ .../Sitemap/Software/Ids/IdsRequestBuilder.cs | 96 ++++++++++++++++++ .../Software/SoftwareRequestBuilder.cs | 41 ++++++++ .../SoundSynths/Ids/IdsRequestBuilder.cs | 96 ++++++++++++++++++ .../SoundSynths/SoundSynthsRequestBuilder.cs | 41 ++++++++ .../Item/Duplicate/DuplicateRequestBuilder.cs | 98 +++++++++++++++++++ .../Pending/Item/PendingItemRequestBuilder.cs | 6 ++ Marechai.ApiClient/kiota-lock.json | 2 +- Marechai.Data/Dtos/Wwpc/WwpcPendingDtos.cs | 7 ++ .../Controllers/WwpcImportsController.cs | 14 +++ .../Services/WwpcPromotionService.cs | 79 +++++++++++++++ .../Pages/Admin/WwpcDuplicateDialog.razor | 36 +++++++ Marechai/Pages/Admin/WwpcImportsQueue.razor | 45 +++++++++ Marechai/Services/WwpcImportsService.cs | 20 ++++ 32 files changed, 1842 insertions(+), 1 deletion(-) create mode 100644 Marechai.ApiClient/Models/DuplicateWwpcImportDto.cs create mode 100644 Marechai.ApiClient/Sitemap/Books/BooksRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/Books/Ids/IdsRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/Companies/CompaniesRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/Companies/Ids/IdsRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/Documents/DocumentsRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/Documents/Ids/IdsRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/Gpus/GpusRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/Gpus/Ids/IdsRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/Machines/Ids/IdsRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/Machines/MachinesRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/Magazines/Ids/IdsRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/Magazines/MagazinesRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/People/Ids/IdsRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/People/PeopleRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/Processors/Ids/IdsRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/Processors/ProcessorsRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/SitemapRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/Software/Ids/IdsRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/Software/SoftwareRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/SoundSynths/Ids/IdsRequestBuilder.cs create mode 100644 Marechai.ApiClient/Sitemap/SoundSynths/SoundSynthsRequestBuilder.cs create mode 100644 Marechai.ApiClient/Wwpc/Pending/Item/Duplicate/DuplicateRequestBuilder.cs create mode 100644 Marechai/Pages/Admin/WwpcDuplicateDialog.razor diff --git a/Marechai.ApiClient/Client.cs b/Marechai.ApiClient/Client.cs index 34997dfe..e0f3667d 100644 --- a/Marechai.ApiClient/Client.cs +++ b/Marechai.ApiClient/Client.cs @@ -47,6 +47,7 @@ using Marechai.ApiClient.ResolutionsByScreen; using Marechai.ApiClient.Screens; using Marechai.ApiClient.ScreensByMachine; using Marechai.ApiClient.Search; +using Marechai.ApiClient.Sitemap; using Marechai.ApiClient.Smartphones; using Marechai.ApiClient.Software; using Marechai.ApiClient.SoftwarePlatformsByMachine; @@ -311,6 +312,11 @@ namespace Marechai.ApiClient { get => new global::Marechai.ApiClient.Search.SearchRequestBuilder(PathParameters, RequestAdapter); } + /// The sitemap property + public global::Marechai.ApiClient.Sitemap.SitemapRequestBuilder Sitemap + { + get => new global::Marechai.ApiClient.Sitemap.SitemapRequestBuilder(PathParameters, RequestAdapter); + } /// The smartphones property public global::Marechai.ApiClient.Smartphones.SmartphonesRequestBuilder Smartphones { diff --git a/Marechai.ApiClient/Models/DuplicateWwpcImportDto.cs b/Marechai.ApiClient/Models/DuplicateWwpcImportDto.cs new file mode 100644 index 00000000..87fe939c --- /dev/null +++ b/Marechai.ApiClient/Models/DuplicateWwpcImportDto.cs @@ -0,0 +1,65 @@ +// +#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 DuplicateWwpcImportDto : 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 newName property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? NewName { get; set; } +#nullable restore +#else + public string NewName { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DuplicateWwpcImportDto() + { + 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.DuplicateWwpcImportDto CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Marechai.ApiClient.Models.DuplicateWwpcImportDto(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "newName", n => { NewName = 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.WriteStringValue("newName", NewName); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Books/BooksRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Books/BooksRequestBuilder.cs new file mode 100644 index 00000000..8ed03350 --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Books/BooksRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Sitemap.Books.Ids; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace Marechai.ApiClient.Sitemap.Books +{ + /// + /// Builds and executes requests for operations under \sitemap\books + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class BooksRequestBuilder : BaseRequestBuilder + { + /// The ids property + public global::Marechai.ApiClient.Sitemap.Books.Ids.IdsRequestBuilder Ids + { + get => new global::Marechai.ApiClient.Sitemap.Books.Ids.IdsRequestBuilder(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 BooksRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/books", 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 BooksRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/books", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Books/Ids/IdsRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Books/Ids/IdsRequestBuilder.cs new file mode 100644 index 00000000..6d14fe76 --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Books/Ids/IdsRequestBuilder.cs @@ -0,0 +1,96 @@ +// +#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.Sitemap.Books.Ids +{ + /// + /// Builds and executes requests for operations under \sitemap\books\ids + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class IdsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public IdsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/books/ids{?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 IdsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/books/ids{?skip*,take*}", rawUrl) + { + } + /// A List<long> + /// 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.SendPrimitiveCollectionAsync(requestInfo, 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.Sitemap.Books.Ids.IdsRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.Sitemap.Books.Ids.IdsRequestBuilder(rawUrl, RequestAdapter); + } + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class IdsRequestBuilderGetQueryParameters + #pragma warning restore CS1591 + { + [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 IdsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Companies/CompaniesRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Companies/CompaniesRequestBuilder.cs new file mode 100644 index 00000000..47a95294 --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Companies/CompaniesRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Sitemap.Companies.Ids; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace Marechai.ApiClient.Sitemap.Companies +{ + /// + /// Builds and executes requests for operations under \sitemap\companies + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class CompaniesRequestBuilder : BaseRequestBuilder + { + /// The ids property + public global::Marechai.ApiClient.Sitemap.Companies.Ids.IdsRequestBuilder Ids + { + get => new global::Marechai.ApiClient.Sitemap.Companies.Ids.IdsRequestBuilder(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 CompaniesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/companies", 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 CompaniesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/companies", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Companies/Ids/IdsRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Companies/Ids/IdsRequestBuilder.cs new file mode 100644 index 00000000..ac8ab425 --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Companies/Ids/IdsRequestBuilder.cs @@ -0,0 +1,96 @@ +// +#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.Sitemap.Companies.Ids +{ + /// + /// Builds and executes requests for operations under \sitemap\companies\ids + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class IdsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public IdsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/companies/ids{?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 IdsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/companies/ids{?skip*,take*}", rawUrl) + { + } + /// A List<int> + /// 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.SendPrimitiveCollectionAsync(requestInfo, 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.Sitemap.Companies.Ids.IdsRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.Sitemap.Companies.Ids.IdsRequestBuilder(rawUrl, RequestAdapter); + } + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class IdsRequestBuilderGetQueryParameters + #pragma warning restore CS1591 + { + [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 IdsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Documents/DocumentsRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Documents/DocumentsRequestBuilder.cs new file mode 100644 index 00000000..f38aac27 --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Documents/DocumentsRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Sitemap.Documents.Ids; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace Marechai.ApiClient.Sitemap.Documents +{ + /// + /// Builds and executes requests for operations under \sitemap\documents + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DocumentsRequestBuilder : BaseRequestBuilder + { + /// The ids property + public global::Marechai.ApiClient.Sitemap.Documents.Ids.IdsRequestBuilder Ids + { + get => new global::Marechai.ApiClient.Sitemap.Documents.Ids.IdsRequestBuilder(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 DocumentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/documents", 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 DocumentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/documents", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Documents/Ids/IdsRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Documents/Ids/IdsRequestBuilder.cs new file mode 100644 index 00000000..a268d633 --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Documents/Ids/IdsRequestBuilder.cs @@ -0,0 +1,96 @@ +// +#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.Sitemap.Documents.Ids +{ + /// + /// Builds and executes requests for operations under \sitemap\documents\ids + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class IdsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public IdsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/documents/ids{?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 IdsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/documents/ids{?skip*,take*}", rawUrl) + { + } + /// A List<long> + /// 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.SendPrimitiveCollectionAsync(requestInfo, 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.Sitemap.Documents.Ids.IdsRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.Sitemap.Documents.Ids.IdsRequestBuilder(rawUrl, RequestAdapter); + } + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class IdsRequestBuilderGetQueryParameters + #pragma warning restore CS1591 + { + [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 IdsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Gpus/GpusRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Gpus/GpusRequestBuilder.cs new file mode 100644 index 00000000..d82b3a41 --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Gpus/GpusRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Sitemap.Gpus.Ids; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace Marechai.ApiClient.Sitemap.Gpus +{ + /// + /// Builds and executes requests for operations under \sitemap\gpus + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class GpusRequestBuilder : BaseRequestBuilder + { + /// The ids property + public global::Marechai.ApiClient.Sitemap.Gpus.Ids.IdsRequestBuilder Ids + { + get => new global::Marechai.ApiClient.Sitemap.Gpus.Ids.IdsRequestBuilder(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 GpusRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/gpus", 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 GpusRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/gpus", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Gpus/Ids/IdsRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Gpus/Ids/IdsRequestBuilder.cs new file mode 100644 index 00000000..16bea72a --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Gpus/Ids/IdsRequestBuilder.cs @@ -0,0 +1,96 @@ +// +#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.Sitemap.Gpus.Ids +{ + /// + /// Builds and executes requests for operations under \sitemap\gpus\ids + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class IdsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public IdsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/gpus/ids{?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 IdsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/gpus/ids{?skip*,take*}", rawUrl) + { + } + /// A List<int> + /// 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.SendPrimitiveCollectionAsync(requestInfo, 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.Sitemap.Gpus.Ids.IdsRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.Sitemap.Gpus.Ids.IdsRequestBuilder(rawUrl, RequestAdapter); + } + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class IdsRequestBuilderGetQueryParameters + #pragma warning restore CS1591 + { + [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 IdsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Machines/Ids/IdsRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Machines/Ids/IdsRequestBuilder.cs new file mode 100644 index 00000000..b730db42 --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Machines/Ids/IdsRequestBuilder.cs @@ -0,0 +1,96 @@ +// +#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.Sitemap.Machines.Ids +{ + /// + /// Builds and executes requests for operations under \sitemap\machines\ids + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class IdsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public IdsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/machines/ids{?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 IdsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/machines/ids{?skip*,take*}", rawUrl) + { + } + /// A List<int> + /// 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.SendPrimitiveCollectionAsync(requestInfo, 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.Sitemap.Machines.Ids.IdsRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.Sitemap.Machines.Ids.IdsRequestBuilder(rawUrl, RequestAdapter); + } + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class IdsRequestBuilderGetQueryParameters + #pragma warning restore CS1591 + { + [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 IdsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Machines/MachinesRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Machines/MachinesRequestBuilder.cs new file mode 100644 index 00000000..b8e0fb96 --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Machines/MachinesRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Sitemap.Machines.Ids; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace Marechai.ApiClient.Sitemap.Machines +{ + /// + /// Builds and executes requests for operations under \sitemap\machines + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class MachinesRequestBuilder : BaseRequestBuilder + { + /// The ids property + public global::Marechai.ApiClient.Sitemap.Machines.Ids.IdsRequestBuilder Ids + { + get => new global::Marechai.ApiClient.Sitemap.Machines.Ids.IdsRequestBuilder(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 MachinesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/machines", 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 MachinesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/machines", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Magazines/Ids/IdsRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Magazines/Ids/IdsRequestBuilder.cs new file mode 100644 index 00000000..ed0fae1c --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Magazines/Ids/IdsRequestBuilder.cs @@ -0,0 +1,96 @@ +// +#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.Sitemap.Magazines.Ids +{ + /// + /// Builds and executes requests for operations under \sitemap\magazines\ids + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class IdsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public IdsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/magazines/ids{?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 IdsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/magazines/ids{?skip*,take*}", rawUrl) + { + } + /// A List<long> + /// 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.SendPrimitiveCollectionAsync(requestInfo, 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.Sitemap.Magazines.Ids.IdsRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.Sitemap.Magazines.Ids.IdsRequestBuilder(rawUrl, RequestAdapter); + } + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class IdsRequestBuilderGetQueryParameters + #pragma warning restore CS1591 + { + [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 IdsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Magazines/MagazinesRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Magazines/MagazinesRequestBuilder.cs new file mode 100644 index 00000000..e159be77 --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Magazines/MagazinesRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Sitemap.Magazines.Ids; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace Marechai.ApiClient.Sitemap.Magazines +{ + /// + /// Builds and executes requests for operations under \sitemap\magazines + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class MagazinesRequestBuilder : BaseRequestBuilder + { + /// The ids property + public global::Marechai.ApiClient.Sitemap.Magazines.Ids.IdsRequestBuilder Ids + { + get => new global::Marechai.ApiClient.Sitemap.Magazines.Ids.IdsRequestBuilder(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 MagazinesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/magazines", 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 MagazinesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/magazines", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/People/Ids/IdsRequestBuilder.cs b/Marechai.ApiClient/Sitemap/People/Ids/IdsRequestBuilder.cs new file mode 100644 index 00000000..e0119399 --- /dev/null +++ b/Marechai.ApiClient/Sitemap/People/Ids/IdsRequestBuilder.cs @@ -0,0 +1,96 @@ +// +#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.Sitemap.People.Ids +{ + /// + /// Builds and executes requests for operations under \sitemap\people\ids + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class IdsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public IdsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/people/ids{?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 IdsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/people/ids{?skip*,take*}", rawUrl) + { + } + /// A List<int> + /// 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.SendPrimitiveCollectionAsync(requestInfo, 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.Sitemap.People.Ids.IdsRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.Sitemap.People.Ids.IdsRequestBuilder(rawUrl, RequestAdapter); + } + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class IdsRequestBuilderGetQueryParameters + #pragma warning restore CS1591 + { + [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 IdsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/People/PeopleRequestBuilder.cs b/Marechai.ApiClient/Sitemap/People/PeopleRequestBuilder.cs new file mode 100644 index 00000000..caee75df --- /dev/null +++ b/Marechai.ApiClient/Sitemap/People/PeopleRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Sitemap.People.Ids; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace Marechai.ApiClient.Sitemap.People +{ + /// + /// Builds and executes requests for operations under \sitemap\people + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PeopleRequestBuilder : BaseRequestBuilder + { + /// The ids property + public global::Marechai.ApiClient.Sitemap.People.Ids.IdsRequestBuilder Ids + { + get => new global::Marechai.ApiClient.Sitemap.People.Ids.IdsRequestBuilder(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 PeopleRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/people", 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 PeopleRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/people", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Processors/Ids/IdsRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Processors/Ids/IdsRequestBuilder.cs new file mode 100644 index 00000000..15f9391c --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Processors/Ids/IdsRequestBuilder.cs @@ -0,0 +1,96 @@ +// +#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.Sitemap.Processors.Ids +{ + /// + /// Builds and executes requests for operations under \sitemap\processors\ids + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class IdsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public IdsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/processors/ids{?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 IdsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/processors/ids{?skip*,take*}", rawUrl) + { + } + /// A List<int> + /// 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.SendPrimitiveCollectionAsync(requestInfo, 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.Sitemap.Processors.Ids.IdsRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.Sitemap.Processors.Ids.IdsRequestBuilder(rawUrl, RequestAdapter); + } + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class IdsRequestBuilderGetQueryParameters + #pragma warning restore CS1591 + { + [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 IdsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Processors/ProcessorsRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Processors/ProcessorsRequestBuilder.cs new file mode 100644 index 00000000..365930ab --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Processors/ProcessorsRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Sitemap.Processors.Ids; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace Marechai.ApiClient.Sitemap.Processors +{ + /// + /// Builds and executes requests for operations under \sitemap\processors + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class ProcessorsRequestBuilder : BaseRequestBuilder + { + /// The ids property + public global::Marechai.ApiClient.Sitemap.Processors.Ids.IdsRequestBuilder Ids + { + get => new global::Marechai.ApiClient.Sitemap.Processors.Ids.IdsRequestBuilder(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 ProcessorsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/processors", 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 ProcessorsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/processors", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/SitemapRequestBuilder.cs b/Marechai.ApiClient/Sitemap/SitemapRequestBuilder.cs new file mode 100644 index 00000000..51b12b96 --- /dev/null +++ b/Marechai.ApiClient/Sitemap/SitemapRequestBuilder.cs @@ -0,0 +1,95 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Sitemap.Books; +using Marechai.ApiClient.Sitemap.Companies; +using Marechai.ApiClient.Sitemap.Documents; +using Marechai.ApiClient.Sitemap.Gpus; +using Marechai.ApiClient.Sitemap.Machines; +using Marechai.ApiClient.Sitemap.Magazines; +using Marechai.ApiClient.Sitemap.People; +using Marechai.ApiClient.Sitemap.Processors; +using Marechai.ApiClient.Sitemap.Software; +using Marechai.ApiClient.Sitemap.SoundSynths; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace Marechai.ApiClient.Sitemap +{ + /// + /// Builds and executes requests for operations under \sitemap + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SitemapRequestBuilder : BaseRequestBuilder + { + /// The books property + public global::Marechai.ApiClient.Sitemap.Books.BooksRequestBuilder Books + { + get => new global::Marechai.ApiClient.Sitemap.Books.BooksRequestBuilder(PathParameters, RequestAdapter); + } + /// The companies property + public global::Marechai.ApiClient.Sitemap.Companies.CompaniesRequestBuilder Companies + { + get => new global::Marechai.ApiClient.Sitemap.Companies.CompaniesRequestBuilder(PathParameters, RequestAdapter); + } + /// The documents property + public global::Marechai.ApiClient.Sitemap.Documents.DocumentsRequestBuilder Documents + { + get => new global::Marechai.ApiClient.Sitemap.Documents.DocumentsRequestBuilder(PathParameters, RequestAdapter); + } + /// The gpus property + public global::Marechai.ApiClient.Sitemap.Gpus.GpusRequestBuilder Gpus + { + get => new global::Marechai.ApiClient.Sitemap.Gpus.GpusRequestBuilder(PathParameters, RequestAdapter); + } + /// The machines property + public global::Marechai.ApiClient.Sitemap.Machines.MachinesRequestBuilder Machines + { + get => new global::Marechai.ApiClient.Sitemap.Machines.MachinesRequestBuilder(PathParameters, RequestAdapter); + } + /// The magazines property + public global::Marechai.ApiClient.Sitemap.Magazines.MagazinesRequestBuilder Magazines + { + get => new global::Marechai.ApiClient.Sitemap.Magazines.MagazinesRequestBuilder(PathParameters, RequestAdapter); + } + /// The people property + public global::Marechai.ApiClient.Sitemap.People.PeopleRequestBuilder People + { + get => new global::Marechai.ApiClient.Sitemap.People.PeopleRequestBuilder(PathParameters, RequestAdapter); + } + /// The processors property + public global::Marechai.ApiClient.Sitemap.Processors.ProcessorsRequestBuilder Processors + { + get => new global::Marechai.ApiClient.Sitemap.Processors.ProcessorsRequestBuilder(PathParameters, RequestAdapter); + } + /// The software property + public global::Marechai.ApiClient.Sitemap.Software.SoftwareRequestBuilder Software + { + get => new global::Marechai.ApiClient.Sitemap.Software.SoftwareRequestBuilder(PathParameters, RequestAdapter); + } + /// The soundSynths property + public global::Marechai.ApiClient.Sitemap.SoundSynths.SoundSynthsRequestBuilder SoundSynths + { + get => new global::Marechai.ApiClient.Sitemap.SoundSynths.SoundSynthsRequestBuilder(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 SitemapRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap", 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 SitemapRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Software/Ids/IdsRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Software/Ids/IdsRequestBuilder.cs new file mode 100644 index 00000000..9ff0ec11 --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Software/Ids/IdsRequestBuilder.cs @@ -0,0 +1,96 @@ +// +#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.Sitemap.Software.Ids +{ + /// + /// Builds and executes requests for operations under \sitemap\software\ids + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class IdsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public IdsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/software/ids{?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 IdsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/software/ids{?skip*,take*}", rawUrl) + { + } + /// A List<int> + /// 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.SendPrimitiveCollectionAsync(requestInfo, 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.Sitemap.Software.Ids.IdsRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.Sitemap.Software.Ids.IdsRequestBuilder(rawUrl, RequestAdapter); + } + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class IdsRequestBuilderGetQueryParameters + #pragma warning restore CS1591 + { + [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 IdsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/Software/SoftwareRequestBuilder.cs b/Marechai.ApiClient/Sitemap/Software/SoftwareRequestBuilder.cs new file mode 100644 index 00000000..71697135 --- /dev/null +++ b/Marechai.ApiClient/Sitemap/Software/SoftwareRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Sitemap.Software.Ids; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace Marechai.ApiClient.Sitemap.Software +{ + /// + /// Builds and executes requests for operations under \sitemap\software + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SoftwareRequestBuilder : BaseRequestBuilder + { + /// The ids property + public global::Marechai.ApiClient.Sitemap.Software.Ids.IdsRequestBuilder Ids + { + get => new global::Marechai.ApiClient.Sitemap.Software.Ids.IdsRequestBuilder(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 SoftwareRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/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}/sitemap/software", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/SoundSynths/Ids/IdsRequestBuilder.cs b/Marechai.ApiClient/Sitemap/SoundSynths/Ids/IdsRequestBuilder.cs new file mode 100644 index 00000000..5ea1e0dd --- /dev/null +++ b/Marechai.ApiClient/Sitemap/SoundSynths/Ids/IdsRequestBuilder.cs @@ -0,0 +1,96 @@ +// +#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.Sitemap.SoundSynths.Ids +{ + /// + /// Builds and executes requests for operations under \sitemap\sound-synths\ids + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class IdsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public IdsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/sound-synths/ids{?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 IdsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/sound-synths/ids{?skip*,take*}", rawUrl) + { + } + /// A List<int> + /// 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.SendPrimitiveCollectionAsync(requestInfo, 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.Sitemap.SoundSynths.Ids.IdsRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.Sitemap.SoundSynths.Ids.IdsRequestBuilder(rawUrl, RequestAdapter); + } + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class IdsRequestBuilderGetQueryParameters + #pragma warning restore CS1591 + { + [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 IdsRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Sitemap/SoundSynths/SoundSynthsRequestBuilder.cs b/Marechai.ApiClient/Sitemap/SoundSynths/SoundSynthsRequestBuilder.cs new file mode 100644 index 00000000..f7f6b405 --- /dev/null +++ b/Marechai.ApiClient/Sitemap/SoundSynths/SoundSynthsRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using Marechai.ApiClient.Sitemap.SoundSynths.Ids; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace Marechai.ApiClient.Sitemap.SoundSynths +{ + /// + /// Builds and executes requests for operations under \sitemap\sound-synths + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class SoundSynthsRequestBuilder : BaseRequestBuilder + { + /// The ids property + public global::Marechai.ApiClient.Sitemap.SoundSynths.Ids.IdsRequestBuilder Ids + { + get => new global::Marechai.ApiClient.Sitemap.SoundSynths.Ids.IdsRequestBuilder(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 SoundSynthsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/sound-synths", 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 SoundSynthsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/sitemap/sound-synths", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Wwpc/Pending/Item/Duplicate/DuplicateRequestBuilder.cs b/Marechai.ApiClient/Wwpc/Pending/Item/Duplicate/DuplicateRequestBuilder.cs new file mode 100644 index 00000000..64acbdf3 --- /dev/null +++ b/Marechai.ApiClient/Wwpc/Pending/Item/Duplicate/DuplicateRequestBuilder.cs @@ -0,0 +1,98 @@ +// +#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.Wwpc.Pending.Item.Duplicate +{ + /// + /// Builds and executes requests for operations under \wwpc\pending\{id}\duplicate + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class DuplicateRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DuplicateRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/wwpc/pending/{id}/duplicate", 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 DuplicateRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/wwpc/pending/{id}/duplicate", rawUrl) + { + } + /// 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 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::Marechai.ApiClient.Models.DuplicateWwpcImportDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::Marechai.ApiClient.Models.DuplicateWwpcImportDto 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 }, + { "404", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// 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.DuplicateWwpcImportDto body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::Marechai.ApiClient.Models.DuplicateWwpcImportDto 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.Wwpc.Pending.Item.Duplicate.DuplicateRequestBuilder WithUrl(string rawUrl) + { + return new global::Marechai.ApiClient.Wwpc.Pending.Item.Duplicate.DuplicateRequestBuilder(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 DuplicateRequestBuilderPostRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/Marechai.ApiClient/Wwpc/Pending/Item/PendingItemRequestBuilder.cs b/Marechai.ApiClient/Wwpc/Pending/Item/PendingItemRequestBuilder.cs index 40232be8..c74688fa 100644 --- a/Marechai.ApiClient/Wwpc/Pending/Item/PendingItemRequestBuilder.cs +++ b/Marechai.ApiClient/Wwpc/Pending/Item/PendingItemRequestBuilder.cs @@ -3,6 +3,7 @@ using Marechai.ApiClient.Models; using Marechai.ApiClient.Wwpc.Pending.Item.Accept; using Marechai.ApiClient.Wwpc.Pending.Item.Discard; +using Marechai.ApiClient.Wwpc.Pending.Item.Duplicate; using Marechai.ApiClient.Wwpc.Pending.Item.NameMatches; using Marechai.ApiClient.Wwpc.Pending.Item.Skip; using Marechai.ApiClient.Wwpc.Pending.Item.VendorMatches; @@ -32,6 +33,11 @@ namespace Marechai.ApiClient.Wwpc.Pending.Item { get => new global::Marechai.ApiClient.Wwpc.Pending.Item.Discard.DiscardRequestBuilder(PathParameters, RequestAdapter); } + /// The duplicate property + public global::Marechai.ApiClient.Wwpc.Pending.Item.Duplicate.DuplicateRequestBuilder Duplicate + { + get => new global::Marechai.ApiClient.Wwpc.Pending.Item.Duplicate.DuplicateRequestBuilder(PathParameters, RequestAdapter); + } /// The nameMatches property public global::Marechai.ApiClient.Wwpc.Pending.Item.NameMatches.NameMatchesRequestBuilder NameMatches { diff --git a/Marechai.ApiClient/kiota-lock.json b/Marechai.ApiClient/kiota-lock.json index 852f9f47..5cf9def9 100644 --- a/Marechai.ApiClient/kiota-lock.json +++ b/Marechai.ApiClient/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "E2CB5CED26A518E9B9E8E510F1AB55A78E596BA526A02678C35E6F7A0574D857BA2E012456CEB440F167055B97A10AC7616BDDE7321B4717618662F25848B3DD", + "descriptionHash": "B6F0BB0EB38886F67B647D9CC0ACC2E32AE03D820AAA285630B57CD527C3E8D3674A7DCC35FE4F3DF1DC034D25F5ADCAF630DEBD031EA2E7715C32006E3A069E", "descriptionLocation": "../../../../../tmp/openapi.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.31.1", diff --git a/Marechai.Data/Dtos/Wwpc/WwpcPendingDtos.cs b/Marechai.Data/Dtos/Wwpc/WwpcPendingDtos.cs index 42a86813..cda214c0 100644 --- a/Marechai.Data/Dtos/Wwpc/WwpcPendingDtos.cs +++ b/Marechai.Data/Dtos/Wwpc/WwpcPendingDtos.cs @@ -152,3 +152,10 @@ public class AcceptWwpcImportResultDto public int InsertedDescriptionCount { get; set; } public int InsertedGenreCount { get; set; } } + +public class DuplicateWwpcImportDto +{ + [Required] + [StringLength(512, MinimumLength = 1)] + public string NewName { get; set; } +} diff --git a/Marechai.Server/Controllers/WwpcImportsController.cs b/Marechai.Server/Controllers/WwpcImportsController.cs index e04bf957..9a5c7bfa 100644 --- a/Marechai.Server/Controllers/WwpcImportsController.cs +++ b/Marechai.Server/Controllers/WwpcImportsController.cs @@ -219,6 +219,20 @@ public class WwpcImportsController(MarechaiContext context, WwpcPromotionService return ok ? NoContent() : NotFound(); } + [HttpPost("pending/{id:long}/duplicate")] + [ProducesResponseType(typeof(long), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + public async Task> DuplicateAsync(long id, [FromBody] DuplicateWwpcImportDto dto) + { + if(!ModelState.IsValid) + return Problem(detail: "A name is required.", statusCode: StatusCodes.Status400BadRequest); + + long? newId = await promotion.DuplicateAsync(id, dto.NewName); + if(newId == null) return NotFound(); + return Ok(newId.Value); + } + static WwpcPendingDetailDto Map(WwpcSoftware s) => new() { Id = s.Id, diff --git a/Marechai.Server/Services/WwpcPromotionService.cs b/Marechai.Server/Services/WwpcPromotionService.cs index d28b43ce..73c0027b 100644 --- a/Marechai.Server/Services/WwpcPromotionService.cs +++ b/Marechai.Server/Services/WwpcPromotionService.cs @@ -479,6 +479,85 @@ public sealed class WwpcPromotionService return true; } + /// + /// Duplicates a staging entry (including its child versions and + /// screenshots) so that an admin can split one WinWorldPC product page into multiple Marechai + /// software entities. The clone gets the supplied , status + /// , and all review/promotion fields cleared. + /// SourceUrl gets a #dup-{timestamp} fragment appended to satisfy the unique + /// index. Screenshot SourceUrls likewise get a unique suffix. + /// + public async Task DuplicateAsync(long id, string newName) + { + WwpcSoftware source = await _db.WwpcSoftwares + .Include(s => s.Versions) + .Include(s => s.Screenshots) + .FirstOrDefaultAsync(s => s.Id == id); + if(source == null) return null; + + string suffix = $"#dup-{DateTime.UtcNow.Ticks}"; + + var clone = new WwpcSoftware + { + SourceUrl = source.SourceUrl + suffix, + Slug = source.Slug, + Status = WwpcSoftwareStatus.ReadyForReview, + ProductType = source.ProductType, + Name = newName, + VendorName = source.VendorName, + VendorUrl = source.VendorUrl, + RawCategoriesCsv = source.RawCategoriesCsv, + PlatformsCsv = source.PlatformsCsv, + ReleaseDateText = source.ReleaseDateText, + UserInterface = source.UserInterface, + RawDescription = source.RawDescription, + EnglishDescriptionMuseum = source.EnglishDescriptionMuseum, + MuseumDescriptionPromptVersion = source.MuseumDescriptionPromptVersion, + SuggestedGenreIdsJson = source.SuggestedGenreIdsJson, + SuggestedVendorCompanyId = source.SuggestedVendorCompanyId, + WwpcCategoryId = source.WwpcCategoryId, + CrawledOn = source.CrawledOn + }; + + _db.WwpcSoftwares.Add(clone); + await _db.SaveChangesAsync(); + + foreach(WwpcVersion v in source.Versions) + { + _db.WwpcVersions.Add(new WwpcVersion + { + WwpcSoftwareId = clone.Id, + MajorRelease = v.MajorRelease, + MajorReleaseUrl = v.MajorReleaseUrl, + VersionString = v.VersionString, + Language = v.Language, + Architecture = v.Architecture, + MediaKind = v.MediaKind, + SizeText = v.SizeText, + DownloadUrl = v.DownloadUrl, + IsEnabledByDefault = true + }); + } + + foreach(WwpcScreenshot s in source.Screenshots) + { + _db.WwpcScreenshots.Add(new WwpcScreenshot + { + WwpcSoftwareId = clone.Id, + MajorRelease = s.MajorRelease, + SourceUrl = s.SourceUrl + suffix, + ImageUrl = s.ImageUrl, + Caption = s.Caption, + SuggestedSoftwarePlatformId = s.SuggestedSoftwarePlatformId, + IsEnabledByDefault = true, + CrawledOn = s.CrawledOn + }); + } + + await _db.SaveChangesAsync(); + return clone.Id; + } + /// /// Render the museum-grade markdown to HTML via Markdig with the same advanced-extensions /// pipeline used by and friends. diff --git a/Marechai/Pages/Admin/WwpcDuplicateDialog.razor b/Marechai/Pages/Admin/WwpcDuplicateDialog.razor new file mode 100644 index 00000000..97f90378 --- /dev/null +++ b/Marechai/Pages/Admin/WwpcDuplicateDialog.razor @@ -0,0 +1,36 @@ +@using MudBlazor +@using Marechai.Services + +@inject IStringLocalizer L + + + + @ContentText + + + + @L["Cancel"] + @L["Duplicate"] + + + +@code { + [CascadingParameter] + IMudDialogInstance MudDialog { get; set; } = null!; + + [Parameter] + public string ContentText { get; set; } = string.Empty; + + [Parameter] + public string DefaultName { get; set; } = string.Empty; + + string _name = string.Empty; + + protected override void OnParametersSet() => _name = DefaultName; + + void Cancel() => MudDialog.Cancel(); + void Confirm() => MudDialog.Close(DialogResult.Ok(_name)); +} diff --git a/Marechai/Pages/Admin/WwpcImportsQueue.razor b/Marechai/Pages/Admin/WwpcImportsQueue.razor index c636660f..89b54c6f 100644 --- a/Marechai/Pages/Admin/WwpcImportsQueue.razor +++ b/Marechai/Pages/Admin/WwpcImportsQueue.razor @@ -128,6 +128,15 @@ @L["Open on winworldpc.com"] } + @if(StatusOf(context.Item) is WwpcSoftwareStatus.ReadyForReview or WwpcSoftwareStatus.Skipped) + { + + + + } + @if(StatusOf(context.Item) is not WwpcSoftwareStatus.Discarded and not WwpcSoftwareStatus.Accepted) { @@ -243,6 +252,42 @@ } } + async Task DuplicateAsync(WwpcPendingListItemDto item) + { + string defaultName = $"{item.Name} (Dup)"; + + var parameters = new DialogParameters + { + ["ContentText"] = string.Format( + L["Create a copy of '{0}' with a new name. You can then review each copy separately and pick which versions belong to each."].Value, + item.Name), + ["DefaultName"] = defaultName + }; + IDialogReference dialog = + await DialogService.ShowAsync(L["Duplicate WinWorldPC import"], parameters, + new DialogOptions + { + MaxWidth = MaxWidth.Small, + FullWidth = true + }); + DialogResult result = await dialog.Result; + if(result is null or { Canceled: true }) return; + + string newName = result.Data as string; + if(string.IsNullOrWhiteSpace(newName)) return; + + (long? newId, string error) = await Service.DuplicateAsync(item.Id ?? 0, newName); + if(newId.HasValue) + { + Snackbar.Add(string.Format(L["Duplicated as '{0}' (id {1})."].Value, newName, newId.Value), Severity.Success); + await ReloadAsync(); + } + else + { + Snackbar.Add(string.Format(L["Failed to duplicate: {0}"].Value, error ?? "unknown"), Severity.Error); + } + } + static WwpcSoftwareStatus StatusOf(WwpcPendingListItemDto i) => i.Status.HasValue ? (WwpcSoftwareStatus)i.Status.Value : WwpcSoftwareStatus.Crawled; diff --git a/Marechai/Services/WwpcImportsService.cs b/Marechai/Services/WwpcImportsService.cs index 4a30a7ec..35e7680c 100644 --- a/Marechai/Services/WwpcImportsService.cs +++ b/Marechai/Services/WwpcImportsService.cs @@ -196,4 +196,24 @@ public sealed class WwpcImportsService(Client client, ILogger DuplicateAsync(long id, string newName) + { + try + { + long? newId = await client.Wwpc.Pending[(int)id].Duplicate.PostAsync( + new DuplicateWwpcImportDto { NewName = newName }); + return (newId, null); + } + catch(ApiException ex) + { + logger.LogWarning(ex, "Server rejected duplicate for wwpc #{Id}", id); + return (null, ExtractDetail(ex)); + } + catch(System.Exception ex) + { + logger.LogError(ex, "Error duplicating wwpc #{Id}", id); + return (null, ex.Message); + } + } }