diff --git a/dotnet/src/WebApp/Extensions/ServiceCollectionExtensions.cs b/dotnet/src/WebApp.Extensions/Extensions/ServiceCollectionExtensions.cs similarity index 85% rename from dotnet/src/WebApp/Extensions/ServiceCollectionExtensions.cs rename to dotnet/src/WebApp.Extensions/Extensions/ServiceCollectionExtensions.cs index d7d4046..0ba5824 100644 --- a/dotnet/src/WebApp/Extensions/ServiceCollectionExtensions.cs +++ b/dotnet/src/WebApp.Extensions/Extensions/ServiceCollectionExtensions.cs @@ -20,10 +20,11 @@ public static IServiceCollection AddPetStoreClient(this IServiceCollection servi services.AddScoped(p => { var httpClient = p.GetService(); - httpClient.BaseAddress = new Uri("https://petstore3.swagger.io/api/v3"); var provider = new AnonymousAuthenticationProvider(); - var adapter = new HttpClientRequestAdapter(provider, httpClient: httpClient); - adapter.BaseUrl = "https://petstore3.swagger.io/api/v3"; + var adapter = new HttpClientRequestAdapter(provider, httpClient: httpClient) + { + BaseUrl = "https://petstore3.swagger.io/api/v3" + }; var client = new PetStoreClient(adapter); return client; diff --git a/dotnet/src/WebApp.Extensions/Pages/Home.razor b/dotnet/src/WebApp.Extensions/Pages/Home.razor new file mode 100644 index 0000000..0bdc64f --- /dev/null +++ b/dotnet/src/WebApp.Extensions/Pages/Home.razor @@ -0,0 +1,10 @@ +@page "/" +@using WebApp.UI + +Home + +

Hello, world!

+ +Welcome to your new app. + + \ No newline at end of file diff --git a/dotnet/src/WebApp.Extensions/Program.cs b/dotnet/src/WebApp.Extensions/Program.cs new file mode 100644 index 0000000..712fe68 --- /dev/null +++ b/dotnet/src/WebApp.Extensions/Program.cs @@ -0,0 +1,15 @@ +using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Components.WebAssembly.Hosting; + +using WebApp; +using WebApp.Extensions; + +var builder = WebAssemblyHostBuilder.CreateDefault(args); +builder.RootComponents.Add("#app"); +builder.RootComponents.Add("head::after"); + +builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); + +builder.Services.AddPetStoreClient(); + +await builder.Build().RunAsync(); diff --git a/dotnet/src/WebApp/UI/AvailablePetsComponent.razor b/dotnet/src/WebApp.Extensions/UI/AvailablePetsComponent.razor similarity index 100% rename from dotnet/src/WebApp/UI/AvailablePetsComponent.razor rename to dotnet/src/WebApp.Extensions/UI/AvailablePetsComponent.razor diff --git a/dotnet/src/WebApp/ApiClients/Models/ApiResponse.cs b/dotnet/src/WebApp/ApiClients/Models/ApiResponse.cs deleted file mode 100644 index 7f05017..0000000 --- a/dotnet/src/WebApp/ApiClients/Models/ApiResponse.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace WebApp.ApiClients.Models { - public class ApiResponse : IAdditionalDataHolder, IParsable - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { get; set; } - /// The code property - public int? Code { get; set; } - /// The message property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Message { get; set; } -#nullable restore -#else - public string Message { get; set; } -#endif - /// The type property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Type { get; set; } -#nullable restore -#else - public string Type { get; set; } -#endif - /// - /// Instantiates a new and sets the default values. - /// - public ApiResponse() - { - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static ApiResponse CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ApiResponse(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - {"code", n => { Code = n.GetIntValue(); } }, - {"message", n => { Message = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteIntValue("code", Code); - writer.WriteStringValue("message", Message); - writer.WriteStringValue("type", Type); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Models/Category.cs b/dotnet/src/WebApp/ApiClients/Models/Category.cs deleted file mode 100644 index 8a6eba5..0000000 --- a/dotnet/src/WebApp/ApiClients/Models/Category.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace WebApp.ApiClients.Models { - public class Category : IAdditionalDataHolder, IParsable - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { get; set; } - /// The id property - public long? Id { get; set; } - /// The name property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Name { get; set; } -#nullable restore -#else - public string Name { get; set; } -#endif - /// - /// Instantiates a new and sets the default values. - /// - public Category() - { - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Category CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Category(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - {"id", n => { Id = n.GetLongValue(); } }, - {"name", n => { Name = n.GetStringValue(); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteLongValue("id", Id); - writer.WriteStringValue("name", Name); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Models/Order.cs b/dotnet/src/WebApp/ApiClients/Models/Order.cs deleted file mode 100644 index ab13ac6..0000000 --- a/dotnet/src/WebApp/ApiClients/Models/Order.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace WebApp.ApiClients.Models { - public class Order : IAdditionalDataHolder, IParsable - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { get; set; } - /// The complete property - public bool? Complete { get; set; } - /// The id property - public long? Id { get; set; } - /// The petId property - public long? PetId { get; set; } - /// The quantity property - public int? Quantity { get; set; } - /// The shipDate property - public DateTimeOffset? ShipDate { get; set; } - /// Order Status - public Order_status? Status { get; set; } - /// - /// Instantiates a new and sets the default values. - /// - public Order() - { - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Order CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Order(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - {"complete", n => { Complete = n.GetBoolValue(); } }, - {"id", n => { Id = n.GetLongValue(); } }, - {"petId", n => { PetId = n.GetLongValue(); } }, - {"quantity", n => { Quantity = n.GetIntValue(); } }, - {"shipDate", n => { ShipDate = n.GetDateTimeOffsetValue(); } }, - {"status", n => { Status = n.GetEnumValue(); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteBoolValue("complete", Complete); - writer.WriteLongValue("id", Id); - writer.WriteLongValue("petId", PetId); - writer.WriteIntValue("quantity", Quantity); - writer.WriteDateTimeOffsetValue("shipDate", ShipDate); - writer.WriteEnumValue("status", Status); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Models/Order_status.cs b/dotnet/src/WebApp/ApiClients/Models/Order_status.cs deleted file mode 100644 index 675ec7d..0000000 --- a/dotnet/src/WebApp/ApiClients/Models/Order_status.cs +++ /dev/null @@ -1,15 +0,0 @@ -// -using System.Runtime.Serialization; -using System; -namespace WebApp.ApiClients.Models { - /// Order Status - public enum Order_status - { - [EnumMember(Value = "placed")] - Placed, - [EnumMember(Value = "approved")] - Approved, - [EnumMember(Value = "delivered")] - Delivered, - } -} diff --git a/dotnet/src/WebApp/ApiClients/Models/Pet.cs b/dotnet/src/WebApp/ApiClients/Models/Pet.cs deleted file mode 100644 index 5818158..0000000 --- a/dotnet/src/WebApp/ApiClients/Models/Pet.cs +++ /dev/null @@ -1,97 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace WebApp.ApiClients.Models { - public class Pet : IAdditionalDataHolder, IParsable - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { get; set; } - /// The category property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public WebApp.ApiClients.Models.Category? Category { get; set; } -#nullable restore -#else - public WebApp.ApiClients.Models.Category Category { get; set; } -#endif - /// The id property - public long? Id { get; set; } - /// The name property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Name { get; set; } -#nullable restore -#else - public string Name { get; set; } -#endif - /// The photoUrls property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public List? PhotoUrls { get; set; } -#nullable restore -#else - public List PhotoUrls { get; set; } -#endif - /// pet status in the store - public Pet_status? Status { get; set; } - /// The tags property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public List? Tags { get; set; } -#nullable restore -#else - public List Tags { get; set; } -#endif - /// - /// Instantiates a new and sets the default values. - /// - public Pet() - { - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Pet CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Pet(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - {"category", n => { Category = n.GetObjectValue(WebApp.ApiClients.Models.Category.CreateFromDiscriminatorValue); } }, - {"id", n => { Id = n.GetLongValue(); } }, - {"name", n => { Name = n.GetStringValue(); } }, - {"photoUrls", n => { PhotoUrls = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, - {"status", n => { Status = n.GetEnumValue(); } }, - {"tags", n => { Tags = n.GetCollectionOfObjectValues(Tag.CreateFromDiscriminatorValue)?.ToList(); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("category", Category); - writer.WriteLongValue("id", Id); - writer.WriteStringValue("name", Name); - writer.WriteCollectionOfPrimitiveValues("photoUrls", PhotoUrls); - writer.WriteEnumValue("status", Status); - writer.WriteCollectionOfObjectValues("tags", Tags); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Models/Pet_status.cs b/dotnet/src/WebApp/ApiClients/Models/Pet_status.cs deleted file mode 100644 index e4a461c..0000000 --- a/dotnet/src/WebApp/ApiClients/Models/Pet_status.cs +++ /dev/null @@ -1,15 +0,0 @@ -// -using System.Runtime.Serialization; -using System; -namespace WebApp.ApiClients.Models { - /// pet status in the store - public enum Pet_status - { - [EnumMember(Value = "available")] - Available, - [EnumMember(Value = "pending")] - Pending, - [EnumMember(Value = "sold")] - Sold, - } -} diff --git a/dotnet/src/WebApp/ApiClients/Models/Tag.cs b/dotnet/src/WebApp/ApiClients/Models/Tag.cs deleted file mode 100644 index c4807a2..0000000 --- a/dotnet/src/WebApp/ApiClients/Models/Tag.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace WebApp.ApiClients.Models { - public class Tag : IAdditionalDataHolder, IParsable - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { get; set; } - /// The id property - public long? Id { get; set; } - /// The name property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Name { get; set; } -#nullable restore -#else - public string Name { get; set; } -#endif - /// - /// Instantiates a new and sets the default values. - /// - public Tag() - { - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Tag CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Tag(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - {"id", n => { Id = n.GetLongValue(); } }, - {"name", n => { Name = n.GetStringValue(); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteLongValue("id", Id); - writer.WriteStringValue("name", Name); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Models/User.cs b/dotnet/src/WebApp/ApiClients/Models/User.cs deleted file mode 100644 index a196e82..0000000 --- a/dotnet/src/WebApp/ApiClients/Models/User.cs +++ /dev/null @@ -1,120 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace WebApp.ApiClients.Models { - public class User : ApiException, IAdditionalDataHolder, IParsable - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { get; set; } - /// The email property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Email { get; set; } -#nullable restore -#else - public string Email { get; set; } -#endif - /// The firstName property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? FirstName { get; set; } -#nullable restore -#else - public string FirstName { get; set; } -#endif - /// The id property - public long? Id { get; set; } - /// The lastName property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? LastName { get; set; } -#nullable restore -#else - public string LastName { get; set; } -#endif - /// The primary error message. - public override string Message { get => base.Message; } - /// The password property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Password { get; set; } -#nullable restore -#else - public string Password { get; set; } -#endif - /// The phone property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Phone { get; set; } -#nullable restore -#else - public string Phone { get; set; } -#endif - /// The username property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Username { get; set; } -#nullable restore -#else - public string Username { get; set; } -#endif - /// User Status - public int? UserStatus { get; set; } - /// - /// Instantiates a new and sets the default values. - /// - public User() - { - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static User CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new User(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - {"email", n => { Email = n.GetStringValue(); } }, - {"firstName", n => { FirstName = n.GetStringValue(); } }, - {"id", n => { Id = n.GetLongValue(); } }, - {"lastName", n => { LastName = n.GetStringValue(); } }, - {"password", n => { Password = n.GetStringValue(); } }, - {"phone", n => { Phone = n.GetStringValue(); } }, - {"userStatus", n => { UserStatus = n.GetIntValue(); } }, - {"username", n => { Username = n.GetStringValue(); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteStringValue("email", Email); - writer.WriteStringValue("firstName", FirstName); - writer.WriteLongValue("id", Id); - writer.WriteStringValue("lastName", LastName); - writer.WriteStringValue("password", Password); - writer.WriteStringValue("phone", Phone); - writer.WriteStringValue("username", Username); - writer.WriteIntValue("userStatus", UserStatus); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Pet/FindByStatus/FindByStatusRequestBuilder.cs b/dotnet/src/WebApp/ApiClients/Pet/FindByStatus/FindByStatusRequestBuilder.cs deleted file mode 100644 index 12893e8..0000000 --- a/dotnet/src/WebApp/ApiClients/Pet/FindByStatus/FindByStatusRequestBuilder.cs +++ /dev/null @@ -1,108 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Threading; -using System; -using WebApp.ApiClients.Models; -namespace WebApp.ApiClients.Pet.FindByStatus { - /// - /// Builds and executes requests for operations under \pet\findByStatus - /// - public class FindByStatusRequestBuilder : BaseRequestBuilder - { - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public FindByStatusRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pet/findByStatus{?status*}", pathParameters) - { - } - /// - /// Instantiates a new and sets the default values. - /// - /// The raw URL to use for the request builder. - /// The request adapter to use to execute the requests. - public FindByStatusRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pet/findByStatus{?status*}", rawUrl) - { - } - /// - /// Multiple status values can be provided with comma separated strings - /// - /// A List<WebApp.ApiClients.Models.Pet> - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - var requestInfo = ToGetRequestInformation(requestConfiguration); - var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, WebApp.ApiClients.Models.Pet.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); - return collectionResult?.ToList(); - } - /// - /// Multiple status values can be provided with comma separated strings - /// - /// A - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) - { -#endif - var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - requestInfo.Headers.TryAdd("Accept", "application/json"); - return requestInfo; - } - /// - /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. - /// - /// A - /// The raw URL to use for the request builder. - public FindByStatusRequestBuilder WithUrl(string rawUrl) - { - return new FindByStatusRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// Multiple status values can be provided with comma separated strings - /// - public class FindByStatusRequestBuilderGetQueryParameters - { - /// Status values that need to be considered for filter - [Obsolete("This property is deprecated, use StatusAsGetStatusQueryParameterType instead")] -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - [QueryParameter("status")] - public string? Status { get; set; } -#nullable restore -#else - [QueryParameter("status")] - public string Status { get; set; } -#endif - /// Status values that need to be considered for filter - [QueryParameter("status")] - public GetStatusQueryParameterType? StatusAsGetStatusQueryParameterType { get; set; } - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class FindByStatusRequestBuilderGetRequestConfiguration : RequestConfiguration - { - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Pet/FindByStatus/GetStatusQueryParameterType.cs b/dotnet/src/WebApp/ApiClients/Pet/FindByStatus/GetStatusQueryParameterType.cs deleted file mode 100644 index 0954360..0000000 --- a/dotnet/src/WebApp/ApiClients/Pet/FindByStatus/GetStatusQueryParameterType.cs +++ /dev/null @@ -1,14 +0,0 @@ -// -using System.Runtime.Serialization; -using System; -namespace WebApp.ApiClients.Pet.FindByStatus { - public enum GetStatusQueryParameterType - { - [EnumMember(Value = "available")] - Available, - [EnumMember(Value = "pending")] - Pending, - [EnumMember(Value = "sold")] - Sold, - } -} diff --git a/dotnet/src/WebApp/ApiClients/Pet/FindByTags/FindByTagsRequestBuilder.cs b/dotnet/src/WebApp/ApiClients/Pet/FindByTags/FindByTagsRequestBuilder.cs deleted file mode 100644 index 1266564..0000000 --- a/dotnet/src/WebApp/ApiClients/Pet/FindByTags/FindByTagsRequestBuilder.cs +++ /dev/null @@ -1,104 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Threading; -using System; -using WebApp.ApiClients.Models; -namespace WebApp.ApiClients.Pet.FindByTags { - /// - /// Builds and executes requests for operations under \pet\findByTags - /// - public class FindByTagsRequestBuilder : BaseRequestBuilder - { - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public FindByTagsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pet/findByTags{?tags*}", pathParameters) - { - } - /// - /// Instantiates a new and sets the default values. - /// - /// The raw URL to use for the request builder. - /// The request adapter to use to execute the requests. - public FindByTagsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pet/findByTags{?tags*}", rawUrl) - { - } - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// A List<WebApp.ApiClients.Models.Pet> - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - var requestInfo = ToGetRequestInformation(requestConfiguration); - var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, WebApp.ApiClients.Models.Pet.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); - return collectionResult?.ToList(); - } - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// A - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) - { -#endif - var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - requestInfo.Headers.TryAdd("Accept", "application/json"); - return requestInfo; - } - /// - /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. - /// - /// A - /// The raw URL to use for the request builder. - public FindByTagsRequestBuilder WithUrl(string rawUrl) - { - return new FindByTagsRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - public class FindByTagsRequestBuilderGetQueryParameters - { - /// Tags to filter by -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - [QueryParameter("tags")] - public string[]? Tags { get; set; } -#nullable restore -#else - [QueryParameter("tags")] - public string[] Tags { get; set; } -#endif - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class FindByTagsRequestBuilderGetRequestConfiguration : RequestConfiguration - { - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Pet/Item/UploadImage/UploadImageRequestBuilder.cs b/dotnet/src/WebApp/ApiClients/Pet/Item/UploadImage/UploadImageRequestBuilder.cs deleted file mode 100644 index 6b8ebbc..0000000 --- a/dotnet/src/WebApp/ApiClients/Pet/Item/UploadImage/UploadImageRequestBuilder.cs +++ /dev/null @@ -1,105 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Threading; -using System; -using WebApp.ApiClients.Models; -namespace WebApp.ApiClients.Pet.Item.UploadImage { - /// - /// Builds and executes requests for operations under \pet\{petId}\uploadImage - /// - public class UploadImageRequestBuilder : BaseRequestBuilder - { - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public UploadImageRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pet/{petId}/uploadImage{?additionalMetadata*}", pathParameters) - { - } - /// - /// Instantiates a new and sets the default values. - /// - /// The raw URL to use for the request builder. - /// The request adapter to use to execute the requests. - public UploadImageRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pet/{petId}/uploadImage{?additionalMetadata*}", rawUrl) - { - } - /// - /// uploads an image - /// - /// A - /// Binary request body - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task PostAsync(Stream body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task PostAsync(Stream body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - _ = body ?? throw new ArgumentNullException(nameof(body)); - var requestInfo = ToPostRequestInformation(body, requestConfiguration); - return await RequestAdapter.SendAsync(requestInfo, ApiResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); - } - /// A - /// Binary request body - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToPostRequestInformation(Stream body, Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToPostRequestInformation(Stream body, Action> requestConfiguration = default) - { -#endif - _ = body ?? throw new ArgumentNullException(nameof(body)); - var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - requestInfo.Headers.TryAdd("Accept", "application/json"); - requestInfo.SetStreamContent(body, "application/octet-stream"); - return requestInfo; - } - /// - /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. - /// - /// A - /// The raw URL to use for the request builder. - public UploadImageRequestBuilder WithUrl(string rawUrl) - { - return new UploadImageRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// uploads an image - /// - public class UploadImageRequestBuilderPostQueryParameters - { - /// Additional Metadata -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - [QueryParameter("additionalMetadata")] - public string? AdditionalMetadata { get; set; } -#nullable restore -#else - [QueryParameter("additionalMetadata")] - public string AdditionalMetadata { get; set; } -#endif - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class UploadImageRequestBuilderPostRequestConfiguration : RequestConfiguration - { - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Pet/Item/WithPetItemRequestBuilder.cs b/dotnet/src/WebApp/ApiClients/Pet/Item/WithPetItemRequestBuilder.cs deleted file mode 100644 index 0ce96f6..0000000 --- a/dotnet/src/WebApp/ApiClients/Pet/Item/WithPetItemRequestBuilder.cs +++ /dev/null @@ -1,202 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Threading; -using System; -using WebApp.ApiClients.Models; -using WebApp.ApiClients.Pet.Item.UploadImage; -namespace WebApp.ApiClients.Pet.Item { - /// - /// Builds and executes requests for operations under \pet\{petId} - /// - public class WithPetItemRequestBuilder : BaseRequestBuilder - { - /// The uploadImage property - public UploadImageRequestBuilder UploadImage - { - get => new UploadImageRequestBuilder(PathParameters, RequestAdapter); - } - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public WithPetItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pet/{petId}", pathParameters) - { - } - /// - /// Instantiates a new and sets the default values. - /// - /// The raw URL to use for the request builder. - /// The request adapter to use to execute the requests. - public WithPetItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pet/{petId}", rawUrl) - { - } - /// - /// delete a pet - /// - /// A - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - var requestInfo = ToDeleteRequestInformation(requestConfiguration); - return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); - } - /// - /// Returns a single pet - /// - /// A - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - var requestInfo = ToGetRequestInformation(requestConfiguration); - return await RequestAdapter.SendAsync(requestInfo, WebApp.ApiClients.Models.Pet.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); - } - /// - /// Updates a pet in the store with form data - /// - /// A - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - var requestInfo = ToPostRequestInformation(requestConfiguration); - return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); - } - /// - /// delete a pet - /// - /// A - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) - { -#endif - var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - return requestInfo; - } - /// - /// Returns a single pet - /// - /// A - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) - { -#endif - var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - requestInfo.Headers.TryAdd("Accept", "application/json"); - return requestInfo; - } - /// A - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) - { -#endif - var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/pet/{petId}{?name*,status*}", PathParameters); - requestInfo.Configure(requestConfiguration); - return requestInfo; - } - /// - /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. - /// - /// A - /// The raw URL to use for the request builder. - public WithPetItemRequestBuilder WithUrl(string rawUrl) - { - return new WithPetItemRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class WithPetItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration - { - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class WithPetItemRequestBuilderGetRequestConfiguration : RequestConfiguration - { - } - /// - /// Updates a pet in the store with form data - /// - public class WithPetItemRequestBuilderPostQueryParameters - { - /// Name of pet that needs to be updated -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - [QueryParameter("name")] - public string? Name { get; set; } -#nullable restore -#else - [QueryParameter("name")] - public string Name { get; set; } -#endif - /// Status of pet that needs to be updated -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - [QueryParameter("status")] - public string? Status { get; set; } -#nullable restore -#else - [QueryParameter("status")] - public string Status { get; set; } -#endif - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class WithPetItemRequestBuilderPostRequestConfiguration : RequestConfiguration - { - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Pet/PetRequestBuilder.cs b/dotnet/src/WebApp/ApiClients/Pet/PetRequestBuilder.cs deleted file mode 100644 index c8a68fe..0000000 --- a/dotnet/src/WebApp/ApiClients/Pet/PetRequestBuilder.cs +++ /dev/null @@ -1,179 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Threading; -using System; -using WebApp.ApiClients.Models; -using WebApp.ApiClients.Pet.FindByStatus; -using WebApp.ApiClients.Pet.FindByTags; -using WebApp.ApiClients.Pet.Item; -namespace WebApp.ApiClients.Pet { - /// - /// Builds and executes requests for operations under \pet - /// - public class PetRequestBuilder : BaseRequestBuilder - { - /// The findByStatus property - public FindByStatusRequestBuilder FindByStatus - { - get => new FindByStatusRequestBuilder(PathParameters, RequestAdapter); - } - /// The findByTags property - public FindByTagsRequestBuilder FindByTags - { - get => new FindByTagsRequestBuilder(PathParameters, RequestAdapter); - } - /// Gets an item from the WebApp.ApiClients.pet.item collection - /// ID of pet to return - /// A - public WithPetItemRequestBuilder this[long position] - { - get - { - var urlTplParams = new Dictionary(PathParameters); - urlTplParams.Add("petId", position); - return new WithPetItemRequestBuilder(urlTplParams, RequestAdapter); - } - } - /// Gets an item from the WebApp.ApiClients.pet.item collection - /// ID of pet to return - /// A - [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] - public WithPetItemRequestBuilder this[string position] - { - get - { - var urlTplParams = new Dictionary(PathParameters); - if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("petId", position); - return new WithPetItemRequestBuilder(urlTplParams, RequestAdapter); - } - } - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public PetRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pet", pathParameters) - { - } - /// - /// Instantiates a new and sets the default values. - /// - /// The raw URL to use for the request builder. - /// The request adapter to use to execute the requests. - public PetRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/pet", rawUrl) - { - } - /// - /// Add a new pet to the store - /// - /// A - /// The request body - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task PostAsync(WebApp.ApiClients.Models.Pet body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task PostAsync(WebApp.ApiClients.Models.Pet body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - _ = body ?? throw new ArgumentNullException(nameof(body)); - var requestInfo = ToPostRequestInformation(body, requestConfiguration); - return await RequestAdapter.SendAsync(requestInfo, WebApp.ApiClients.Models.Pet.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); - } - /// - /// Update an existing pet by Id - /// - /// A - /// The request body - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task PutAsync(WebApp.ApiClients.Models.Pet body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task PutAsync(WebApp.ApiClients.Models.Pet body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - _ = body ?? throw new ArgumentNullException(nameof(body)); - var requestInfo = ToPutRequestInformation(body, requestConfiguration); - return await RequestAdapter.SendAsync(requestInfo, WebApp.ApiClients.Models.Pet.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); - } - /// - /// Add a new pet to the store - /// - /// A - /// The request body - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToPostRequestInformation(WebApp.ApiClients.Models.Pet body, Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToPostRequestInformation(WebApp.ApiClients.Models.Pet body, Action> requestConfiguration = default) - { -#endif - _ = body ?? throw new ArgumentNullException(nameof(body)); - var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - requestInfo.Headers.TryAdd("Accept", "application/json"); - requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); - return requestInfo; - } - /// - /// Update an existing pet by Id - /// - /// A - /// The request body - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToPutRequestInformation(WebApp.ApiClients.Models.Pet body, Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToPutRequestInformation(WebApp.ApiClients.Models.Pet body, Action> requestConfiguration = default) - { -#endif - _ = body ?? throw new ArgumentNullException(nameof(body)); - var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - requestInfo.Headers.TryAdd("Accept", "application/json"); - requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); - return requestInfo; - } - /// - /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. - /// - /// A - /// The raw URL to use for the request builder. - public PetRequestBuilder WithUrl(string rawUrl) - { - return new PetRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class PetRequestBuilderPostRequestConfiguration : RequestConfiguration - { - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class PetRequestBuilderPutRequestConfiguration : RequestConfiguration - { - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/PetStoreClient.cs b/dotnet/src/WebApp/ApiClients/PetStoreClient.cs deleted file mode 100644 index dc8fa35..0000000 --- a/dotnet/src/WebApp/ApiClients/PetStoreClient.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Extensions; -using Microsoft.Kiota.Abstractions; -using Microsoft.Kiota.Serialization.Form; -using Microsoft.Kiota.Serialization.Json; -using Microsoft.Kiota.Serialization.Multipart; -using Microsoft.Kiota.Serialization.Text; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System; -using WebApp.ApiClients.Pet; -using WebApp.ApiClients.Store; -using WebApp.ApiClients.User; -namespace WebApp.ApiClients { - /// - /// The main entry point of the SDK, exposes the configuration and the fluent API. - /// - public class PetStoreClient : BaseRequestBuilder - { - /// The pet property - public PetRequestBuilder Pet - { - get => new PetRequestBuilder(PathParameters, RequestAdapter); - } - /// The store property - public StoreRequestBuilder Store - { - get => new StoreRequestBuilder(PathParameters, RequestAdapter); - } - /// The user property - public UserRequestBuilder User - { - get => new UserRequestBuilder(PathParameters, RequestAdapter); - } - /// - /// Instantiates a new and sets the default values. - /// - /// The request adapter to use to execute the requests. - public PetStoreClient(IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}", new Dictionary()) - { - ApiClientBuilder.RegisterDefaultSerializer(); - ApiClientBuilder.RegisterDefaultSerializer(); - ApiClientBuilder.RegisterDefaultSerializer(); - ApiClientBuilder.RegisterDefaultSerializer(); - ApiClientBuilder.RegisterDefaultDeserializer(); - ApiClientBuilder.RegisterDefaultDeserializer(); - ApiClientBuilder.RegisterDefaultDeserializer(); - if (string.IsNullOrEmpty(RequestAdapter.BaseUrl)) - { - RequestAdapter.BaseUrl = "https://petstore3.swagger.io/api/v3"; - } - PathParameters.TryAdd("baseurl", RequestAdapter.BaseUrl); - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Store/Inventory/InventoryGetResponse.cs b/dotnet/src/WebApp/ApiClients/Store/Inventory/InventoryGetResponse.cs deleted file mode 100644 index b993a42..0000000 --- a/dotnet/src/WebApp/ApiClients/Store/Inventory/InventoryGetResponse.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace WebApp.ApiClients.Store.Inventory { - public class InventoryGetResponse : IAdditionalDataHolder, IParsable - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { get; set; } - /// - /// Instantiates a new and sets the default values. - /// - public InventoryGetResponse() - { - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static InventoryGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new InventoryGetResponse(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Store/Inventory/InventoryRequestBuilder.cs b/dotnet/src/WebApp/ApiClients/Store/Inventory/InventoryRequestBuilder.cs deleted file mode 100644 index c65a093..0000000 --- a/dotnet/src/WebApp/ApiClients/Store/Inventory/InventoryRequestBuilder.cs +++ /dev/null @@ -1,105 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Threading; -using System; -namespace WebApp.ApiClients.Store.Inventory { - /// - /// Builds and executes requests for operations under \store\inventory - /// - public class InventoryRequestBuilder : BaseRequestBuilder - { - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public InventoryRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/store/inventory", pathParameters) - { - } - /// - /// Instantiates a new and sets the default values. - /// - /// The raw URL to use for the request builder. - /// The request adapter to use to execute the requests. - public InventoryRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/store/inventory", rawUrl) - { - } - /// - /// Returns a map of status codes to quantities - /// - /// A - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task GetAsInventoryGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task GetAsInventoryGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - var requestInfo = ToGetRequestInformation(requestConfiguration); - return await RequestAdapter.SendAsync(requestInfo, InventoryGetResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); - } - /// - /// Returns a map of status codes to quantities - /// - /// A - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. - [Obsolete("This method is obsolete. Use GetAsInventoryGetResponseAsync instead.")] -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - var requestInfo = ToGetRequestInformation(requestConfiguration); - return await RequestAdapter.SendAsync(requestInfo, InventoryResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); - } - /// - /// Returns a map of status codes to quantities - /// - /// A - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) - { -#endif - var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - requestInfo.Headers.TryAdd("Accept", "application/json"); - return requestInfo; - } - /// - /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. - /// - /// A - /// The raw URL to use for the request builder. - public InventoryRequestBuilder WithUrl(string rawUrl) - { - return new InventoryRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class InventoryRequestBuilderGetRequestConfiguration : RequestConfiguration - { - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Store/Inventory/InventoryResponse.cs b/dotnet/src/WebApp/ApiClients/Store/Inventory/InventoryResponse.cs deleted file mode 100644 index 7aaef69..0000000 --- a/dotnet/src/WebApp/ApiClients/Store/Inventory/InventoryResponse.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace WebApp.ApiClients.Store.Inventory { - [Obsolete("This class is obsolete. Use InventoryGetResponse instead.")] - public class InventoryResponse : InventoryGetResponse, IParsable - { - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new InventoryResponse CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new InventoryResponse(); - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Store/Order/Item/WithOrderItemRequestBuilder.cs b/dotnet/src/WebApp/ApiClients/Store/Order/Item/WithOrderItemRequestBuilder.cs deleted file mode 100644 index bbad1b6..0000000 --- a/dotnet/src/WebApp/ApiClients/Store/Order/Item/WithOrderItemRequestBuilder.cs +++ /dev/null @@ -1,130 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Threading; -using System; -using WebApp.ApiClients.Models; -namespace WebApp.ApiClients.Store.Order.Item { - /// - /// Builds and executes requests for operations under \store\order\{orderId} - /// - public class WithOrderItemRequestBuilder : BaseRequestBuilder - { - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public WithOrderItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/store/order/{orderId}", pathParameters) - { - } - /// - /// Instantiates a new and sets the default values. - /// - /// The raw URL to use for the request builder. - /// The request adapter to use to execute the requests. - public WithOrderItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/store/order/{orderId}", rawUrl) - { - } - /// - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// A - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - var requestInfo = ToDeleteRequestInformation(requestConfiguration); - return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); - } - /// - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. - /// - /// A - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - var requestInfo = ToGetRequestInformation(requestConfiguration); - return await RequestAdapter.SendAsync(requestInfo, WebApp.ApiClients.Models.Order.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); - } - /// - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// A - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) - { -#endif - var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - return requestInfo; - } - /// - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. - /// - /// A - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) - { -#endif - var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - requestInfo.Headers.TryAdd("Accept", "application/json"); - return requestInfo; - } - /// - /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. - /// - /// A - /// The raw URL to use for the request builder. - public WithOrderItemRequestBuilder WithUrl(string rawUrl) - { - return new WithOrderItemRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class WithOrderItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration - { - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class WithOrderItemRequestBuilderGetRequestConfiguration : RequestConfiguration - { - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Store/Order/OrderRequestBuilder.cs b/dotnet/src/WebApp/ApiClients/Store/Order/OrderRequestBuilder.cs deleted file mode 100644 index 6b4745d..0000000 --- a/dotnet/src/WebApp/ApiClients/Store/Order/OrderRequestBuilder.cs +++ /dev/null @@ -1,118 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Threading; -using System; -using WebApp.ApiClients.Models; -using WebApp.ApiClients.Store.Order.Item; -namespace WebApp.ApiClients.Store.Order { - /// - /// Builds and executes requests for operations under \store\order - /// - public class OrderRequestBuilder : BaseRequestBuilder - { - /// Gets an item from the WebApp.ApiClients.store.order.item collection - /// ID of order that needs to be fetched - /// A - public WithOrderItemRequestBuilder this[long position] - { - get - { - var urlTplParams = new Dictionary(PathParameters); - urlTplParams.Add("orderId", position); - return new WithOrderItemRequestBuilder(urlTplParams, RequestAdapter); - } - } - /// Gets an item from the WebApp.ApiClients.store.order.item collection - /// ID of order that needs to be fetched - /// A - [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] - public WithOrderItemRequestBuilder this[string position] - { - get - { - var urlTplParams = new Dictionary(PathParameters); - if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("orderId", position); - return new WithOrderItemRequestBuilder(urlTplParams, RequestAdapter); - } - } - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public OrderRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/store/order", pathParameters) - { - } - /// - /// Instantiates a new and sets the default values. - /// - /// The raw URL to use for the request builder. - /// The request adapter to use to execute the requests. - public OrderRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/store/order", rawUrl) - { - } - /// - /// Place a new order in the store - /// - /// A - /// The request body - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task PostAsync(WebApp.ApiClients.Models.Order body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task PostAsync(WebApp.ApiClients.Models.Order body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - _ = body ?? throw new ArgumentNullException(nameof(body)); - var requestInfo = ToPostRequestInformation(body, requestConfiguration); - return await RequestAdapter.SendAsync(requestInfo, WebApp.ApiClients.Models.Order.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); - } - /// - /// Place a new order in the store - /// - /// A - /// The request body - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToPostRequestInformation(WebApp.ApiClients.Models.Order body, Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToPostRequestInformation(WebApp.ApiClients.Models.Order body, Action> requestConfiguration = default) - { -#endif - _ = body ?? throw new ArgumentNullException(nameof(body)); - var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - requestInfo.Headers.TryAdd("Accept", "application/json"); - requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); - return requestInfo; - } - /// - /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. - /// - /// A - /// The raw URL to use for the request builder. - public OrderRequestBuilder WithUrl(string rawUrl) - { - return new OrderRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class OrderRequestBuilderPostRequestConfiguration : RequestConfiguration - { - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/Store/StoreRequestBuilder.cs b/dotnet/src/WebApp/ApiClients/Store/StoreRequestBuilder.cs deleted file mode 100644 index 8052693..0000000 --- a/dotnet/src/WebApp/ApiClients/Store/StoreRequestBuilder.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System; -using WebApp.ApiClients.Store.Inventory; -using WebApp.ApiClients.Store.Order; -namespace WebApp.ApiClients.Store { - /// - /// Builds and executes requests for operations under \store - /// - public class StoreRequestBuilder : BaseRequestBuilder - { - /// The inventory property - public InventoryRequestBuilder Inventory - { - get => new InventoryRequestBuilder(PathParameters, RequestAdapter); - } - /// The order property - public OrderRequestBuilder Order - { - get => new OrderRequestBuilder(PathParameters, RequestAdapter); - } - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public StoreRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/store", pathParameters) - { - } - /// - /// Instantiates a new and sets the default values. - /// - /// The raw URL to use for the request builder. - /// The request adapter to use to execute the requests. - public StoreRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/store", rawUrl) - { - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/User/CreateWithList/CreateWithListRequestBuilder.cs b/dotnet/src/WebApp/ApiClients/User/CreateWithList/CreateWithListRequestBuilder.cs deleted file mode 100644 index 3d511b2..0000000 --- a/dotnet/src/WebApp/ApiClients/User/CreateWithList/CreateWithListRequestBuilder.cs +++ /dev/null @@ -1,92 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Threading; -using System; -using WebApp.ApiClients.Models; -namespace WebApp.ApiClients.User.CreateWithList { - /// - /// Builds and executes requests for operations under \user\createWithList - /// - public class CreateWithListRequestBuilder : BaseRequestBuilder - { - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public CreateWithListRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/user/createWithList", pathParameters) - { - } - /// - /// Instantiates a new and sets the default values. - /// - /// The raw URL to use for the request builder. - /// The request adapter to use to execute the requests. - public CreateWithListRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/user/createWithList", rawUrl) - { - } - /// - /// Creates list of users with given input array - /// - /// A - /// The request body - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task PostAsync(List body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task PostAsync(List body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - _ = body ?? throw new ArgumentNullException(nameof(body)); - var requestInfo = ToPostRequestInformation(body, requestConfiguration); - return await RequestAdapter.SendAsync(requestInfo, WebApp.ApiClients.Models.User.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); - } - /// - /// Creates list of users with given input array - /// - /// A - /// The request body - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToPostRequestInformation(List body, Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToPostRequestInformation(List body, Action> requestConfiguration = default) - { -#endif - _ = body ?? throw new ArgumentNullException(nameof(body)); - var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - requestInfo.Headers.TryAdd("Accept", "application/json"); - requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); - return requestInfo; - } - /// - /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. - /// - /// A - /// The raw URL to use for the request builder. - public CreateWithListRequestBuilder WithUrl(string rawUrl) - { - return new CreateWithListRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class CreateWithListRequestBuilderPostRequestConfiguration : RequestConfiguration - { - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/User/Item/WithUsernameItemRequestBuilder.cs b/dotnet/src/WebApp/ApiClients/User/Item/WithUsernameItemRequestBuilder.cs deleted file mode 100644 index 1b36289..0000000 --- a/dotnet/src/WebApp/ApiClients/User/Item/WithUsernameItemRequestBuilder.cs +++ /dev/null @@ -1,175 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Threading; -using System; -using WebApp.ApiClients.Models; -namespace WebApp.ApiClients.User.Item { - /// - /// Builds and executes requests for operations under \user\{username} - /// - public class WithUsernameItemRequestBuilder : BaseRequestBuilder - { - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public WithUsernameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/user/{username}", pathParameters) - { - } - /// - /// Instantiates a new and sets the default values. - /// - /// The raw URL to use for the request builder. - /// The request adapter to use to execute the requests. - public WithUsernameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/user/{username}", rawUrl) - { - } - /// - /// This can only be done by the logged in user. - /// - /// A - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - var requestInfo = ToDeleteRequestInformation(requestConfiguration); - return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); - } - /// - /// Get user by user name - /// - /// A - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - var requestInfo = ToGetRequestInformation(requestConfiguration); - return await RequestAdapter.SendAsync(requestInfo, WebApp.ApiClients.Models.User.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); - } - /// - /// This can only be done by the logged in user. - /// - /// A - /// The request body - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task PutAsync(WebApp.ApiClients.Models.User body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task PutAsync(WebApp.ApiClients.Models.User body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - _ = body ?? throw new ArgumentNullException(nameof(body)); - var requestInfo = ToPutRequestInformation(body, requestConfiguration); - return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); - } - /// - /// This can only be done by the logged in user. - /// - /// A - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) - { -#endif - var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - return requestInfo; - } - /// A - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) - { -#endif - var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - requestInfo.Headers.TryAdd("Accept", "application/json"); - return requestInfo; - } - /// - /// This can only be done by the logged in user. - /// - /// A - /// The request body - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToPutRequestInformation(WebApp.ApiClients.Models.User body, Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToPutRequestInformation(WebApp.ApiClients.Models.User body, Action> requestConfiguration = default) - { -#endif - _ = body ?? throw new ArgumentNullException(nameof(body)); - var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); - return requestInfo; - } - /// - /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. - /// - /// A - /// The raw URL to use for the request builder. - public WithUsernameItemRequestBuilder WithUrl(string rawUrl) - { - return new WithUsernameItemRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class WithUsernameItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration - { - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class WithUsernameItemRequestBuilderGetRequestConfiguration : RequestConfiguration - { - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class WithUsernameItemRequestBuilderPutRequestConfiguration : RequestConfiguration - { - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/User/Login/LoginRequestBuilder.cs b/dotnet/src/WebApp/ApiClients/User/Login/LoginRequestBuilder.cs deleted file mode 100644 index 1918d86..0000000 --- a/dotnet/src/WebApp/ApiClients/User/Login/LoginRequestBuilder.cs +++ /dev/null @@ -1,109 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Threading; -using System; -namespace WebApp.ApiClients.User.Login { - /// - /// Builds and executes requests for operations under \user\login - /// - public class LoginRequestBuilder : BaseRequestBuilder - { - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public LoginRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/user/login{?password*,username*}", pathParameters) - { - } - /// - /// Instantiates a new and sets the default values. - /// - /// The raw URL to use for the request builder. - /// The request adapter to use to execute the requests. - public LoginRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/user/login{?password*,username*}", rawUrl) - { - } - /// - /// Logs user into the system - /// - /// A - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - var requestInfo = ToGetRequestInformation(requestConfiguration); - return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); - } - /// A - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) - { -#endif - var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - requestInfo.Headers.TryAdd("Accept", "application/json"); - return requestInfo; - } - /// - /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. - /// - /// A - /// The raw URL to use for the request builder. - public LoginRequestBuilder WithUrl(string rawUrl) - { - return new LoginRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// Logs user into the system - /// - public class LoginRequestBuilderGetQueryParameters - { - /// The password for login in clear text -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - [QueryParameter("password")] - public string? Password { get; set; } -#nullable restore -#else - [QueryParameter("password")] - public string Password { get; set; } -#endif - /// The user name for login -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - [QueryParameter("username")] - public string? Username { get; set; } -#nullable restore -#else - [QueryParameter("username")] - public string Username { get; set; } -#endif - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class LoginRequestBuilderGetRequestConfiguration : RequestConfiguration - { - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/User/Logout/LogoutRequestBuilder.cs b/dotnet/src/WebApp/ApiClients/User/Logout/LogoutRequestBuilder.cs deleted file mode 100644 index ce04843..0000000 --- a/dotnet/src/WebApp/ApiClients/User/Logout/LogoutRequestBuilder.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Threading; -using System; -namespace WebApp.ApiClients.User.Logout { - /// - /// Builds and executes requests for operations under \user\logout - /// - public class LogoutRequestBuilder : BaseRequestBuilder - { - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public LogoutRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/user/logout", pathParameters) - { - } - /// - /// Instantiates a new and sets the default values. - /// - /// The raw URL to use for the request builder. - /// The request adapter to use to execute the requests. - public LogoutRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/user/logout", rawUrl) - { - } - /// - /// Logs out current logged in user session - /// - /// A - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - var requestInfo = ToGetRequestInformation(requestConfiguration); - return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); - } - /// A - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) - { -#endif - var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - return requestInfo; - } - /// - /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. - /// - /// A - /// The raw URL to use for the request builder. - public LogoutRequestBuilder WithUrl(string rawUrl) - { - return new LogoutRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class LogoutRequestBuilderGetRequestConfiguration : RequestConfiguration - { - } - } -} diff --git a/dotnet/src/WebApp/ApiClients/User/UserRequestBuilder.cs b/dotnet/src/WebApp/ApiClients/User/UserRequestBuilder.cs deleted file mode 100644 index d19a07c..0000000 --- a/dotnet/src/WebApp/ApiClients/User/UserRequestBuilder.cs +++ /dev/null @@ -1,128 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Threading; -using System; -using WebApp.ApiClients.Models; -using WebApp.ApiClients.User.CreateWithList; -using WebApp.ApiClients.User.Item; -using WebApp.ApiClients.User.Login; -using WebApp.ApiClients.User.Logout; -namespace WebApp.ApiClients.User { - /// - /// Builds and executes requests for operations under \user - /// - public class UserRequestBuilder : BaseRequestBuilder - { - /// The createWithList property - public CreateWithListRequestBuilder CreateWithList - { - get => new CreateWithListRequestBuilder(PathParameters, RequestAdapter); - } - /// The login property - public LoginRequestBuilder Login - { - get => new LoginRequestBuilder(PathParameters, RequestAdapter); - } - /// The logout property - public LogoutRequestBuilder Logout - { - get => new LogoutRequestBuilder(PathParameters, RequestAdapter); - } - /// Gets an item from the WebApp.ApiClients.user.item collection - /// The name that needs to be fetched. Use user1 for testing. - /// A - public WithUsernameItemRequestBuilder this[string position] - { - get - { - var urlTplParams = new Dictionary(PathParameters); - urlTplParams.Add("username", position); - return new WithUsernameItemRequestBuilder(urlTplParams, RequestAdapter); - } - } - /// - /// Instantiates a new and sets the default values. - /// - /// Path parameters for the request - /// The request adapter to use to execute the requests. - public UserRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/user", pathParameters) - { - } - /// - /// Instantiates a new and sets the default values. - /// - /// The raw URL to use for the request builder. - /// The request adapter to use to execute the requests. - public UserRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/user", rawUrl) - { - } - /// - /// This can only be done by the logged in user. - /// - /// A - /// The request body - /// Cancellation token to use when cancelling requests - /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 4XX or 5XX status code -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public async Task PostAsync(WebApp.ApiClients.Models.User body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) - { -#nullable restore -#else - public async Task PostAsync(WebApp.ApiClients.Models.User body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) - { -#endif - _ = body ?? throw new ArgumentNullException(nameof(body)); - var requestInfo = ToPostRequestInformation(body, requestConfiguration); - var errorMapping = new Dictionary> - { - {"XXX", WebApp.ApiClients.Models.User.CreateFromDiscriminatorValue}, - }; - return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); - } - /// - /// This can only be done by the logged in user. - /// - /// A - /// The request body - /// Configuration for the request such as headers, query parameters, and middleware options. -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public RequestInformation ToPostRequestInformation(WebApp.ApiClients.Models.User body, Action>? requestConfiguration = default) - { -#nullable restore -#else - public RequestInformation ToPostRequestInformation(WebApp.ApiClients.Models.User body, Action> requestConfiguration = default) - { -#endif - _ = body ?? throw new ArgumentNullException(nameof(body)); - var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); - requestInfo.Configure(requestConfiguration); - requestInfo.Headers.TryAdd("Accept", "application/json, application/xml"); - requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); - return requestInfo; - } - /// - /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. - /// - /// A - /// The raw URL to use for the request builder. - public UserRequestBuilder WithUrl(string rawUrl) - { - return new UserRequestBuilder(rawUrl, RequestAdapter); - } - /// - /// Configuration for the request such as headers, query parameters, and middleware options. - /// - [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] - public class UserRequestBuilderPostRequestConfiguration : RequestConfiguration - { - } - } -} diff --git a/dotnet/src/WebApp/Pages/Home.razor b/dotnet/src/WebApp/Pages/Home.razor index 2b40ae6..9001e0b 100644 --- a/dotnet/src/WebApp/Pages/Home.razor +++ b/dotnet/src/WebApp/Pages/Home.razor @@ -5,5 +5,3 @@

Hello, world!

Welcome to your new app. - - \ No newline at end of file diff --git a/dotnet/src/WebApp/Program.cs b/dotnet/src/WebApp/Program.cs index 712fe68..877eebd 100644 --- a/dotnet/src/WebApp/Program.cs +++ b/dotnet/src/WebApp/Program.cs @@ -2,7 +2,6 @@ using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using WebApp; -using WebApp.Extensions; var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); @@ -10,6 +9,4 @@ builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); -builder.Services.AddPetStoreClient(); - await builder.Build().RunAsync(); diff --git a/dotnet/src/WebApp/_Imports.razor b/dotnet/src/WebApp/_Imports.razor index 1c5fc96..f88255b 100644 --- a/dotnet/src/WebApp/_Imports.razor +++ b/dotnet/src/WebApp/_Imports.razor @@ -8,4 +8,3 @@ @using Microsoft.JSInterop @using WebApp @using WebApp.Layout -@using WebApp.UI \ No newline at end of file