mirror of
https://github.com/claunia/marechai.git
synced 2026-07-08 17:57:08 +00:00
Add PDA functionality and localization support
- Implemented the Search component for PDAs with infinite scrolling. - Created a new PdasService to handle API interactions for fetching PDAs and their counts. - Added localization resources for German, Spanish, French, and Italian languages. - Included methods for retrieving PDAs by letter and year, as well as fetching prototypes. - Enhanced error handling in service methods to ensure robustness.
This commit is contained in:
@@ -30,6 +30,7 @@ using Marechai.ApiClient.Medias;
|
||||
using Marechai.ApiClient.MemoriesByMachine;
|
||||
using Marechai.ApiClient.Messages;
|
||||
using Marechai.ApiClient.News;
|
||||
using Marechai.ApiClient.Pdas;
|
||||
using Marechai.ApiClient.People;
|
||||
using Marechai.ApiClient.PeopleByBook;
|
||||
using Marechai.ApiClient.PeopleByCompany;
|
||||
@@ -222,6 +223,11 @@ namespace Marechai.ApiClient
|
||||
{
|
||||
get => new global::Marechai.ApiClient.News.NewsRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>The pdas property</summary>
|
||||
public global::Marechai.ApiClient.Pdas.PdasRequestBuilder Pdas
|
||||
{
|
||||
get => new global::Marechai.ApiClient.Pdas.PdasRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>The people property</summary>
|
||||
public global::Marechai.ApiClient.People.PeopleRequestBuilder People
|
||||
{
|
||||
|
||||
48
Marechai.ApiClient/Pdas/ByLetter/ByLetterRequestBuilder.cs
Normal file
48
Marechai.ApiClient/Pdas/ByLetter/ByLetterRequestBuilder.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using Marechai.ApiClient.Pdas.ByLetter.Item;
|
||||
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.Pdas.ByLetter
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \pdas\by-letter
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class ByLetterRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>Gets an item from the Marechai.ApiClient.pdas.byLetter.item collection</summary>
|
||||
/// <param name="position">Unique identifier of the item</param>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.ByLetter.Item.WithCItemRequestBuilder"/></returns>
|
||||
public global::Marechai.ApiClient.Pdas.ByLetter.Item.WithCItemRequestBuilder this[string position]
|
||||
{
|
||||
get
|
||||
{
|
||||
var urlTplParams = new Dictionary<string, object>(PathParameters);
|
||||
urlTplParams.Add("c", position);
|
||||
return new global::Marechai.ApiClient.Pdas.ByLetter.Item.WithCItemRequestBuilder(urlTplParams, RequestAdapter);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.ByLetter.ByLetterRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public ByLetterRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/by-letter", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.ByLetter.ByLetterRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public ByLetterRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/by-letter", rawUrl)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,91 @@
|
||||
// <auto-generated/>
|
||||
#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.Pdas.ByLetter.Item.Count
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \pdas\by-letter\{c}\count
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class CountRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.ByLetter.Item.Count.CountRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public CountRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/by-letter/{c}/count", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.ByLetter.Item.Count.CountRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public CountRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/by-letter/{c}/count", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A <see cref="int"/></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
/// <exception cref="global::Marechai.ApiClient.Models.ProblemDetails">When receiving a 400 status code</exception>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
|
||||
{
|
||||
{ "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue },
|
||||
};
|
||||
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> 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;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.ByLetter.Item.Count.CountRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::Marechai.ApiClient.Pdas.ByLetter.Item.Count.CountRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::Marechai.ApiClient.Pdas.ByLetter.Item.Count.CountRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[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<DefaultQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
108
Marechai.ApiClient/Pdas/ByLetter/Item/WithCItemRequestBuilder.cs
Normal file
108
Marechai.ApiClient/Pdas/ByLetter/Item/WithCItemRequestBuilder.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using Marechai.ApiClient.Models;
|
||||
using Marechai.ApiClient.Pdas.ByLetter.Item.Count;
|
||||
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.Pdas.ByLetter.Item
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \pdas\by-letter\{c}
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class WithCItemRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>The count property</summary>
|
||||
public global::Marechai.ApiClient.Pdas.ByLetter.Item.Count.CountRequestBuilder Count
|
||||
{
|
||||
get => new global::Marechai.ApiClient.Pdas.ByLetter.Item.Count.CountRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.ByLetter.Item.WithCItemRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public WithCItemRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/by-letter/{c}{?skip*,take*}", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.ByLetter.Item.WithCItemRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public WithCItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/by-letter/{c}{?skip*,take*}", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A List<global::Marechai.ApiClient.Models.MachineDto></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
/// <exception cref="global::Marechai.ApiClient.Models.ProblemDetails">When receiving a 400 status code</exception>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<List<global::Marechai.ApiClient.Models.MachineDto>?> GetAsync(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.ByLetter.Item.WithCItemRequestBuilder.WithCItemRequestBuilderGetQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<List<global::Marechai.ApiClient.Models.MachineDto>> GetAsync(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.ByLetter.Item.WithCItemRequestBuilder.WithCItemRequestBuilderGetQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
|
||||
{
|
||||
{ "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue },
|
||||
};
|
||||
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.ApiClient.Models.MachineDto>(requestInfo, global::Marechai.ApiClient.Models.MachineDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
|
||||
return collectionResult?.AsList();
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.ByLetter.Item.WithCItemRequestBuilder.WithCItemRequestBuilderGetQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.ByLetter.Item.WithCItemRequestBuilder.WithCItemRequestBuilderGetQueryParameters>> 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;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.ByLetter.Item.WithCItemRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::Marechai.ApiClient.Pdas.ByLetter.Item.WithCItemRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::Marechai.ApiClient.Pdas.ByLetter.Item.WithCItemRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
#pragma warning disable CS1591
|
||||
public partial class WithCItemRequestBuilderGetQueryParameters
|
||||
#pragma warning restore CS1591
|
||||
{
|
||||
[QueryParameter("skip")]
|
||||
public int? Skip { get; set; }
|
||||
[QueryParameter("take")]
|
||||
public int? Take { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[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 WithCItemRequestBuilderGetRequestConfiguration : RequestConfiguration<global::Marechai.ApiClient.Pdas.ByLetter.Item.WithCItemRequestBuilder.WithCItemRequestBuilderGetQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
61
Marechai.ApiClient/Pdas/ByYear/ByYearRequestBuilder.cs
Normal file
61
Marechai.ApiClient/Pdas/ByYear/ByYearRequestBuilder.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using Marechai.ApiClient.Pdas.ByYear.Item;
|
||||
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.Pdas.ByYear
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \pdas\by-year
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class ByYearRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>Gets an item from the Marechai.ApiClient.pdas.byYear.item collection</summary>
|
||||
/// <param name="position">Unique identifier of the item</param>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.ByYear.Item.WithYearItemRequestBuilder"/></returns>
|
||||
public global::Marechai.ApiClient.Pdas.ByYear.Item.WithYearItemRequestBuilder this[int position]
|
||||
{
|
||||
get
|
||||
{
|
||||
var urlTplParams = new Dictionary<string, object>(PathParameters);
|
||||
urlTplParams.Add("year", position);
|
||||
return new global::Marechai.ApiClient.Pdas.ByYear.Item.WithYearItemRequestBuilder(urlTplParams, RequestAdapter);
|
||||
}
|
||||
}
|
||||
/// <summary>Gets an item from the Marechai.ApiClient.pdas.byYear.item collection</summary>
|
||||
/// <param name="position">Unique identifier of the item</param>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.ByYear.Item.WithYearItemRequestBuilder"/></returns>
|
||||
[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.Pdas.ByYear.Item.WithYearItemRequestBuilder this[string position]
|
||||
{
|
||||
get
|
||||
{
|
||||
var urlTplParams = new Dictionary<string, object>(PathParameters);
|
||||
if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("year", position);
|
||||
return new global::Marechai.ApiClient.Pdas.ByYear.Item.WithYearItemRequestBuilder(urlTplParams, RequestAdapter);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.ByYear.ByYearRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public ByYearRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/by-year", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.ByYear.ByYearRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public ByYearRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/by-year", rawUrl)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,91 @@
|
||||
// <auto-generated/>
|
||||
#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.Pdas.ByYear.Item.Count
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \pdas\by-year\{year}\count
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class CountRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.ByYear.Item.Count.CountRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public CountRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/by-year/{year}/count", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.ByYear.Item.Count.CountRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public CountRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/by-year/{year}/count", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A <see cref="int"/></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
/// <exception cref="global::Marechai.ApiClient.Models.ProblemDetails">When receiving a 400 status code</exception>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
|
||||
{
|
||||
{ "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue },
|
||||
};
|
||||
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> 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;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.ByYear.Item.Count.CountRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::Marechai.ApiClient.Pdas.ByYear.Item.Count.CountRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::Marechai.ApiClient.Pdas.ByYear.Item.Count.CountRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[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<DefaultQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,108 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using Marechai.ApiClient.Models;
|
||||
using Marechai.ApiClient.Pdas.ByYear.Item.Count;
|
||||
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.Pdas.ByYear.Item
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \pdas\by-year\{year}
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class WithYearItemRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>The count property</summary>
|
||||
public global::Marechai.ApiClient.Pdas.ByYear.Item.Count.CountRequestBuilder Count
|
||||
{
|
||||
get => new global::Marechai.ApiClient.Pdas.ByYear.Item.Count.CountRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.ByYear.Item.WithYearItemRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public WithYearItemRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/by-year/{year}{?skip*,take*}", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.ByYear.Item.WithYearItemRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public WithYearItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/by-year/{year}{?skip*,take*}", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A List<global::Marechai.ApiClient.Models.MachineDto></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
/// <exception cref="global::Marechai.ApiClient.Models.ProblemDetails">When receiving a 400 status code</exception>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<List<global::Marechai.ApiClient.Models.MachineDto>?> GetAsync(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.ByYear.Item.WithYearItemRequestBuilder.WithYearItemRequestBuilderGetQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<List<global::Marechai.ApiClient.Models.MachineDto>> GetAsync(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.ByYear.Item.WithYearItemRequestBuilder.WithYearItemRequestBuilderGetQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
|
||||
{
|
||||
{ "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue },
|
||||
};
|
||||
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.ApiClient.Models.MachineDto>(requestInfo, global::Marechai.ApiClient.Models.MachineDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
|
||||
return collectionResult?.AsList();
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.ByYear.Item.WithYearItemRequestBuilder.WithYearItemRequestBuilderGetQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.ByYear.Item.WithYearItemRequestBuilder.WithYearItemRequestBuilderGetQueryParameters>> 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;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.ByYear.Item.WithYearItemRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::Marechai.ApiClient.Pdas.ByYear.Item.WithYearItemRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::Marechai.ApiClient.Pdas.ByYear.Item.WithYearItemRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
#pragma warning disable CS1591
|
||||
public partial class WithYearItemRequestBuilderGetQueryParameters
|
||||
#pragma warning restore CS1591
|
||||
{
|
||||
[QueryParameter("skip")]
|
||||
public int? Skip { get; set; }
|
||||
[QueryParameter("take")]
|
||||
public int? Take { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[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 WithYearItemRequestBuilderGetRequestConfiguration : RequestConfiguration<global::Marechai.ApiClient.Pdas.ByYear.Item.WithYearItemRequestBuilder.WithYearItemRequestBuilderGetQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
98
Marechai.ApiClient/Pdas/Companies/CompaniesRequestBuilder.cs
Normal file
98
Marechai.ApiClient/Pdas/Companies/CompaniesRequestBuilder.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using Marechai.ApiClient.Models;
|
||||
using Marechai.ApiClient.Pdas.Companies.Letter;
|
||||
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.Pdas.Companies
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \pdas\companies
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class CompaniesRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>The letter property</summary>
|
||||
public global::Marechai.ApiClient.Pdas.Companies.Letter.LetterRequestBuilder Letter
|
||||
{
|
||||
get => new global::Marechai.ApiClient.Pdas.Companies.Letter.LetterRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.Companies.CompaniesRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public CompaniesRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/companies", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.Companies.CompaniesRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public CompaniesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/companies", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A List<global::Marechai.ApiClient.Models.CompanyDto></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
/// <exception cref="global::Marechai.ApiClient.Models.ProblemDetails">When receiving a 400 status code</exception>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<List<global::Marechai.ApiClient.Models.CompanyDto>?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<List<global::Marechai.ApiClient.Models.CompanyDto>> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
|
||||
{
|
||||
{ "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue },
|
||||
};
|
||||
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.ApiClient.Models.CompanyDto>(requestInfo, global::Marechai.ApiClient.Models.CompanyDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
|
||||
return collectionResult?.AsList();
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> 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;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.Companies.CompaniesRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::Marechai.ApiClient.Pdas.Companies.CompaniesRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::Marechai.ApiClient.Pdas.Companies.CompaniesRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[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 CompaniesRequestBuilderGetRequestConfiguration : RequestConfiguration<DefaultQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,92 @@
|
||||
// <auto-generated/>
|
||||
#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.Pdas.Companies.Letter.Item
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \pdas\companies\letter\{c}
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class WithCItemRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.Companies.Letter.Item.WithCItemRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public WithCItemRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/companies/letter/{c}", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.Companies.Letter.Item.WithCItemRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public WithCItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/companies/letter/{c}", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A List<global::Marechai.ApiClient.Models.CompanyDto></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
/// <exception cref="global::Marechai.ApiClient.Models.ProblemDetails">When receiving a 400 status code</exception>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<List<global::Marechai.ApiClient.Models.CompanyDto>?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<List<global::Marechai.ApiClient.Models.CompanyDto>> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
|
||||
{
|
||||
{ "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue },
|
||||
};
|
||||
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.ApiClient.Models.CompanyDto>(requestInfo, global::Marechai.ApiClient.Models.CompanyDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
|
||||
return collectionResult?.AsList();
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> 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;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.Companies.Letter.Item.WithCItemRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::Marechai.ApiClient.Pdas.Companies.Letter.Item.WithCItemRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::Marechai.ApiClient.Pdas.Companies.Letter.Item.WithCItemRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[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 WithCItemRequestBuilderGetRequestConfiguration : RequestConfiguration<DefaultQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,48 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using Marechai.ApiClient.Pdas.Companies.Letter.Item;
|
||||
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.Pdas.Companies.Letter
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \pdas\companies\letter
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class LetterRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>Gets an item from the Marechai.ApiClient.pdas.companies.letter.item collection</summary>
|
||||
/// <param name="position">Unique identifier of the item</param>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.Companies.Letter.Item.WithCItemRequestBuilder"/></returns>
|
||||
public global::Marechai.ApiClient.Pdas.Companies.Letter.Item.WithCItemRequestBuilder this[string position]
|
||||
{
|
||||
get
|
||||
{
|
||||
var urlTplParams = new Dictionary<string, object>(PathParameters);
|
||||
urlTplParams.Add("c", position);
|
||||
return new global::Marechai.ApiClient.Pdas.Companies.Letter.Item.WithCItemRequestBuilder(urlTplParams, RequestAdapter);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.Companies.Letter.LetterRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public LetterRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/companies/letter", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.Companies.Letter.LetterRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public LetterRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/companies/letter", rawUrl)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
91
Marechai.ApiClient/Pdas/Count/CountRequestBuilder.cs
Normal file
91
Marechai.ApiClient/Pdas/Count/CountRequestBuilder.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
// <auto-generated/>
|
||||
#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.Pdas.Count
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \pdas\count
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class CountRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.Count.CountRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public CountRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/count", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.Count.CountRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public CountRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/count", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A <see cref="int"/></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
/// <exception cref="global::Marechai.ApiClient.Models.ProblemDetails">When receiving a 400 status code</exception>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
|
||||
{
|
||||
{ "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue },
|
||||
};
|
||||
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> 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;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.Count.CountRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::Marechai.ApiClient.Pdas.Count.CountRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::Marechai.ApiClient.Pdas.Count.CountRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[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<DefaultQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,91 @@
|
||||
// <auto-generated/>
|
||||
#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.Pdas.MaximumYear
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \pdas\maximum-year
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class MaximumYearRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.MaximumYear.MaximumYearRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public MaximumYearRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/maximum-year", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.MaximumYear.MaximumYearRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public MaximumYearRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/maximum-year", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A <see cref="int"/></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
/// <exception cref="global::Marechai.ApiClient.Models.ProblemDetails">When receiving a 400 status code</exception>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
|
||||
{
|
||||
{ "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue },
|
||||
};
|
||||
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> 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;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.MaximumYear.MaximumYearRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::Marechai.ApiClient.Pdas.MaximumYear.MaximumYearRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::Marechai.ApiClient.Pdas.MaximumYear.MaximumYearRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[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 MaximumYearRequestBuilderGetRequestConfiguration : RequestConfiguration<DefaultQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,91 @@
|
||||
// <auto-generated/>
|
||||
#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.Pdas.MinimumYear
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \pdas\minimum-year
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class MinimumYearRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.MinimumYear.MinimumYearRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public MinimumYearRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/minimum-year", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.MinimumYear.MinimumYearRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public MinimumYearRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/minimum-year", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A <see cref="int"/></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
/// <exception cref="global::Marechai.ApiClient.Models.ProblemDetails">When receiving a 400 status code</exception>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
|
||||
{
|
||||
{ "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue },
|
||||
};
|
||||
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> 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;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.MinimumYear.MinimumYearRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::Marechai.ApiClient.Pdas.MinimumYear.MinimumYearRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::Marechai.ApiClient.Pdas.MinimumYear.MinimumYearRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[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 MinimumYearRequestBuilderGetRequestConfiguration : RequestConfiguration<DefaultQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
144
Marechai.ApiClient/Pdas/PdasRequestBuilder.cs
Normal file
144
Marechai.ApiClient/Pdas/PdasRequestBuilder.cs
Normal file
@@ -0,0 +1,144 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using Marechai.ApiClient.Models;
|
||||
using Marechai.ApiClient.Pdas.ByLetter;
|
||||
using Marechai.ApiClient.Pdas.ByYear;
|
||||
using Marechai.ApiClient.Pdas.Companies;
|
||||
using Marechai.ApiClient.Pdas.Count;
|
||||
using Marechai.ApiClient.Pdas.MaximumYear;
|
||||
using Marechai.ApiClient.Pdas.MinimumYear;
|
||||
using Marechai.ApiClient.Pdas.Prototypes;
|
||||
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.Pdas
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \pdas
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class PdasRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>The byLetter property</summary>
|
||||
public global::Marechai.ApiClient.Pdas.ByLetter.ByLetterRequestBuilder ByLetter
|
||||
{
|
||||
get => new global::Marechai.ApiClient.Pdas.ByLetter.ByLetterRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>The byYear property</summary>
|
||||
public global::Marechai.ApiClient.Pdas.ByYear.ByYearRequestBuilder ByYear
|
||||
{
|
||||
get => new global::Marechai.ApiClient.Pdas.ByYear.ByYearRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>The companies property</summary>
|
||||
public global::Marechai.ApiClient.Pdas.Companies.CompaniesRequestBuilder Companies
|
||||
{
|
||||
get => new global::Marechai.ApiClient.Pdas.Companies.CompaniesRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>The count property</summary>
|
||||
public global::Marechai.ApiClient.Pdas.Count.CountRequestBuilder Count
|
||||
{
|
||||
get => new global::Marechai.ApiClient.Pdas.Count.CountRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>The maximumYear property</summary>
|
||||
public global::Marechai.ApiClient.Pdas.MaximumYear.MaximumYearRequestBuilder MaximumYear
|
||||
{
|
||||
get => new global::Marechai.ApiClient.Pdas.MaximumYear.MaximumYearRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>The minimumYear property</summary>
|
||||
public global::Marechai.ApiClient.Pdas.MinimumYear.MinimumYearRequestBuilder MinimumYear
|
||||
{
|
||||
get => new global::Marechai.ApiClient.Pdas.MinimumYear.MinimumYearRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>The prototypes property</summary>
|
||||
public global::Marechai.ApiClient.Pdas.Prototypes.PrototypesRequestBuilder Prototypes
|
||||
{
|
||||
get => new global::Marechai.ApiClient.Pdas.Prototypes.PrototypesRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.PdasRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public PdasRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas{?skip*,take*}", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.PdasRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public PdasRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas{?skip*,take*}", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A List<global::Marechai.ApiClient.Models.MachineDto></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
/// <exception cref="global::Marechai.ApiClient.Models.ProblemDetails">When receiving a 400 status code</exception>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<List<global::Marechai.ApiClient.Models.MachineDto>?> GetAsync(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.PdasRequestBuilder.PdasRequestBuilderGetQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<List<global::Marechai.ApiClient.Models.MachineDto>> GetAsync(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.PdasRequestBuilder.PdasRequestBuilderGetQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
|
||||
{
|
||||
{ "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue },
|
||||
};
|
||||
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.ApiClient.Models.MachineDto>(requestInfo, global::Marechai.ApiClient.Models.MachineDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
|
||||
return collectionResult?.AsList();
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.PdasRequestBuilder.PdasRequestBuilderGetQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.PdasRequestBuilder.PdasRequestBuilderGetQueryParameters>> 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;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.PdasRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::Marechai.ApiClient.Pdas.PdasRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::Marechai.ApiClient.Pdas.PdasRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
#pragma warning disable CS1591
|
||||
public partial class PdasRequestBuilderGetQueryParameters
|
||||
#pragma warning restore CS1591
|
||||
{
|
||||
[QueryParameter("skip")]
|
||||
public int? Skip { get; set; }
|
||||
[QueryParameter("take")]
|
||||
public int? Take { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[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 PdasRequestBuilderGetRequestConfiguration : RequestConfiguration<global::Marechai.ApiClient.Pdas.PdasRequestBuilder.PdasRequestBuilderGetQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,91 @@
|
||||
// <auto-generated/>
|
||||
#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.Pdas.Prototypes.Count
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \pdas\prototypes\count
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class CountRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.Prototypes.Count.CountRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public CountRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/prototypes/count", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.Prototypes.Count.CountRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public CountRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/prototypes/count", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A <see cref="int"/></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
/// <exception cref="global::Marechai.ApiClient.Models.ProblemDetails">When receiving a 400 status code</exception>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
|
||||
{
|
||||
{ "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue },
|
||||
};
|
||||
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> 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;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.Prototypes.Count.CountRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::Marechai.ApiClient.Pdas.Prototypes.Count.CountRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::Marechai.ApiClient.Pdas.Prototypes.Count.CountRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[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<DefaultQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
108
Marechai.ApiClient/Pdas/Prototypes/PrototypesRequestBuilder.cs
Normal file
108
Marechai.ApiClient/Pdas/Prototypes/PrototypesRequestBuilder.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using Marechai.ApiClient.Models;
|
||||
using Marechai.ApiClient.Pdas.Prototypes.Count;
|
||||
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.Pdas.Prototypes
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \pdas\prototypes
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class PrototypesRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>The count property</summary>
|
||||
public global::Marechai.ApiClient.Pdas.Prototypes.Count.CountRequestBuilder Count
|
||||
{
|
||||
get => new global::Marechai.ApiClient.Pdas.Prototypes.Count.CountRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.Prototypes.PrototypesRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public PrototypesRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/prototypes{?skip*,take*}", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::Marechai.ApiClient.Pdas.Prototypes.PrototypesRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public PrototypesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pdas/prototypes{?skip*,take*}", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A List<global::Marechai.ApiClient.Models.MachineDto></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
/// <exception cref="global::Marechai.ApiClient.Models.ProblemDetails">When receiving a 400 status code</exception>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<List<global::Marechai.ApiClient.Models.MachineDto>?> GetAsync(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.Prototypes.PrototypesRequestBuilder.PrototypesRequestBuilderGetQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<List<global::Marechai.ApiClient.Models.MachineDto>> GetAsync(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.Prototypes.PrototypesRequestBuilder.PrototypesRequestBuilderGetQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
|
||||
{
|
||||
{ "400", global::Marechai.ApiClient.Models.ProblemDetails.CreateFromDiscriminatorValue },
|
||||
};
|
||||
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.ApiClient.Models.MachineDto>(requestInfo, global::Marechai.ApiClient.Models.MachineDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
|
||||
return collectionResult?.AsList();
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.Prototypes.PrototypesRequestBuilder.PrototypesRequestBuilderGetQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::Marechai.ApiClient.Pdas.Prototypes.PrototypesRequestBuilder.PrototypesRequestBuilderGetQueryParameters>> 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;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::Marechai.ApiClient.Pdas.Prototypes.PrototypesRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::Marechai.ApiClient.Pdas.Prototypes.PrototypesRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::Marechai.ApiClient.Pdas.Prototypes.PrototypesRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
#pragma warning disable CS1591
|
||||
public partial class PrototypesRequestBuilderGetQueryParameters
|
||||
#pragma warning restore CS1591
|
||||
{
|
||||
[QueryParameter("skip")]
|
||||
public int? Skip { get; set; }
|
||||
[QueryParameter("take")]
|
||||
public int? Take { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[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 PrototypesRequestBuilderGetRequestConfiguration : RequestConfiguration<global::Marechai.ApiClient.Pdas.Prototypes.PrototypesRequestBuilder.PrototypesRequestBuilderGetQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"descriptionHash": "C7C531EA6D105F5428D523A6D7A9A49C9A3AF747549FBCEF62ED86D5BDBC88341A0FA70370C6E96E15276D7D12F15F35E27A123E687FC74217EF6267597FEC75",
|
||||
"descriptionHash": "99FE4FE69B6E9F5E379D441B79D5FB141E641E47D17718BD863F9D36C1DB29B668D8279DC28AF069F3225B31E33D8116CF0E25402C55C908016B215D259ADCEB",
|
||||
"descriptionLocation": "../../../../../tmp/openapi.json",
|
||||
"lockFileVersion": "1.0.0",
|
||||
"kiotaVersion": "1.31.1",
|
||||
|
||||
@@ -109,7 +109,9 @@ public enum MachineType
|
||||
/// <summary>Videogame console</summary>
|
||||
Console = 2,
|
||||
/// <summary>Smartphone</summary>
|
||||
Smartphone = 3
|
||||
Smartphone = 3,
|
||||
/// <summary>Personal digital assistant. Also modern tablets fall in this category.</summary>
|
||||
Pda = 4
|
||||
}
|
||||
|
||||
public enum SoftwareKind
|
||||
|
||||
@@ -43,5 +43,6 @@ public enum SearchEntityType : byte
|
||||
SoundSynth = 10,
|
||||
Person = 11,
|
||||
Software = 12,
|
||||
SoftwareCompilation = 13
|
||||
SoftwareCompilation = 13,
|
||||
Pda = 14
|
||||
}
|
||||
|
||||
@@ -306,6 +306,7 @@ public sealed class SearchIndexInterceptor : SaveChangesInterceptor
|
||||
{
|
||||
MachineType.Console => SearchEntityType.Console,
|
||||
MachineType.Smartphone => SearchEntityType.Smartphone,
|
||||
MachineType.Pda => SearchEntityType.Pda,
|
||||
_ => SearchEntityType.Computer
|
||||
};
|
||||
|
||||
|
||||
243
Marechai.Server/Controllers/PdasController.cs
Normal file
243
Marechai.Server/Controllers/PdasController.cs
Normal file
@@ -0,0 +1,243 @@
|
||||
/*******************************************************************************
|
||||
// MARECHAI: Master repository of computing history artifacts information
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ License ] -----------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
// Copyright © 2003-2026 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Marechai.Data;
|
||||
using Marechai.Data.Dtos;
|
||||
using Marechai.Database.Models;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Marechai.Server.Controllers;
|
||||
|
||||
[Route("/pdas")]
|
||||
[ApiController]
|
||||
public class PdasController(MarechaiContext context) : ControllerBase
|
||||
{
|
||||
[HttpGet("count")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
public Task<int> GetPdasCountAsync() => context.Machines.CountAsync(c => c.Type == MachineType.Pda);
|
||||
|
||||
[HttpGet("minimum-year")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
public async Task<int> GetMinimumYearAsync() => await context.Machines
|
||||
.Where(t => t.Type == MachineType.Pda &&
|
||||
t.Introduced.HasValue &&
|
||||
!t.Prototype)
|
||||
.MinAsync(t => (int?)t.Introduced.Value.Year) ?? 0;
|
||||
|
||||
[HttpGet("maximum-year")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
public async Task<int> GetMaximumYearAsync() => await context.Machines
|
||||
.Where(t => t.Type == MachineType.Pda &&
|
||||
t.Introduced.HasValue &&
|
||||
!t.Prototype)
|
||||
.MaxAsync(t => (int?)t.Introduced.Value.Year) ?? 0;
|
||||
|
||||
[HttpGet("by-letter/{c}")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
public Task<List<MachineDto>> GetPdasByLetterAsync(char c, [FromQuery] int? skip = null,
|
||||
[FromQuery] int? take = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
IQueryable<Machine> ordered = context.Machines.Include(m => m.Company)
|
||||
.Where(m => m.Type == MachineType.Pda &&
|
||||
EF.Functions.Like(m.Name, $"{c}%"))
|
||||
.OrderBy(m => MarechaiContext.NaturalSortKey(m.Company.Name))
|
||||
.ThenBy(m => MarechaiContext.NaturalSortKey(m.Name));
|
||||
|
||||
if(skip.HasValue) ordered = ordered.Skip(skip.Value);
|
||||
if(take.HasValue) ordered = ordered.Take(take.Value);
|
||||
|
||||
return ordered.Select(m => new MachineDto
|
||||
{
|
||||
Id = m.Id,
|
||||
Name = m.Name,
|
||||
Company = m.Company.Name,
|
||||
Introduced = m.Introduced
|
||||
})
|
||||
.ToListAsync(cancellationToken);
|
||||
}
|
||||
|
||||
[HttpGet("by-letter/{c}/count")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
public Task<int> GetPdasByLetterCountAsync(char c, CancellationToken cancellationToken = default) =>
|
||||
context.Machines
|
||||
.Where(m => m.Type == MachineType.Pda && EF.Functions.Like(m.Name, $"{c}%"))
|
||||
.CountAsync(cancellationToken);
|
||||
|
||||
[HttpGet("by-year/{year:int}")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
public Task<List<MachineDto>> GetPdasByYearAsync(int year, [FromQuery] int? skip = null,
|
||||
[FromQuery] int? take = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
IQueryable<Machine> ordered = context.Machines.Include(m => m.Company)
|
||||
.Where(m => m.Type == MachineType.Pda &&
|
||||
m.Introduced != null &&
|
||||
m.Introduced.Value.Year == year)
|
||||
.OrderBy(m => MarechaiContext.NaturalSortKey(m.Company.Name))
|
||||
.ThenBy(m => MarechaiContext.NaturalSortKey(m.Name));
|
||||
|
||||
if(skip.HasValue) ordered = ordered.Skip(skip.Value);
|
||||
if(take.HasValue) ordered = ordered.Take(take.Value);
|
||||
|
||||
return ordered.Select(m => new MachineDto
|
||||
{
|
||||
Id = m.Id,
|
||||
Name = m.Name,
|
||||
Company = m.Company.Name,
|
||||
Introduced = m.Introduced
|
||||
})
|
||||
.ToListAsync(cancellationToken);
|
||||
}
|
||||
|
||||
[HttpGet("by-year/{year:int}/count")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
public Task<int> GetPdasByYearCountAsync(int year, CancellationToken cancellationToken = default) =>
|
||||
context.Machines
|
||||
.Where(m => m.Type == MachineType.Pda &&
|
||||
m.Introduced != null &&
|
||||
m.Introduced.Value.Year == year)
|
||||
.CountAsync(cancellationToken);
|
||||
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
public Task<List<MachineDto>> GetPdasAsync([FromQuery] int? skip = null, [FromQuery] int? take = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
IQueryable<Machine> ordered = context.Machines.Include(m => m.Company)
|
||||
.Where(m => m.Type == MachineType.Pda)
|
||||
.OrderBy(m => MarechaiContext.NaturalSortKey(m.Company.Name))
|
||||
.ThenBy(m => MarechaiContext.NaturalSortKey(m.Name));
|
||||
|
||||
if(skip.HasValue) ordered = ordered.Skip(skip.Value);
|
||||
if(take.HasValue) ordered = ordered.Take(take.Value);
|
||||
|
||||
return ordered.Select(m => new MachineDto
|
||||
{
|
||||
Id = m.Id,
|
||||
Name = m.Name,
|
||||
Company = m.Company.Name,
|
||||
Introduced = m.Introduced
|
||||
})
|
||||
.ToListAsync(cancellationToken);
|
||||
}
|
||||
|
||||
[HttpGet("prototypes")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
public Task<List<MachineDto>> GetPrototypesAsync([FromQuery] int? skip = null, [FromQuery] int? take = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
IQueryable<Machine> ordered = context.Machines.Include(m => m.Company)
|
||||
.Where(m => m.Type == MachineType.Pda && m.Prototype)
|
||||
.OrderBy(m => MarechaiContext.NaturalSortKey(m.Company.Name))
|
||||
.ThenBy(m => MarechaiContext.NaturalSortKey(m.Name));
|
||||
|
||||
if(skip.HasValue) ordered = ordered.Skip(skip.Value);
|
||||
if(take.HasValue) ordered = ordered.Take(take.Value);
|
||||
|
||||
return ordered.Select(m => new MachineDto
|
||||
{
|
||||
Id = m.Id,
|
||||
Name = m.Name,
|
||||
Company = m.Company.Name,
|
||||
Prototype = m.Prototype
|
||||
})
|
||||
.ToListAsync(cancellationToken);
|
||||
}
|
||||
|
||||
[HttpGet("prototypes/count")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
public Task<int> GetPrototypesCountAsync(CancellationToken cancellationToken = default) =>
|
||||
context.Machines
|
||||
.Where(m => m.Type == MachineType.Pda && m.Prototype)
|
||||
.CountAsync(cancellationToken);
|
||||
|
||||
[HttpGet("companies")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
public Task<List<CompanyDto>> GetCompaniesAsync() => context.Machines
|
||||
.Where(m => m.Type == MachineType.Pda)
|
||||
.Select(m => m.Company)
|
||||
.Distinct()
|
||||
.Include(c => c.Logos)
|
||||
.OrderBy(c => MarechaiContext.NaturalSortKey(c.Name))
|
||||
.Select(c => new CompanyDto
|
||||
{
|
||||
Id = c.Id,
|
||||
LastLogo =
|
||||
c.Logos.OrderByDescending(l => l.Year)
|
||||
.FirstOrDefault()
|
||||
.Guid,
|
||||
Name = c.Name
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
[HttpGet("companies/letter/{c}")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
public Task<List<CompanyDto>> GetCompaniesByLetterAsync(char c) => context.Machines
|
||||
.Where(m => m.Type == MachineType.Pda)
|
||||
.Select(m => m.Company)
|
||||
.Distinct()
|
||||
.Include(c => c.Logos)
|
||||
.Where(co => EF.Functions.Like(co.Name, $"{c}%"))
|
||||
.OrderBy(co => MarechaiContext.NaturalSortKey(co.Name))
|
||||
.Select(co => new CompanyDto
|
||||
{
|
||||
Id = co.Id,
|
||||
LastLogo = co.Logos.OrderByDescending(l => l.Year).FirstOrDefault().Guid,
|
||||
Name = co.Name
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
@@ -18,6 +18,7 @@ public static class SearchIcons
|
||||
SearchEntityType.Computer => Icons.Material.Filled.Computer,
|
||||
SearchEntityType.Console => Icons.Material.Filled.SportsEsports,
|
||||
SearchEntityType.Smartphone => Icons.Material.Filled.Smartphone,
|
||||
SearchEntityType.Pda => Icons.Material.Filled.Devices,
|
||||
SearchEntityType.Book => Icons.Material.Filled.MenuBook,
|
||||
SearchEntityType.Document => Icons.Material.Filled.Description,
|
||||
SearchEntityType.Magazine => Icons.Material.Filled.Newspaper,
|
||||
@@ -45,6 +46,7 @@ public static class SearchUrlBuilder
|
||||
SearchEntityType.Computer => $"/machine/{id}",
|
||||
SearchEntityType.Console => $"/machine/{id}",
|
||||
SearchEntityType.Smartphone => $"/machine/{id}",
|
||||
SearchEntityType.Pda => $"/machine/{id}",
|
||||
SearchEntityType.Book => $"/book/{id}",
|
||||
SearchEntityType.Document => $"/document/{id}",
|
||||
SearchEntityType.Magazine => $"/magazine/{id}",
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Marechai.Helpers;
|
||||
///
|
||||
/// Prefix table (must match the help footer rendered by SearchBar.razor):
|
||||
/// <c>c/</c> Company, <c>m/</c> Computer, <c>cn/</c> Console, <c>sm/</c> Smartphone,
|
||||
/// <c>b/</c> Book, <c>d/</c> Document, <c>mg/</c> Magazine, <c>g/</c> Gpu,
|
||||
/// <c>pda/</c> Pda, <c>b/</c> Book, <c>d/</c> Document, <c>mg/</c> Magazine, <c>g/</c> Gpu,
|
||||
/// <c>p/</c> Processor, <c>s/</c> SoundSynth, <c>pe/</c> Person, <c>sw/</c> Software,
|
||||
/// <c>cl/</c> SoftwareCompilation.
|
||||
/// </summary>
|
||||
@@ -48,6 +48,7 @@ public static class SearchPrefixParser
|
||||
["m"] = SearchEntityType.Computer,
|
||||
["cn"] = SearchEntityType.Console,
|
||||
["sm"] = SearchEntityType.Smartphone,
|
||||
["pda"] = SearchEntityType.Pda,
|
||||
["b"] = SearchEntityType.Book,
|
||||
["d"] = SearchEntityType.Document,
|
||||
["mg"] = SearchEntityType.Magazine,
|
||||
|
||||
@@ -193,6 +193,10 @@
|
||||
{
|
||||
<MudLink Href="@($"/smartphones/year/{_machine.Introduced.Value.Year}")">@(((_machine.IntroducedPrecision ?? 0) == 2 ? _machine.Introduced.Value.Year.ToString() : (_machine.IntroducedPrecision ?? 0) == 1 ? _machine.Introduced.Value.ToString("MMMM yyyy") : _machine.Introduced.Value.DateTime.ToLongDateString()))</MudLink>
|
||||
}
|
||||
else if(_machine.Type == (int)MachineType.Pda)
|
||||
{
|
||||
<MudLink Href="@($"/pdas/year/{_machine.Introduced.Value.Year}")">@(((_machine.IntroducedPrecision ?? 0) == 2 ? _machine.Introduced.Value.Year.ToString() : (_machine.IntroducedPrecision ?? 0) == 1 ? _machine.Introduced.Value.ToString("MMMM yyyy") : _machine.Introduced.Value.DateTime.ToLongDateString()))</MudLink>
|
||||
}
|
||||
else
|
||||
{
|
||||
@(((_machine.IntroducedPrecision ?? 0) == 2 ? _machine.Introduced.Value.Year.ToString() : (_machine.IntroducedPrecision ?? 0) == 1 ? _machine.Introduced.Value.ToString("MMMM yyyy") : _machine.Introduced.Value.DateTime.ToLongDateString()))
|
||||
@@ -225,6 +229,7 @@
|
||||
{
|
||||
MachineType.Console => "We do not have a description for this console, you could collaborate by suggesting one",
|
||||
MachineType.Smartphone => "We do not have a description for this smartphone, you could collaborate by suggesting one",
|
||||
MachineType.Pda => "We do not have a description for this PDA, you could collaborate by suggesting one",
|
||||
_ => "We do not have a description for this computer, you could collaborate by suggesting one"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -346,6 +346,7 @@ public partial class View
|
||||
MachineType.Computer => L["Suggest computer photos"],
|
||||
MachineType.Console => L["Suggest console photos"],
|
||||
MachineType.Smartphone => L["Suggest smartphone photos"],
|
||||
MachineType.Pda => L["Suggest PDA photos"],
|
||||
_ => L["Suggest photos"]
|
||||
};
|
||||
|
||||
@@ -355,6 +356,7 @@ public partial class View
|
||||
MachineType.Computer => L["Suggest more computer photos"],
|
||||
MachineType.Console => L["Suggest more console photos"],
|
||||
MachineType.Smartphone => L["Suggest more smartphone photos"],
|
||||
MachineType.Pda => L["Suggest more PDA photos"],
|
||||
_ => L["Suggest more photos"]
|
||||
};
|
||||
|
||||
@@ -364,6 +366,7 @@ public partial class View
|
||||
MachineType.Computer => L["No photos for this computer yet — help us by uploading some."],
|
||||
MachineType.Console => L["No photos for this console yet — help us by uploading some."],
|
||||
MachineType.Smartphone => L["No photos for this smartphone yet — help us by uploading some."],
|
||||
MachineType.Pda => L["No photos for this PDA yet — help us by uploading some."],
|
||||
_ => L["No photos for this device yet — help us by uploading some."]
|
||||
};
|
||||
|
||||
@@ -411,6 +414,7 @@ public partial class View
|
||||
MachineType.Computer => L["We have no videos available about this computer."],
|
||||
MachineType.Console => L["We have no videos available about this console."],
|
||||
MachineType.Smartphone => L["We have no videos available about this smartphone."],
|
||||
MachineType.Pda => L["We have no videos available about this PDA."],
|
||||
_ => L["We have no videos available about this machine."]
|
||||
};
|
||||
|
||||
|
||||
95
Marechai/Pages/Pdas/Companies.razor
Normal file
95
Marechai/Pages/Pdas/Companies.razor
Normal file
@@ -0,0 +1,95 @@
|
||||
@{
|
||||
/******************************************************************************
|
||||
// MARECHAI: Master repository of computing history artifacts information
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2003-2026 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
}
|
||||
|
||||
@page "/pdas/companies"
|
||||
@page "/pdas/companies/{StartingCharacter}"
|
||||
@using Marechai.ApiClient.Models
|
||||
@inherits OwningComponentBase<PdasService>
|
||||
@inject IStringLocalizer<PdasService> L
|
||||
@inject ApiAssetUrlProvider AssetUrls
|
||||
|
||||
@if(_companies is null)
|
||||
{
|
||||
<div class="d-flex justify-center pa-8">
|
||||
<MudProgressCircular Color="Color.Primary" Indeterminate="true" Size="Size.Large"/>
|
||||
</div>
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@* ── Hero Header ── *@
|
||||
<MudPaper Class="pa-6 mb-6" Elevation="0" Style="background: linear-gradient(135deg, #7e57c2 0%, #42a5f5 100%); border-radius: 16px;">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="3" Class="mb-3">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Devices" Size="Size.Large" Style="color: white;"/>
|
||||
<MudText Typo="Typo.h4" Style="color: white;">@L["Pda manufacturers"]</MudText>
|
||||
</MudStack>
|
||||
@if(_character.HasValue)
|
||||
{
|
||||
<MudText Typo="Typo.subtitle1" Style="color: rgba(255,255,255,0.85);">@string.Format(L["Companies which name starts with {0}."], _character)</MudText>
|
||||
}
|
||||
<MudChip T="string" Color="Color.Dark" Variant="Variant.Filled" Class="mt-2" Style="color: white; white-space: normal; height: auto; overflow: visible; text-overflow: unset; padding: 8px 16px;">@string.Format(L["{0} companies found in the database."], _companies.Count())</MudChip>
|
||||
</MudPaper>
|
||||
|
||||
@if(_companies.Any())
|
||||
{
|
||||
<MudTextField T="string" @bind-Value="_searchText" @bind-Value:after="OnSearchChanged"
|
||||
Placeholder="@L["Filter companies..."]"
|
||||
Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Search"
|
||||
Variant="Variant.Outlined" Class="mb-4" Immediate="true"/>
|
||||
|
||||
<div style="height: 70vh; overflow-y: auto;">
|
||||
<Virtualize Items="_filteredCompanies" Context="company" ItemSize="88">
|
||||
<a href="/company/@company.Id" style="text-decoration: none; color: inherit;">
|
||||
<MudCard Elevation="1" Class="mb-2 rounded-lg" Style="cursor: pointer;">
|
||||
<MudCardContent>
|
||||
<div class="d-flex align-center justify-space-between">
|
||||
<MudText Typo="Typo.body1" Style="font-weight: 500;">@company.Name</MudText>
|
||||
@if(company.LastLogo != null)
|
||||
{
|
||||
<picture>
|
||||
<source srcset="@(AssetUrls.BaseUrl)/assets/logos/@(company.LastLogo).svg" type="image/svg+xml">
|
||||
<source srcset="@(AssetUrls.BaseUrl)/assets/logos/thumbs/webp/1x/@(company.LastLogo).webp,
|
||||
@(AssetUrls.BaseUrl)/assets/logos/thumbs/webp/2x/@(company.LastLogo).webp 2x,
|
||||
@(AssetUrls.BaseUrl)/assets/logos/thumbs/webp/3x/@(company.LastLogo).webp 3x" type="image/webp">
|
||||
<img alt="" height="auto" src="@(AssetUrls.BaseUrl)/assets/logos/thumbs/png/1x/@(company.LastLogo).png"
|
||||
srcset="@(AssetUrls.BaseUrl)/assets/logos/thumbs/png/1x/@(company.LastLogo).png,
|
||||
@(AssetUrls.BaseUrl)/assets/logos/thumbs/png/2x/@(company.LastLogo).png 2x,
|
||||
@(AssetUrls.BaseUrl)/assets/logos/thumbs/png/3x/@(company.LastLogo).png 3x" style="max-height: 48px; max-width: 200px"
|
||||
width="auto"/>
|
||||
</picture>
|
||||
}
|
||||
</div>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
</a>
|
||||
</Virtualize>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAlert Severity="Severity.Info">@L["There are no companies in the database."]</MudAlert>
|
||||
}
|
||||
89
Marechai/Pages/Pdas/Companies.razor.cs
Normal file
89
Marechai/Pages/Pdas/Companies.razor.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
/******************************************************************************
|
||||
// MARECHAI: Master repository of computing history artifacts information
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2003-2026 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Marechai.ApiClient.Models;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Marechai.Pages.Pdas;
|
||||
|
||||
public partial class Companies
|
||||
{
|
||||
char? _character;
|
||||
List<CompanyDto> _companies;
|
||||
List<CompanyDto> _filteredCompanies;
|
||||
bool _loaded;
|
||||
string _searchText;
|
||||
string _lastStartingCharacter;
|
||||
|
||||
[Parameter]
|
||||
public string StartingCharacter { get; set; }
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
if(StartingCharacter == _lastStartingCharacter) return;
|
||||
|
||||
_lastStartingCharacter = StartingCharacter;
|
||||
_loaded = false;
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if(_loaded) return;
|
||||
|
||||
_character = null;
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(StartingCharacter) && StartingCharacter.Length == 1)
|
||||
{
|
||||
_character = StartingCharacter[0];
|
||||
|
||||
// ToUpper()
|
||||
if(_character >= 'a' && _character <= 'z') _character -= (char)32;
|
||||
|
||||
// Check if not letter or number
|
||||
if(_character < '0' || _character > '9' && _character < 'A' || _character > 'Z') _character = null;
|
||||
}
|
||||
|
||||
if(_character.HasValue)
|
||||
_companies = await Service.GetCompaniesByLetterAsync(_character.Value);
|
||||
|
||||
_companies ??= await Service.GetCompaniesAsync();
|
||||
_filteredCompanies = _companies;
|
||||
_loaded = true;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
void OnSearchChanged()
|
||||
{
|
||||
_filteredCompanies = string.IsNullOrWhiteSpace(_searchText)
|
||||
? _companies
|
||||
: _companies
|
||||
.Where(c => c.Name != null &&
|
||||
c.Name.Contains(_searchText, System.StringComparison.OrdinalIgnoreCase))
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
127
Marechai/Pages/Pdas/Index.razor
Normal file
127
Marechai/Pages/Pdas/Index.razor
Normal file
@@ -0,0 +1,127 @@
|
||||
@{
|
||||
/******************************************************************************
|
||||
// MARECHAI: Master repository of computing history artifacts information
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2003-2026 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
}
|
||||
|
||||
@page "/pdas"
|
||||
@using Marechai.ApiClient.Models
|
||||
@using Marechai.Data
|
||||
@using Marechai.Pages.Suggestions
|
||||
@inherits OwningComponentBase<PdasService>
|
||||
@inject IStringLocalizer<PdasService> L
|
||||
@inject IDialogService DialogService
|
||||
|
||||
@if(!_loaded)
|
||||
{
|
||||
<div class="d-flex justify-center pa-8">
|
||||
<MudProgressCircular Color="Color.Primary" Indeterminate="true" Size="Size.Large"/>
|
||||
</div>
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
<MudPaper Class="pa-6 mb-6" Elevation="0" Style="background: linear-gradient(135deg, #7e57c2 0%, #42a5f5 100%); border-radius: 16px;">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween" Class="mb-3">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="3">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Devices" Size="Size.Large" Style="color: white;"/>
|
||||
<MudText Typo="Typo.h4" Style="color: white;">@L["PDAs"]</MudText>
|
||||
</MudStack>
|
||||
<AuthorizeView>
|
||||
<Authorized>
|
||||
<MudTooltip Text="@L["Suggest a new PDA to be added to the catalogue."]">
|
||||
<MudButton Variant="Variant.Outlined" Size="Size.Small" Color="Color.Inherit"
|
||||
StartIcon="@Icons.Material.Filled.AddCircle"
|
||||
OnClick="OpenSuggestNewPdaDialog"
|
||||
Style="color: white; border-color: rgba(255,255,255,0.7);">
|
||||
@L["Suggest new PDA"]
|
||||
</MudButton>
|
||||
</MudTooltip>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.body1" Style="color: rgba(255,255,255,0.85);">@L["Here you can consult our database."]</MudText>
|
||||
<MudText Typo="Typo.body1" Style="color: rgba(255,255,255,0.85);">@L["In this database you can find technical information as well as PDAs history, catalogued by companies, alphabetically and by release date."]</MudText>
|
||||
<MudChip T="string" Color="Color.Dark" Variant="Variant.Filled" Class="mt-2" Style="color: white; white-space: normal; height: auto; overflow: visible; text-overflow: unset; padding: 8px 16px;">@string.Format(L["{0} PDAs actually catalogued in the database."], _pdas)</MudChip>
|
||||
</MudPaper>
|
||||
|
||||
<MudPaper Elevation="2" Class="pa-4 mb-4 rounded-lg">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2" Class="mb-3">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Business" Color="Color.Secondary" Size="Size.Small"/>
|
||||
<MudText Typo="Typo.subtitle1">@L["Search by companies"]</MudText>
|
||||
</MudStack>
|
||||
<MudStack Spacing="1" AlignItems="AlignItems.Center">
|
||||
<div class="d-flex flex-wrap justify-center gap-1">
|
||||
@foreach(char c in "QWERTYUIOP") { <MudChip T="string" Href="@($"/pdas/companies/{c}")">@c</MudChip> }
|
||||
</div>
|
||||
<div class="d-flex flex-wrap justify-center gap-1">
|
||||
@foreach(char c in "ASDFGHJKL") { <MudChip T="string" Href="@($"/pdas/companies/{c}")">@c</MudChip> }
|
||||
</div>
|
||||
<div class="d-flex flex-wrap justify-center gap-1">
|
||||
@foreach(char c in "ZXCVBNM") { <MudChip T="string" Href="@($"/pdas/companies/{c}")">@c</MudChip> }
|
||||
</div>
|
||||
<MudChip T="string" Href="/pdas/companies" Color="Color.Primary" Class="mt-1">@L["All companies"]</MudChip>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
|
||||
<MudPaper Elevation="2" Class="pa-4 mb-4 rounded-lg">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2" Class="mb-3">
|
||||
<MudIcon Icon="@Icons.Material.Filled.SortByAlpha" Color="Color.Secondary" Size="Size.Small"/>
|
||||
<MudText Typo="Typo.subtitle1">@L["Alphabetically search"]</MudText>
|
||||
</MudStack>
|
||||
<MudStack Spacing="1" AlignItems="AlignItems.Center">
|
||||
<div class="d-flex flex-wrap justify-center gap-1">
|
||||
@foreach(char c in "QWERTYUIOP") { <MudChip T="string" Href="@($"/pdas/{c}")">@c</MudChip> }
|
||||
</div>
|
||||
<div class="d-flex flex-wrap justify-center gap-1">
|
||||
@foreach(char c in "ASDFGHJKL") { <MudChip T="string" Href="@($"/pdas/{c}")">@c</MudChip> }
|
||||
</div>
|
||||
<div class="d-flex flex-wrap justify-center gap-1">
|
||||
@foreach(char c in "ZXCVBNM") { <MudChip T="string" Href="@($"/pdas/{c}")">@c</MudChip> }
|
||||
</div>
|
||||
<MudChip T="string" Href="/pdas/all" Color="Color.Primary" Class="mt-1">@L["All PDAs"]</MudChip>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
|
||||
<MudPaper Elevation="2" Class="pa-4 mb-4 rounded-lg">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2" Class="mb-3">
|
||||
<MudIcon Icon="@Icons.Material.Filled.CalendarMonth" Color="Color.Secondary" Size="Size.Small"/>
|
||||
<MudText Typo="Typo.subtitle1">@L["Search by year"]</MudText>
|
||||
</MudStack>
|
||||
<div class="d-flex flex-wrap gap-1">
|
||||
@for(int i = _minYear; i <= _maxYear; i++)
|
||||
{
|
||||
var year = i;
|
||||
<MudChip T="string" Href="@($"/pdas/year/{year}")">@year</MudChip>
|
||||
}
|
||||
</div>
|
||||
</MudPaper>
|
||||
|
||||
<MudPaper Elevation="2" Class="pa-4 mb-4 rounded-lg">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2" Class="mb-3">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Science" Color="Color.Warning" Size="Size.Small"/>
|
||||
<MudText Typo="Typo.subtitle1">@L["Prototypes"]</MudText>
|
||||
</MudStack>
|
||||
<MudChip T="string" Href="/pdas/prototypes" Color="Color.Warning" Class="mt-1">@L["View prototype PDAs"]</MudChip>
|
||||
</MudPaper>
|
||||
78
Marechai/Pages/Pdas/Index.razor.cs
Normal file
78
Marechai/Pages/Pdas/Index.razor.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
/******************************************************************************
|
||||
// MARECHAI: Master repository of computing history artifacts information
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2003-2026 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using Marechai.ApiClient.Models;
|
||||
using Marechai.Data;
|
||||
using Marechai.Pages.Suggestions;
|
||||
using MudBlazor;
|
||||
|
||||
namespace Marechai.Pages.Pdas;
|
||||
|
||||
public partial class Index
|
||||
{
|
||||
int _pdas;
|
||||
bool _loaded;
|
||||
int _maxYear;
|
||||
int _minYear;
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if(_loaded) return;
|
||||
|
||||
_pdas = await Service.GetPdasCountAsync();
|
||||
_minYear = await Service.GetMinimumYearAsync();
|
||||
_maxYear = await Service.GetMaximumYearAsync();
|
||||
|
||||
_loaded = true;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Open the unified Machine suggestion dialog in creation mode pre-selecting and locking
|
||||
/// the type to <see cref="MachineType.Pda" />. The dialog handles submission +
|
||||
/// validation; this page does not refresh on success because the new machine only appears
|
||||
/// in the listing once an admin accepts the suggestion.
|
||||
/// </summary>
|
||||
async Task OpenSuggestNewPdaDialog()
|
||||
{
|
||||
var parameters = new DialogParameters<MachineSuggestionDialog>
|
||||
{
|
||||
{ x => x.EntityId, 0L },
|
||||
{ x => x.CurrentDto, (MachineDto)null },
|
||||
{ x => x.IsCreation, true },
|
||||
{ x => x.PrefillType, (MachineType?)MachineType.Pda }
|
||||
};
|
||||
|
||||
var options = new DialogOptions
|
||||
{
|
||||
CloseOnEscapeKey = true,
|
||||
FullWidth = true,
|
||||
MaxWidth = MaxWidth.Large
|
||||
};
|
||||
|
||||
await DialogService.ShowAsync<MachineSuggestionDialog>(L["Suggest new PDA"], parameters, options);
|
||||
}
|
||||
}
|
||||
89
Marechai/Pages/Pdas/Search.razor
Normal file
89
Marechai/Pages/Pdas/Search.razor
Normal file
@@ -0,0 +1,89 @@
|
||||
@{
|
||||
/******************************************************************************
|
||||
// MARECHAI: Master repository of computing history artifacts information
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2003-2026 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
}
|
||||
|
||||
@page "/pdas/all"
|
||||
@page "/pdas/year/{Year:int}"
|
||||
@page "/pdas/{StartingCharacter}"
|
||||
@using Marechai.ApiClient.Models
|
||||
@inherits OwningComponentBase<PdasService>
|
||||
@inject IStringLocalizer<PdasService> L
|
||||
|
||||
@if(!_initialized)
|
||||
{
|
||||
<div class="d-flex justify-center pa-8">
|
||||
<MudProgressCircular Color="Color.Primary" Indeterminate="true"/>
|
||||
</div>
|
||||
|
||||
return;
|
||||
}
|
||||
<MudPaper Class="pa-6 mb-6" Elevation="0" Style="background: linear-gradient(135deg, #7e57c2 0%, #42a5f5 100%); border-radius: 16px;">
|
||||
<MudText Typo="Typo.h5" Style="color: white;">@L["Search results:"]</MudText>
|
||||
@if(_character.HasValue)
|
||||
{
|
||||
<MudText Typo="Typo.h6" Style="color: rgba(255,255,255,0.85);">@string.Format(L["PDAs starting with {0}"], _character)</MudText>
|
||||
}
|
||||
else if(_showPrototypes)
|
||||
{
|
||||
<MudText Typo="Typo.h6" Style="color: rgba(255,255,255,0.85);">@L["Prototype PDAs"]</MudText>
|
||||
}
|
||||
else if(Year.HasValue)
|
||||
{
|
||||
<MudText Typo="Typo.h6" Style="color: rgba(255,255,255,0.85);">@string.Format(L["PDAs introduced in {0}"], Year)</MudText>
|
||||
}
|
||||
</MudPaper>
|
||||
|
||||
@if(_total > 0)
|
||||
{
|
||||
<MudText Typo="Typo.body2" Class="mb-2">@string.Format(L["{0} PDAs found in the database."], _total)</MudText>
|
||||
<div id="@_scrollerId" style="height: calc(100dvh - 220px); min-height: 360px; overflow-y: auto;">
|
||||
<MudList T="MachineDto" Dense="true">
|
||||
<Virtualize Items="_pdas" Context="PDA" ItemSize="64">
|
||||
<MudListItem T="MachineDto" Href="@($"/machine/{PDA.Id}")" Icon="@Icons.Material.Filled.Devices">
|
||||
@PDA.Company @PDA.Name
|
||||
</MudListItem>
|
||||
</Virtualize>
|
||||
</MudList>
|
||||
<div id="@_sentinelId" style="height: 1px;"></div>
|
||||
@if(_loadingMore)
|
||||
{
|
||||
<div class="d-flex justify-center pa-3">
|
||||
<MudProgressCircular Color="Color.Primary" Size="Size.Small" Indeterminate="true"/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@if(_character.HasValue)
|
||||
{
|
||||
<MudAlert Severity="Severity.Info">@L["There are no PDAs found in the database that start with this letter."]</MudAlert>
|
||||
}
|
||||
else if(Year.HasValue)
|
||||
{
|
||||
<MudAlert Severity="Severity.Info">@L["There are no PDAs found introduced this year."]</MudAlert>
|
||||
}
|
||||
}
|
||||
206
Marechai/Pages/Pdas/Search.razor.cs
Normal file
206
Marechai/Pages/Pdas/Search.razor.cs
Normal file
@@ -0,0 +1,206 @@
|
||||
/******************************************************************************
|
||||
// MARECHAI: Master repository of computing history artifacts information
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2003-2026 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Marechai.ApiClient.Models;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
namespace Marechai.Pages.Pdas;
|
||||
|
||||
public partial class Search : IAsyncDisposable
|
||||
{
|
||||
const int _pageSize = 100;
|
||||
readonly string _sentinelId = $"pdas-search-sentinel-{Guid.NewGuid():N}";
|
||||
readonly string _scrollerId = $"pdas-search-scroll-{Guid.NewGuid():N}";
|
||||
readonly List<MachineDto> _pdas = [];
|
||||
char? _character;
|
||||
bool _initialized;
|
||||
bool _loadingMore;
|
||||
bool _observerRegistered;
|
||||
bool _showPrototypes;
|
||||
string _lastStartingCharacter;
|
||||
int? _lastYear;
|
||||
int _total;
|
||||
DotNetObjectReference<Search> _selfRef;
|
||||
|
||||
[Inject]
|
||||
IJSRuntime JS { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public int? Year { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string StartingCharacter { get; set; }
|
||||
|
||||
bool HasMore => _pdas.Count < _total;
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
if(Year == _lastYear && StartingCharacter == _lastStartingCharacter) return;
|
||||
|
||||
_lastYear = Year;
|
||||
_lastStartingCharacter = StartingCharacter;
|
||||
_initialized = false;
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if(!_initialized)
|
||||
{
|
||||
_character = null;
|
||||
_showPrototypes = false;
|
||||
_total = 0;
|
||||
_pdas.Clear();
|
||||
|
||||
if(StartingCharacter == "prototypes")
|
||||
_showPrototypes = true;
|
||||
else if(!string.IsNullOrWhiteSpace(StartingCharacter) && StartingCharacter.Length == 1)
|
||||
{
|
||||
_character = StartingCharacter[0];
|
||||
|
||||
// ToUpper()
|
||||
if(_character >= 'a' && _character <= 'z') _character -= (char)32;
|
||||
|
||||
// Check if not letter or number
|
||||
if(_character < '0' || _character > '9' && _character < 'A' || _character > 'Z') _character = null;
|
||||
}
|
||||
|
||||
// Stop the previous observer (if any) before swapping in a new
|
||||
// batch — the sentinel/scroller IDs are stable per page instance,
|
||||
// but a route-parameter change forces a fresh data load and the
|
||||
// observer must be re-armed once the new sentinel has rendered.
|
||||
await UnobserveAsync();
|
||||
|
||||
// Fetch the total count + first page in parallel so the page is
|
||||
// fully painted in one round-trip pair.
|
||||
Task<int> countTask = GetCurrentCountAsync();
|
||||
Task<List<MachineDto>> firstPageTask = FetchBatchAsync(0, _pageSize);
|
||||
|
||||
await Task.WhenAll(countTask, firstPageTask);
|
||||
|
||||
_total = countTask.Result;
|
||||
_pdas.AddRange(firstPageTask.Result);
|
||||
_initialized = true;
|
||||
|
||||
StateHasChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
// Register the IntersectionObserver once the sentinel has been
|
||||
// rendered. The observer keeps the same target reference, so this is
|
||||
// a one-shot until UnobserveAsync clears the flag.
|
||||
if(!_observerRegistered && HasMore)
|
||||
{
|
||||
_selfRef ??= DotNetObjectReference.Create(this);
|
||||
|
||||
try
|
||||
{
|
||||
await JS.InvokeVoidAsync("marechaiInfiniteScroll.observe", _sentinelId, _selfRef, $"#{_scrollerId}",
|
||||
"200px");
|
||||
_observerRegistered = true;
|
||||
}
|
||||
catch(JSDisconnectedException)
|
||||
{
|
||||
// Circuit gone — nothing to do.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked by the IntersectionObserver in <c>infinite-scroll.js</c> when the
|
||||
/// sentinel scrolls into view. Loads the next page, appends it to the
|
||||
/// in-memory list, and re-renders.
|
||||
/// </summary>
|
||||
[JSInvokable]
|
||||
public async Task OnSentinelVisibleAsync()
|
||||
{
|
||||
if(_loadingMore || !HasMore) return;
|
||||
|
||||
_loadingMore = true;
|
||||
StateHasChanged();
|
||||
|
||||
try
|
||||
{
|
||||
List<MachineDto> next = await FetchBatchAsync(_pdas.Count, _pageSize);
|
||||
_pdas.AddRange(next);
|
||||
|
||||
// If the very last page just arrived, stop the observer so it
|
||||
// doesn't keep firing as the user scrolls past the new tail.
|
||||
if(!HasMore) await UnobserveAsync();
|
||||
}
|
||||
finally
|
||||
{
|
||||
_loadingMore = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
Task<int> GetCurrentCountAsync()
|
||||
{
|
||||
if(_showPrototypes) return Service.GetPrototypesCountAsync();
|
||||
|
||||
if(_character.HasValue) return Service.GetPdasByLetterCountAsync(_character.Value);
|
||||
|
||||
if(Year.HasValue) return Service.GetPdasByYearCountAsync(Year.Value);
|
||||
|
||||
return Service.GetPdasCountAsync();
|
||||
}
|
||||
|
||||
Task<List<MachineDto>> FetchBatchAsync(int skip, int take)
|
||||
{
|
||||
if(_showPrototypes) return Service.GetPrototypesAsync(skip, take);
|
||||
|
||||
if(_character.HasValue) return Service.GetPdasByLetterAsync(_character.Value, skip, take);
|
||||
|
||||
if(Year.HasValue) return Service.GetPdasByYearAsync(Year.Value, skip, take);
|
||||
|
||||
return Service.GetPdasAsync(skip, take);
|
||||
}
|
||||
|
||||
async Task UnobserveAsync()
|
||||
{
|
||||
if(!_observerRegistered) return;
|
||||
|
||||
try
|
||||
{
|
||||
await JS.InvokeVoidAsync("marechaiInfiniteScroll.unobserve", _sentinelId);
|
||||
}
|
||||
catch(JSDisconnectedException)
|
||||
{
|
||||
// Circuit gone; nothing to do.
|
||||
}
|
||||
|
||||
_observerRegistered = false;
|
||||
}
|
||||
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
await UnobserveAsync();
|
||||
_selfRef?.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -315,6 +315,7 @@
|
||||
SearchEntityType.Computer => L["Computers"],
|
||||
SearchEntityType.Console => L["Consoles"],
|
||||
SearchEntityType.Smartphone => L["Smartphones"],
|
||||
SearchEntityType.Pda => L["PDAs"],
|
||||
SearchEntityType.Book => L["Books"],
|
||||
SearchEntityType.Document => L["Documents"],
|
||||
SearchEntityType.Magazine => L["Magazines"],
|
||||
|
||||
@@ -281,6 +281,7 @@
|
||||
SearchEntityType.Computer => L["Computers"],
|
||||
SearchEntityType.Console => L["Consoles"],
|
||||
SearchEntityType.Smartphone => L["Smartphones"],
|
||||
SearchEntityType.Pda => L["PDAs"],
|
||||
SearchEntityType.Book => L["Books"],
|
||||
SearchEntityType.Document => L["Documents"],
|
||||
SearchEntityType.Magazine => L["Magazines"],
|
||||
|
||||
141
Marechai/Resources/Services/PdasService.de.resx
Normal file
141
Marechai/Resources/Services/PdasService.de.resx
Normal file
@@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string"/>
|
||||
<xsd:attribute name="type" type="xsd:string"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string"/>
|
||||
<xsd:attribute name="name" type="xsd:string"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
</value>
|
||||
</resheader>
|
||||
<data name="Loading..." xml:space="preserve">
|
||||
<value>Laden...</value>
|
||||
<comment>Loading...</comment>
|
||||
</data>
|
||||
<data name="Here you can consult our database." xml:space="preserve">
|
||||
<value>Hier können Sie unsere Datenbank durchsuchen.</value>
|
||||
<comment>Here you can consult our database.</comment>
|
||||
</data>
|
||||
<data name="In this database you can find technical information as well as PDAs history, catalogued by companies, alphabetically and by release date." xml:space="preserve">
|
||||
<value>Technische Informationen und Geschichte der Videospielkonsolen.</value>
|
||||
<comment>In this database you can find technical information as well as PDAs history, catalogued by companies, alphabetically and by release date.</comment>
|
||||
</data>
|
||||
<data name="{0} PDAs actually catalogued in the database." xml:space="preserve">
|
||||
<value>{0} Videospielkonsolen im Katalog.</value>
|
||||
<comment>{0} PDAs actually catalogued in the database.</comment>
|
||||
</data>
|
||||
<data name="Search by companies" xml:space="preserve">
|
||||
<value>Nach Unternehmen suchen</value>
|
||||
<comment>Search by companies</comment>
|
||||
</data>
|
||||
<data name="All companies" xml:space="preserve">
|
||||
<value>Alle Unternehmen</value>
|
||||
<comment>All companies</comment>
|
||||
</data>
|
||||
<data name="Alphabetically search" xml:space="preserve">
|
||||
<value>Alphabetische Suche</value>
|
||||
<comment>Alphabetically search</comment>
|
||||
</data>
|
||||
<data name="All PDAs" xml:space="preserve">
|
||||
<value>Alle Videospielkonsolen</value>
|
||||
<comment>All PDAs</comment>
|
||||
</data>
|
||||
<data name="Search by year" xml:space="preserve">
|
||||
<value>Nach Jahr suchen</value>
|
||||
<comment>Search by year</comment>
|
||||
</data>
|
||||
<data name="Search results:" xml:space="preserve">
|
||||
<value>Suchergebnisse:</value>
|
||||
<comment>Search results:</comment>
|
||||
</data>
|
||||
<data name="PDAs starting with {0}" xml:space="preserve">
|
||||
<value>Videospielkonsolen, die mit {0} beginnen</value>
|
||||
<comment>PDAs starting with {0}</comment>
|
||||
</data>
|
||||
<data name="PDAs introduced in {0}" xml:space="preserve">
|
||||
<value>Videospielkonsolen eingeführt im Jahr {0}</value>
|
||||
<comment>PDAs introduced in {0}</comment>
|
||||
</data>
|
||||
<data name="{0} PDAs found in the database." xml:space="preserve">
|
||||
<value>{0} Videospielkonsolen gefunden.</value>
|
||||
<comment>{0} PDAs found in the database.</comment>
|
||||
</data>
|
||||
<data name="There are no PDAs found in the database that start with this letter." xml:space="preserve">
|
||||
<value>Keine Videospielkonsolen gefunden, die mit diesem Buchstaben beginnen.</value>
|
||||
<comment>There are no PDAs found in the database that start with this letter.</comment>
|
||||
</data>
|
||||
<data name="There are no PDAs found introduced this year." xml:space="preserve">
|
||||
<value>Keine in diesem Jahr eingeführten Videospielkonsolen gefunden.</value>
|
||||
<comment>There are no PDAs found introduced this year.</comment>
|
||||
</data>
|
||||
<data name="Date precision" xml:space="preserve">
|
||||
<value>Datumsgenauigkeit</value>
|
||||
<comment>Date precision</comment>
|
||||
</data>
|
||||
<data name="Full date" xml:space="preserve">
|
||||
<value>Vollständiges Datum</value>
|
||||
<comment>Full date</comment>
|
||||
</data>
|
||||
<data name="Month and year only" xml:space="preserve">
|
||||
<value>Nur Monat und Jahr</value>
|
||||
<comment>Month and year only</comment>
|
||||
</data>
|
||||
<data name="Year only" xml:space="preserve">
|
||||
<value>Nur Jahr</value>
|
||||
<comment>Year only</comment>
|
||||
</data>
|
||||
<data name="Suggest a new PDA to be added to the catalogue." xml:space="preserve"><value>Ein neues PDA für den Katalog vorschlagen.</value></data><data name="Suggest new PDA" xml:space="preserve"><value>Neues PDA vorschlagen</value></data></root>
|
||||
126
Marechai/Resources/Services/PdasService.es.resx
Normal file
126
Marechai/Resources/Services/PdasService.es.resx
Normal file
@@ -0,0 +1,126 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<root xmlns:ns1="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<xs:schema id="root">
|
||||
<xs:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xs:element name="root" ns1:IsDataSet="true">
|
||||
<xs:complexType>
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="metadata">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" use="required" type="xsd:string" />
|
||||
<xs:attribute name="type" type="xsd:string" />
|
||||
<xs:attribute name="mimetype" type="xsd:string" />
|
||||
<xs:attribute ref="xml:space" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="assembly">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="alias" type="xsd:string" />
|
||||
<xs:attribute name="name" type="xsd:string" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="data">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="value" type="xsd:string" minOccurs="0" ns1:Ordinal="1" />
|
||||
<xs:element name="comment" type="xsd:string" minOccurs="0" ns1:Ordinal="2" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="xsd:string" use="required" ns1:Ordinal="1" />
|
||||
<xs:attribute name="type" type="xsd:string" ns1:Ordinal="3" />
|
||||
<xs:attribute name="mimetype" type="xsd:string" ns1:Ordinal="4" />
|
||||
<xs:attribute ref="xml:space" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="resheader">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="value" type="xsd:string" minOccurs="0" ns1:Ordinal="1" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="xsd:string" use="required" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
</value>
|
||||
</resheader>
|
||||
<data name="Loading..." xml:space="preserve">
|
||||
<value>Cargando...</value>
|
||||
<comment>Message that appears while data is being loaded from database</comment>
|
||||
</data>
|
||||
<data name="Here you can consult our database." xml:space="preserve">
|
||||
<value>Aquí puedes consultar nuestra base de datos.</value>
|
||||
<comment>Introduction to search</comment>
|
||||
</data>
|
||||
<data name="In this database you can find technical information as well as PDAs history, catalogued by companies, alphabetically and by release date." xml:space="preserve">
|
||||
<value>En esta base de datos puedes encontrar información técnica así como historia de los PDAs, catalogados por compañía, alfabéticamente y por fecha de introducción.</value>
|
||||
<comment>Introduction to database</comment>
|
||||
</data>
|
||||
<data name="{0} PDAs actually catalogued in the database." xml:space="preserve">
|
||||
<value>{0} PDAs catalogados en la base de datos</value>
|
||||
<comment>Consoles in database, {0} number</comment>
|
||||
</data>
|
||||
<data name="Search by companies" xml:space="preserve">
|
||||
<value>Buscar por compañías</value>
|
||||
<comment>Search by companies</comment>
|
||||
</data>
|
||||
<data name="All companies" xml:space="preserve">
|
||||
<value>Todas las compañías</value>
|
||||
<comment>All companies</comment>
|
||||
</data>
|
||||
<data name="Alphabetically search" xml:space="preserve">
|
||||
<value>Búsqueda alfabética</value>
|
||||
<comment>Search alphabetically</comment>
|
||||
</data>
|
||||
<data name="All PDAs" xml:space="preserve">
|
||||
<value>Todas las PDAs</value>
|
||||
<comment>All PDAs</comment>
|
||||
</data>
|
||||
<data name="Search by year" xml:space="preserve">
|
||||
<value>Búsqueda por año</value>
|
||||
<comment>Search by year</comment>
|
||||
</data>
|
||||
<data name="Search results:" xml:space="preserve">
|
||||
<value>Resultados:</value>
|
||||
<comment>Search results</comment>
|
||||
</data>
|
||||
<data name="PDAs starting with {0}" xml:space="preserve">
|
||||
<value>PDAs cuyo nombre comienza por {0}</value>
|
||||
<comment>Consoles starting with {0}, a letter</comment>
|
||||
</data>
|
||||
<data name="PDAs introduced in {0}" xml:space="preserve">
|
||||
<value>PDAs introducidas en {0}</value>
|
||||
<comment>Consoles introduced in, {0} is a year</comment>
|
||||
</data>
|
||||
<data name="{0} PDAs found in the database." xml:space="preserve">
|
||||
<value>{0} PDAs en la base de datos</value>
|
||||
<comment>Consoles found by search, {0} is number</comment>
|
||||
</data>
|
||||
<data name="There are no PDAs found in the database that start with this letter." xml:space="preserve">
|
||||
<value>No se encontraron PDAs en la base de datos cuyo nombre comience por esa letra.</value>
|
||||
<comment>No PDAs in DB with that letter</comment>
|
||||
</data>
|
||||
<data name="There are no PDAs found introduced this year." xml:space="preserve">
|
||||
<value>No se encontraron PDAs en la base de datos introducidos en ese año.</value>
|
||||
<comment>No PDAs in DB from that year</comment>
|
||||
</data>
|
||||
<data name="Date precision" xml:space="preserve"><value>Precisión de fecha</value></data><data name="Full date" xml:space="preserve"><value>Fecha completa</value></data><data name="Month and year only" xml:space="preserve"><value>Solo mes y año</value></data><data name="Year only" xml:space="preserve"><value>Solo año</value></data><data name="Suggest a new PDA to be added to the catalogue." xml:space="preserve"><value>Sugerir un nuevo PDA para añadirlo al catálogo.</value></data><data name="Suggest new PDA" xml:space="preserve"><value>Sugerir nuevo PDA</value></data></root>
|
||||
141
Marechai/Resources/Services/PdasService.fr.resx
Normal file
141
Marechai/Resources/Services/PdasService.fr.resx
Normal file
@@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string"/>
|
||||
<xsd:attribute name="type" type="xsd:string"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string"/>
|
||||
<xsd:attribute name="name" type="xsd:string"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
</value>
|
||||
</resheader>
|
||||
<data name="Loading..." xml:space="preserve">
|
||||
<value>Chargement...</value>
|
||||
<comment>Loading...</comment>
|
||||
</data>
|
||||
<data name="Here you can consult our database." xml:space="preserve">
|
||||
<value>Vous pouvez consulter notre base de données ici.</value>
|
||||
<comment>Here you can consult our database.</comment>
|
||||
</data>
|
||||
<data name="In this database you can find technical information as well as PDAs history, catalogued by companies, alphabetically and by release date." xml:space="preserve">
|
||||
<value>Dans cette base de données, vous trouverez des informations techniques ainsi que l'histoire des PDAs de jeux vidéo, classées par entreprises, par ordre alphabétique et par date de sortie.</value>
|
||||
<comment>In this database you can find technical information as well as PDAs history, catalogued by companies, alphabetically and by release date.</comment>
|
||||
</data>
|
||||
<data name="{0} PDAs actually catalogued in the database." xml:space="preserve">
|
||||
<value>{0} PDAs de jeux vidéo actuellement cataloguées dans la base de données.</value>
|
||||
<comment>{0} PDAs actually catalogued in the database.</comment>
|
||||
</data>
|
||||
<data name="Search by companies" xml:space="preserve">
|
||||
<value>Rechercher par entreprises</value>
|
||||
<comment>Search by companies</comment>
|
||||
</data>
|
||||
<data name="All companies" xml:space="preserve">
|
||||
<value>Toutes les entreprises</value>
|
||||
<comment>All companies</comment>
|
||||
</data>
|
||||
<data name="Alphabetically search" xml:space="preserve">
|
||||
<value>Recherche alphabétique</value>
|
||||
<comment>Alphabetically search</comment>
|
||||
</data>
|
||||
<data name="All PDAs" xml:space="preserve">
|
||||
<value>Toutes les PDAs de jeux vidéo</value>
|
||||
<comment>All PDAs</comment>
|
||||
</data>
|
||||
<data name="Search by year" xml:space="preserve">
|
||||
<value>Recherche par année</value>
|
||||
<comment>Search by year</comment>
|
||||
</data>
|
||||
<data name="Search results:" xml:space="preserve">
|
||||
<value>Résultats :</value>
|
||||
<comment>Search results:</comment>
|
||||
</data>
|
||||
<data name="PDAs starting with {0}" xml:space="preserve">
|
||||
<value>Consoles de jeux vidéo commençant par {0}</value>
|
||||
<comment>PDAs starting with {0}</comment>
|
||||
</data>
|
||||
<data name="PDAs introduced in {0}" xml:space="preserve">
|
||||
<value>Consoles de jeux vidéo introduites en {0}</value>
|
||||
<comment>PDAs introduced in {0}</comment>
|
||||
</data>
|
||||
<data name="{0} PDAs found in the database." xml:space="preserve">
|
||||
<value>{0} PDAs de jeux vidéo trouvées dans la base de données.</value>
|
||||
<comment>{0} PDAs found in the database.</comment>
|
||||
</data>
|
||||
<data name="There are no PDAs found in the database that start with this letter." xml:space="preserve">
|
||||
<value>Aucune PDA de jeux vidéo commençant par cette lettre n'a été trouvée dans la base de données.</value>
|
||||
<comment>There are no PDAs found in the database that start with this letter.</comment>
|
||||
</data>
|
||||
<data name="There are no PDAs found introduced this year." xml:space="preserve">
|
||||
<value>Aucune PDA de jeux vidéo introduite cette année n'a été trouvée dans la base de données.</value>
|
||||
<comment>There are no PDAs found introduced this year.</comment>
|
||||
</data>
|
||||
<data name="Date precision" xml:space="preserve">
|
||||
<value>Précision de la date</value>
|
||||
<comment>Date precision</comment>
|
||||
</data>
|
||||
<data name="Full date" xml:space="preserve">
|
||||
<value>Date complète</value>
|
||||
<comment>Full date</comment>
|
||||
</data>
|
||||
<data name="Month and year only" xml:space="preserve">
|
||||
<value>Mois et année uniquement</value>
|
||||
<comment>Month and year only</comment>
|
||||
</data>
|
||||
<data name="Year only" xml:space="preserve">
|
||||
<value>Année uniquement</value>
|
||||
<comment>Year only</comment>
|
||||
</data>
|
||||
<data name="Suggest a new PDA to be added to the catalogue." xml:space="preserve"><value>Suggérer un nouveau PDA à ajouter au catalogue.</value></data><data name="Suggest new PDA" xml:space="preserve"><value>Suggérer un nouveau PDA</value></data></root>
|
||||
141
Marechai/Resources/Services/PdasService.it.resx
Normal file
141
Marechai/Resources/Services/PdasService.it.resx
Normal file
@@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string"/>
|
||||
<xsd:attribute name="type" type="xsd:string"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string"/>
|
||||
<xsd:attribute name="name" type="xsd:string"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
</value>
|
||||
</resheader>
|
||||
<data name="Loading..." xml:space="preserve">
|
||||
<value>Caricamento...</value>
|
||||
<comment>Loading...</comment>
|
||||
</data>
|
||||
<data name="Here you can consult our database." xml:space="preserve">
|
||||
<value>Qui puoi consultare il nostro database.</value>
|
||||
<comment>Here you can consult our database.</comment>
|
||||
</data>
|
||||
<data name="In this database you can find technical information as well as PDAs history, catalogued by companies, alphabetically and by release date." xml:space="preserve">
|
||||
<value>In questo database puoi trovare informazioni tecniche e la storia delle PDA per videogiochi, catalogate per azienda, in ordine alfabetico e per data di uscita.</value>
|
||||
<comment>In this database you can find technical information as well as PDAs history, catalogued by companies, alphabetically and by release date.</comment>
|
||||
</data>
|
||||
<data name="{0} PDAs actually catalogued in the database." xml:space="preserve">
|
||||
<value>{0} PDA per videogiochi attualmente catalogate nel database.</value>
|
||||
<comment>{0} PDAs actually catalogued in the database.</comment>
|
||||
</data>
|
||||
<data name="Search by companies" xml:space="preserve">
|
||||
<value>Cerca per aziende</value>
|
||||
<comment>Search by companies</comment>
|
||||
</data>
|
||||
<data name="All companies" xml:space="preserve">
|
||||
<value>Tutte le aziende</value>
|
||||
<comment>All companies</comment>
|
||||
</data>
|
||||
<data name="Alphabetically search" xml:space="preserve">
|
||||
<value>Ricerca alfabetica</value>
|
||||
<comment>Alphabetically search</comment>
|
||||
</data>
|
||||
<data name="All PDAs" xml:space="preserve">
|
||||
<value>Tutte le PDA per videogiochi</value>
|
||||
<comment>All PDAs</comment>
|
||||
</data>
|
||||
<data name="Search by year" xml:space="preserve">
|
||||
<value>Ricerca per anno</value>
|
||||
<comment>Search by year</comment>
|
||||
</data>
|
||||
<data name="Search results:" xml:space="preserve">
|
||||
<value>Risultati:</value>
|
||||
<comment>Search results:</comment>
|
||||
</data>
|
||||
<data name="PDAs starting with {0}" xml:space="preserve">
|
||||
<value>Console per videogiochi che iniziano con {0}</value>
|
||||
<comment>PDAs starting with {0}</comment>
|
||||
</data>
|
||||
<data name="PDAs introduced in {0}" xml:space="preserve">
|
||||
<value>Console per videogiochi introdotte nel {0}</value>
|
||||
<comment>PDAs introduced in {0}</comment>
|
||||
</data>
|
||||
<data name="{0} PDAs found in the database." xml:space="preserve">
|
||||
<value>{0} PDA per videogiochi trovate nel database.</value>
|
||||
<comment>{0} PDAs found in the database.</comment>
|
||||
</data>
|
||||
<data name="There are no PDAs found in the database that start with this letter." xml:space="preserve">
|
||||
<value>Nessuna PDA per videogiochi trovata nel database che inizi con questa lettera.</value>
|
||||
<comment>There are no PDAs found in the database that start with this letter.</comment>
|
||||
</data>
|
||||
<data name="There are no PDAs found introduced this year." xml:space="preserve">
|
||||
<value>Nessuna PDA per videogiochi introdotta quest'anno trovata nel database.</value>
|
||||
<comment>There are no PDAs found introduced this year.</comment>
|
||||
</data>
|
||||
<data name="Date precision" xml:space="preserve">
|
||||
<value>Precisione della data</value>
|
||||
<comment>Date precision</comment>
|
||||
</data>
|
||||
<data name="Full date" xml:space="preserve">
|
||||
<value>Data completa</value>
|
||||
<comment>Full date</comment>
|
||||
</data>
|
||||
<data name="Month and year only" xml:space="preserve">
|
||||
<value>Solo mese e anno</value>
|
||||
<comment>Month and year only</comment>
|
||||
</data>
|
||||
<data name="Year only" xml:space="preserve">
|
||||
<value>Solo anno</value>
|
||||
<comment>Year only</comment>
|
||||
</data>
|
||||
<data name="Suggest a new PDA to be added to the catalogue." xml:space="preserve"><value>Suggerisci un nuovo PDA da aggiungere al catalogo.</value></data><data name="Suggest new PDA" xml:space="preserve"><value>Suggerisci nuovo PDA</value></data></root>
|
||||
@@ -426,5 +426,8 @@
|
||||
<data name="Embedded software" xml:space="preserve">
|
||||
<value>Eingebettete Software</value>
|
||||
</data>
|
||||
<data name="Suggestions Queue" xml:space="preserve"><value>Vorschläge-Warteschlange</value></data>
|
||||
<data name="Suggestions Queue" xml:space="preserve"><value>Vorschläge-Warteschlange</value></data> <data name="PDAs" xml:space="preserve">
|
||||
<value>PDAs</value>
|
||||
</data>
|
||||
|
||||
</root>
|
||||
|
||||
@@ -487,5 +487,8 @@
|
||||
<data name="Embedded software" xml:space="preserve">
|
||||
<value>Software embebido</value>
|
||||
</data>
|
||||
<data name="Suggestions Queue" xml:space="preserve"><value>Cola de sugerencias</value></data>
|
||||
<data name="Suggestions Queue" xml:space="preserve"><value>Cola de sugerencias</value></data> <data name="PDAs" xml:space="preserve">
|
||||
<value>PDAs</value>
|
||||
</data>
|
||||
|
||||
</root>
|
||||
@@ -426,5 +426,8 @@
|
||||
<data name="Embedded software" xml:space="preserve">
|
||||
<value>Logiciel embarqué</value>
|
||||
</data>
|
||||
<data name="Suggestions Queue" xml:space="preserve"><value>File des suggestions</value></data>
|
||||
<data name="Suggestions Queue" xml:space="preserve"><value>File des suggestions</value></data> <data name="PDAs" xml:space="preserve">
|
||||
<value>PDAs</value>
|
||||
</data>
|
||||
|
||||
</root>
|
||||
|
||||
@@ -426,5 +426,8 @@
|
||||
<data name="Embedded software" xml:space="preserve">
|
||||
<value>Software integrato</value>
|
||||
</data>
|
||||
<data name="Suggestions Queue" xml:space="preserve"><value>Coda dei suggerimenti</value></data>
|
||||
<data name="Suggestions Queue" xml:space="preserve"><value>Coda dei suggerimenti</value></data> <data name="PDAs" xml:space="preserve">
|
||||
<value>PDAs</value>
|
||||
</data>
|
||||
|
||||
</root>
|
||||
|
||||
224
Marechai/Services/PdasService.cs
Normal file
224
Marechai/Services/PdasService.cs
Normal file
@@ -0,0 +1,224 @@
|
||||
/******************************************************************************
|
||||
// MARECHAI: Master repository of computing history artifacts information
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2003-2026 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Marechai.ApiClient.Models;
|
||||
|
||||
namespace Marechai.Services;
|
||||
|
||||
public class PdasService(Marechai.ApiClient.Client client)
|
||||
{
|
||||
public async Task<int> GetPdasCountAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
int? count = await client.Pdas.Count.GetAsync();
|
||||
|
||||
return count ?? 0;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<int> GetMinimumYearAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
int? year = await client.Pdas.MinimumYear.GetAsync();
|
||||
|
||||
return year ?? 0;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<int> GetMaximumYearAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
int? year = await client.Pdas.MaximumYear.GetAsync();
|
||||
|
||||
return year ?? 0;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<MachineDto>> GetPdasByLetterAsync(char c, int? skip = null, int? take = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<MachineDto> machines = await client.Pdas.ByLetter[c.ToString()].GetAsync(config =>
|
||||
{
|
||||
if(skip.HasValue) config.QueryParameters.Skip = skip.Value;
|
||||
if(take.HasValue) config.QueryParameters.Take = take.Value;
|
||||
}, cancellationToken);
|
||||
|
||||
return machines ?? [];
|
||||
}
|
||||
catch
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<int> GetPdasByLetterCountAsync(char c, CancellationToken cancellationToken = default)
|
||||
{
|
||||
try
|
||||
{
|
||||
int? count = await client.Pdas.ByLetter[c.ToString()].Count
|
||||
.GetAsync(cancellationToken: cancellationToken);
|
||||
|
||||
return count ?? 0;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<MachineDto>> GetPdasByYearAsync(int year, int? skip = null, int? take = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<MachineDto> machines = await client.Pdas.ByYear[year].GetAsync(config =>
|
||||
{
|
||||
if(skip.HasValue) config.QueryParameters.Skip = skip.Value;
|
||||
if(take.HasValue) config.QueryParameters.Take = take.Value;
|
||||
}, cancellationToken);
|
||||
|
||||
return machines ?? [];
|
||||
}
|
||||
catch
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<int> GetPdasByYearCountAsync(int year, CancellationToken cancellationToken = default)
|
||||
{
|
||||
try
|
||||
{
|
||||
int? count = await client.Pdas.ByYear[year].Count.GetAsync(cancellationToken: cancellationToken);
|
||||
|
||||
return count ?? 0;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<MachineDto>> GetPdasAsync(int? skip = null, int? take = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<MachineDto> machines = await client.Pdas.GetAsync(config =>
|
||||
{
|
||||
if(skip.HasValue) config.QueryParameters.Skip = skip.Value;
|
||||
if(take.HasValue) config.QueryParameters.Take = take.Value;
|
||||
}, cancellationToken);
|
||||
|
||||
return machines ?? [];
|
||||
}
|
||||
catch
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<MachineDto>> GetPrototypesAsync(int? skip = null, int? take = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<MachineDto> machines = await client.Pdas.Prototypes.GetAsync(config =>
|
||||
{
|
||||
if(skip.HasValue) config.QueryParameters.Skip = skip.Value;
|
||||
if(take.HasValue) config.QueryParameters.Take = take.Value;
|
||||
}, cancellationToken);
|
||||
|
||||
return machines ?? [];
|
||||
}
|
||||
catch
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<int> GetPrototypesCountAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
try
|
||||
{
|
||||
int? count = await client.Pdas.Prototypes.Count.GetAsync(cancellationToken: cancellationToken);
|
||||
|
||||
return count ?? 0;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<CompanyDto>> GetCompaniesAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
List<CompanyDto> companies = await client.Pdas.Companies.GetAsync();
|
||||
|
||||
return companies ?? [];
|
||||
}
|
||||
catch
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<CompanyDto>> GetCompaniesByLetterAsync(char c)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<CompanyDto> companies = await client.Pdas.Companies.Letter[c.ToString()].GetAsync();
|
||||
|
||||
return companies ?? [];
|
||||
}
|
||||
catch
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,6 +67,7 @@ public static class Register
|
||||
services.AddScoped<SoftwareVersionsService>();
|
||||
services.AddScoped<SoftwareReleasesService>();
|
||||
services.AddScoped<SmartphonesService>();
|
||||
services.AddScoped<PdasService>();
|
||||
services.AddScoped<AuthService>();
|
||||
services.AddScoped<UsersService>();
|
||||
services.AddScoped<InvitationCodesService>();
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
<MudNavLink Href="/companies" Icon="@Icons.Material.Filled.Business">@L["Companies"]</MudNavLink>
|
||||
<MudNavLink Href="/computers" Icon="@Icons.Material.Filled.Computer">@L["Computers"]</MudNavLink>
|
||||
<MudNavLink Href="/consoles" Icon="@Icons.Material.Filled.SportsEsports">@L["Consoles"]</MudNavLink>
|
||||
<MudNavLink Href="/pdas" Icon="@Icons.Material.Filled.Devices">@L["PDAs"]</MudNavLink>
|
||||
<MudNavLink Href="/smartphones" Icon="@Icons.Material.Filled.Smartphone">@L["Smartphones"]</MudNavLink>
|
||||
<MudNavLink Href="/books" Icon="@Icons.Material.Filled.Book">@L["Books"]</MudNavLink>
|
||||
<MudNavLink Href="/documents" Icon="@Icons.Material.Filled.Article">@L["Documents"]</MudNavLink>
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<MudText Typo="Typo.caption" Style="font-weight:500;">@L["Tip: prefix to filter by category"]</MudText>
|
||||
<MudText Typo="Typo.caption" Color="Color.Default">
|
||||
c/ @L["Companies"] m/ @L["Computers"] cn/ @L["Consoles"] sm/ @L["Smartphones"]<br/>
|
||||
b/ @L["Books"] d/ @L["Documents"] mg/ @L["Magazines"] g/ @L["GPUs"]<br/>
|
||||
pda/ @L["PDAs"] b/ @L["Books"] d/ @L["Documents"] mg/ @L["Magazines"] g/ @L["GPUs"]<br/>
|
||||
p/ @L["Processors"] s/ @L["Sound synthesizers"] pe/ @L["People"]<br/>
|
||||
sw/ @L["Software"] cl/ @L["Software Compilations"]
|
||||
</MudText>
|
||||
@@ -124,6 +124,7 @@
|
||||
SearchEntityType.Computer => L["Computer"],
|
||||
SearchEntityType.Console => L["Console"],
|
||||
SearchEntityType.Smartphone => L["Smartphone"],
|
||||
SearchEntityType.Pda => L["PDA"],
|
||||
SearchEntityType.Book => L["Book"],
|
||||
SearchEntityType.Document => L["Document"],
|
||||
SearchEntityType.Magazine => L["Magazine"],
|
||||
|
||||
@@ -76,7 +76,8 @@ public sealed class MachineSuggestionMetadata : SuggestionMetadata
|
||||
new SuggestionEnumOption(0, "Unknown"),
|
||||
new SuggestionEnumOption(1, "Computer"),
|
||||
new SuggestionEnumOption(2, "Console"),
|
||||
new SuggestionEnumOption(3, "Smartphone")
|
||||
new SuggestionEnumOption(3, "Smartphone"),
|
||||
new SuggestionEnumOption(4, "PDA")
|
||||
};
|
||||
|
||||
static readonly IReadOnlyList<SuggestionEnumOption> PrecisionOptions = new[]
|
||||
@@ -217,6 +218,7 @@ public sealed class MachineSuggestionMetadata : SuggestionMetadata
|
||||
1 => "Computer",
|
||||
2 => "Console",
|
||||
3 => "Smartphone",
|
||||
4 => "PDA",
|
||||
_ => string.Empty
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user