2025-11-14 13:33:27 +00:00
// <auto-generated/>
#pragma warning disable CS0618
using Marechai.App.InstructionSetExtensionsByProcessor.Item ;
using Marechai.App.Models ;
using Microsoft.Kiota.Abstractions.Extensions ;
using Microsoft.Kiota.Abstractions.Serialization ;
using Microsoft.Kiota.Abstractions ;
using System.Collections.Generic ;
using System.IO ;
using System.Threading.Tasks ;
using System.Threading ;
using System ;
namespace Marechai.App.InstructionSetExtensionsByProcessor
{
/// <summary>
/// Builds and executes requests for operations under \instruction-set-extensions-by-processor
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
public partial class InstructionSetExtensionsByProcessorRequestBuilder : BaseRequestBuilder
{
/// <summary>Gets an item from the Marechai.App.instructionSetExtensionsByProcessor.item collection</summary>
/// <param name="position">Unique identifier of the item</param>
/// <returns>A <see cref="global::Marechai.App.InstructionSetExtensionsByProcessor.Item.InstructionSetExtensionsByProcessorItemRequestBuilder"/></returns>
public global :: Marechai . App . InstructionSetExtensionsByProcessor . Item . InstructionSetExtensionsByProcessorItemRequestBuilder this [ int position ]
{
get
{
var urlTplParams = new Dictionary < string , object > ( PathParameters ) ;
urlTplParams . Add ( "id" , position ) ;
return new global :: Marechai . App . InstructionSetExtensionsByProcessor . Item . InstructionSetExtensionsByProcessorItemRequestBuilder ( urlTplParams , RequestAdapter ) ;
}
}
/// <summary>Gets an item from the Marechai.App.instructionSetExtensionsByProcessor.item collection</summary>
/// <param name="position">Unique identifier of the item</param>
/// <returns>A <see cref="global::Marechai.App.InstructionSetExtensionsByProcessor.Item.InstructionSetExtensionsByProcessorItemRequestBuilder"/></returns>
[Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")]
public global :: Marechai . App . InstructionSetExtensionsByProcessor . Item . InstructionSetExtensionsByProcessorItemRequestBuilder this [ string position ]
{
get
{
var urlTplParams = new Dictionary < string , object > ( PathParameters ) ;
if ( ! string . IsNullOrWhiteSpace ( position ) ) urlTplParams . Add ( "id" , position ) ;
return new global :: Marechai . App . InstructionSetExtensionsByProcessor . Item . InstructionSetExtensionsByProcessorItemRequestBuilder ( urlTplParams , RequestAdapter ) ;
}
}
/// <summary>
/// Instantiates a new <see cref="global::Marechai.App.InstructionSetExtensionsByProcessor.InstructionSetExtensionsByProcessorRequestBuilder"/> and sets the default values.
/// </summary>
/// <param name="pathParameters">Path parameters for the request</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public InstructionSetExtensionsByProcessorRequestBuilder ( Dictionary < string , object > pathParameters , IRequestAdapter requestAdapter ) : base ( requestAdapter , "{+baseurl}/instruction-set-extensions-by-processor" , pathParameters )
{
}
/// <summary>
/// Instantiates a new <see cref="global::Marechai.App.InstructionSetExtensionsByProcessor.InstructionSetExtensionsByProcessorRequestBuilder"/> and sets the default values.
/// </summary>
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public InstructionSetExtensionsByProcessorRequestBuilder ( string rawUrl , IRequestAdapter requestAdapter ) : base ( requestAdapter , "{+baseurl}/instruction-set-extensions-by-processor" , rawUrl )
{
}
2025-11-15 22:41:01 +00:00
/// <returns>A <see cref="long"/></returns>
2025-11-14 13:33:27 +00:00
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 400 status code</exception>
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER | | NETCOREAPP3_1_OR_GREATER
#nullable enable
2025-11-15 22:41:01 +00:00
public async Task < long? > PostAsync ( global :: Marechai . App . Models . InstructionSetExtensionByProcessorDto body , Action < RequestConfiguration < DefaultQueryParameters > > ? requestConfiguration = default , CancellationToken cancellationToken = default )
2025-11-14 13:33:27 +00:00
{
#nullable restore
#else
2025-11-15 22:41:01 +00:00
public async Task < long? > PostAsync ( global :: Marechai . App . Models . InstructionSetExtensionByProcessorDto body , Action < RequestConfiguration < DefaultQueryParameters > > requestConfiguration = default , CancellationToken cancellationToken = default )
2025-11-14 13:33:27 +00:00
{
#endif
if ( ReferenceEquals ( body , null ) ) throw new ArgumentNullException ( nameof ( body ) ) ;
var requestInfo = ToPostRequestInformation ( body , requestConfiguration ) ;
var errorMapping = new Dictionary < string , ParsableFactory < IParsable > >
{
{ "400" , global :: Marechai . App . Models . ProblemDetails . CreateFromDiscriminatorValue } ,
{ "401" , global :: Marechai . App . Models . ProblemDetails . CreateFromDiscriminatorValue } ,
} ;
2025-11-15 22:41:01 +00:00
return await RequestAdapter . SendPrimitiveAsync < long? > ( requestInfo , errorMapping , cancellationToken ) . ConfigureAwait ( false ) ;
2025-11-14 13:33:27 +00:00
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
#if NETSTANDARD2_1_OR_GREATER | | NETCOREAPP3_1_OR_GREATER
#nullable enable
public RequestInformation ToPostRequestInformation ( global :: Marechai . App . Models . InstructionSetExtensionByProcessorDto body , Action < RequestConfiguration < DefaultQueryParameters > > ? requestConfiguration = default )
{
#nullable restore
#else
public RequestInformation ToPostRequestInformation ( global :: Marechai . App . Models . InstructionSetExtensionByProcessorDto body , Action < RequestConfiguration < DefaultQueryParameters > > requestConfiguration = default )
{
#endif
if ( ReferenceEquals ( body , null ) ) throw new ArgumentNullException ( nameof ( body ) ) ;
var requestInfo = new RequestInformation ( Method . POST , UrlTemplate , PathParameters ) ;
requestInfo . Configure ( requestConfiguration ) ;
requestInfo . Headers . TryAdd ( "Accept" , "text/plain;q=0.9" ) ;
requestInfo . SetContentFromParsable ( RequestAdapter , "application/json" , body ) ;
return requestInfo ;
}
/// <summary>
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
/// </summary>
/// <returns>A <see cref="global::Marechai.App.InstructionSetExtensionsByProcessor.InstructionSetExtensionsByProcessorRequestBuilder"/></returns>
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
public global :: Marechai . App . InstructionSetExtensionsByProcessor . InstructionSetExtensionsByProcessorRequestBuilder WithUrl ( string rawUrl )
{
return new global :: Marechai . App . InstructionSetExtensionsByProcessor . InstructionSetExtensionsByProcessorRequestBuilder ( rawUrl , RequestAdapter ) ;
}
/// <summary>
/// Configuration for the request such as headers, query parameters, and middleware options.
/// </summary>
[Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
public partial class InstructionSetExtensionsByProcessorRequestBuilderPostRequestConfiguration : RequestConfiguration < DefaultQueryParameters >
{
}
}
}
#pragma warning restore CS0618