diff --git a/Directory.Build.props b/Directory.Build.props
index eeaaba8d1..49b2ba257 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -12,6 +12,7 @@
5.6.1
direct
$(NoWarn);NETSDK1215
+ $(MSBuildThisFileDirectory)kiota-patch-generated-code.ps1
diff --git a/kiota-patch-generated-code.ps1 b/kiota-patch-generated-code.ps1
new file mode 100644
index 000000000..d9488612d
--- /dev/null
+++ b/kiota-patch-generated-code.ps1
@@ -0,0 +1,28 @@
+<#
+ Patches C# code generated by kiota.
+ Workaround for bug at https://github.com/microsoft/kiota/issues/3944#issuecomment-2597201229.
+#>
+param (
+ # Path to directory where kiota generated C# code.
+ [Parameter(Mandatory=$true)]
+ [string]$kiotaOutputDir
+)
+
+$osLineBreak = [System.Environment]::NewLine
+$files = Get-ChildItem -Path $kiotaOutputDir -Recurse -Include *.cs
+
+foreach ($file in $files)
+{
+ $content = Get-Content $file -Raw
+
+ # add #nullable enable, suppress warning CS8625: Cannot convert null literal to non-nullable reference type.
+ $content = ($content -replace '// ', "// $osLineBreak#nullable enable$osLineBreak#pragma warning disable CS8625")
+
+ # remove conditionals
+ $content = ($content -replace "(?s)#if NETSTANDARD2_1_OR_GREATER .*?$osLineBreak#nullable enable$osLineBreak(?.*?)$osLineBreak#nullable restore$osLineBreak#else$osLineBreak(?.*?)$osLineBreak#endif", "`$1")
+
+ # insert new line between member and next summary
+ $content = ($content -replace "}$osLineBreak(?\s+/// )", "}$osLineBreak$osLineBreak`$1")
+
+ Set-Content -Path $file -Value $content
+}
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/ApiRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/ApiRequestBuilder.cs
index 379bfbdbb..d2897abe0 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/ApiRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/ApiRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions;
@@ -23,21 +25,25 @@ public partial class ApiRequestBuilder : BaseRequestBuilder
{
get => new global::OpenApiKiotaClientExample.GeneratedCode.Api.Operations.OperationsRequestBuilder(PathParameters, RequestAdapter);
}
+
/// The people property
public global::OpenApiKiotaClientExample.GeneratedCode.Api.People.PeopleRequestBuilder People
{
get => new global::OpenApiKiotaClientExample.GeneratedCode.Api.People.PeopleRequestBuilder(PathParameters, RequestAdapter);
}
+
/// The tags property
public global::OpenApiKiotaClientExample.GeneratedCode.Api.Tags.TagsRequestBuilder Tags
{
get => new global::OpenApiKiotaClientExample.GeneratedCode.Api.Tags.TagsRequestBuilder(PathParameters, RequestAdapter);
}
+
/// The todoItems property
public global::OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.TodoItemsRequestBuilder TodoItems
{
get => new global::OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.TodoItemsRequestBuilder(PathParameters, RequestAdapter);
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -46,6 +52,7 @@ public partial class ApiRequestBuilder : BaseRequestBuilder
public ApiRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -57,3 +64,4 @@ public ApiRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(r
}
}
#pragma warning restore CS0618
+
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Operations/OperationsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Operations/OperationsRequestBuilder.cs
index 89a52a9b2..52dbf4980 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Operations/OperationsRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Operations/OperationsRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
@@ -25,6 +27,7 @@ public partial class OperationsRequestBuilder : BaseRequestBuilder
public OperationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/operations", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -33,6 +36,7 @@ public OperationsRequestBuilder(Dictionary pathParameters, IRequ
public OperationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/operations", rawUrl)
{
}
+
///
/// Performs multiple mutations in a linear and atomic manner.
///
@@ -45,15 +49,8 @@ public OperationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) :
/// When receiving a 404 status code
/// When receiving a 409 status code
/// When receiving a 422 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task PostAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.OperationsRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task PostAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.OperationsRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = ToPostRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary>
@@ -66,21 +63,15 @@ public OperationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) :
};
return await RequestAdapter.SendAsync(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.OperationsResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Performs multiple mutations in a linear and atomic manner.
///
/// A
/// The request body
/// Configuration for the request such as headers, query parameters, and middleware options.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.OperationsRequestDocument body, Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.OperationsRequestDocument body, Action> requestConfiguration = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
@@ -88,6 +79,7 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json;ext=atomic", body);
return requestInfo;
}
+
///
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
///
@@ -100,3 +92,4 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
}
}
#pragma warning restore CS0618
+
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs
index 4805f1d70..256634808 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
@@ -25,6 +27,7 @@ public partial class AssignedTodoItemsRequestBuilder : BaseRequestBuilder
public AssignedTodoItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/people/{id}/assignedTodoItems{?query*}", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -33,6 +36,7 @@ public AssignedTodoItemsRequestBuilder(Dictionary pathParameters
public AssignedTodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/people/{id}/assignedTodoItems{?query*}", rawUrl)
{
}
+
///
/// Retrieves the related todoItems of an individual person's assignedTodoItems relationship.
///
@@ -41,15 +45,8 @@ public AssignedTodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAda
/// Configuration for the request such as headers, query parameters, and middleware options.
/// When receiving a 400 status code
/// When receiving a 404 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task 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 errorMapping = new Dictionary>
{
@@ -58,60 +55,43 @@ public AssignedTodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAda
};
return await RequestAdapter.SendAsync(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
var requestInfo = ToHeadRequestInformation(requestConfiguration);
await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false);
}
+
///
/// Retrieves the related todoItems of an individual person's assignedTodoItems relationship.
///
/// 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/vnd.api+json");
return requestInfo;
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 ToHeadRequestInformation(Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default)
- {
-#endif
var requestInfo = new RequestInformation(Method.HEAD, 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.
///
@@ -121,6 +101,7 @@ public RequestInformation ToHeadRequestInformation(Action
/// Retrieves the related todoItems of an individual person's assignedTodoItems relationship.
///
@@ -128,16 +109,10 @@ public RequestInformation ToHeadRequestInformation(ActionFor syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
@@ -145,16 +120,10 @@ public partial class AssignedTodoItemsRequestBuilderGetQueryParameters
public partial class AssignedTodoItemsRequestBuilderHeadQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
}
}
#pragma warning restore CS0618
+
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs
index 121078f0c..32bf672e7 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
@@ -25,6 +27,7 @@ public partial class OwnedTodoItemsRequestBuilder : BaseRequestBuilder
public OwnedTodoItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/people/{id}/ownedTodoItems{?query*}", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -33,6 +36,7 @@ public OwnedTodoItemsRequestBuilder(Dictionary pathParameters, I
public OwnedTodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/people/{id}/ownedTodoItems{?query*}", rawUrl)
{
}
+
///
/// Retrieves the related todoItems of an individual person's ownedTodoItems relationship.
///
@@ -41,15 +45,8 @@ public OwnedTodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapte
/// Configuration for the request such as headers, query parameters, and middleware options.
/// When receiving a 400 status code
/// When receiving a 404 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task 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 errorMapping = new Dictionary>
{
@@ -58,60 +55,43 @@ public OwnedTodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapte
};
return await RequestAdapter.SendAsync(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
var requestInfo = ToHeadRequestInformation(requestConfiguration);
await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false);
}
+
///
/// Retrieves the related todoItems of an individual person's ownedTodoItems relationship.
///
/// 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/vnd.api+json");
return requestInfo;
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 ToHeadRequestInformation(Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default)
- {
-#endif
var requestInfo = new RequestInformation(Method.HEAD, 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.
///
@@ -121,6 +101,7 @@ public RequestInformation ToHeadRequestInformation(Action
/// Retrieves the related todoItems of an individual person's ownedTodoItems relationship.
///
@@ -128,16 +109,10 @@ public RequestInformation ToHeadRequestInformation(ActionFor syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
@@ -145,16 +120,10 @@ public partial class OwnedTodoItemsRequestBuilderGetQueryParameters
public partial class OwnedTodoItemsRequestBuilderHeadQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
}
}
#pragma warning restore CS0618
+
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/PeopleItemRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/PeopleItemRequestBuilder.cs
index 7348a0339..6b62743a3 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/PeopleItemRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/PeopleItemRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
@@ -25,16 +27,19 @@ public partial class PeopleItemRequestBuilder : BaseRequestBuilder
{
get => new global::OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.AssignedTodoItems.AssignedTodoItemsRequestBuilder(PathParameters, RequestAdapter);
}
+
/// The ownedTodoItems property
public global::OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.OwnedTodoItems.OwnedTodoItemsRequestBuilder OwnedTodoItems
{
get => new global::OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.OwnedTodoItems.OwnedTodoItemsRequestBuilder(PathParameters, RequestAdapter);
}
+
/// The relationships property
public global::OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.RelationshipsRequestBuilder Relationships
{
get => new global::OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter);
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -43,6 +48,7 @@ public partial class PeopleItemRequestBuilder : BaseRequestBuilder
public PeopleItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/people/{id}{?query*}", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -51,21 +57,15 @@ public PeopleItemRequestBuilder(Dictionary pathParameters, IRequ
public PeopleItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/people/{id}{?query*}", rawUrl)
{
}
+
///
/// Deletes an existing person by its identifier.
///
/// Cancellation token to use when cancelling requests
/// Configuration for the request such as headers, query parameters, and middleware options.
/// When receiving a 404 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
var requestInfo = ToDeleteRequestInformation(requestConfiguration);
var errorMapping = new Dictionary>
{
@@ -73,6 +73,7 @@ public async Task DeleteAsync(Action
/// Retrieves an individual person by its identifier.
///
@@ -81,15 +82,8 @@ public async Task DeleteAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options.
/// When receiving a 400 status code
/// When receiving a 404 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task 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 errorMapping = new Dictionary>
{
@@ -98,23 +92,18 @@ public async Task DeleteAsync(Action(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
var requestInfo = ToHeadRequestInformation(requestConfiguration);
await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false);
}
+
///
/// Updates an existing person.
///
@@ -126,15 +115,8 @@ public async Task HeadAsync(ActionWhen receiving a 404 status code
/// When receiving a 409 status code
/// When receiving a 422 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = ToPatchRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary>
@@ -146,77 +128,53 @@ public async Task HeadAsync(Action(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Deletes an existing person by its identifier.
///
/// A
/// Configuration for the request such as headers, query parameters, and middleware options.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default)
- {
-#endif
var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json");
return requestInfo;
}
+
///
/// Retrieves an individual person by its identifier.
///
/// 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/vnd.api+json");
return requestInfo;
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 ToHeadRequestInformation(Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default)
- {
-#endif
var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
return requestInfo;
}
+
///
/// Updates an existing person.
///
/// 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 ToPatchRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonRequestDocument body, Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToPatchRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonRequestDocument body, Action> requestConfiguration = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
@@ -224,6 +182,7 @@ public RequestInformation ToPatchRequestInformation(global::OpenApiKiotaClientEx
requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+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.
///
@@ -233,6 +192,7 @@ public RequestInformation ToPatchRequestInformation(global::OpenApiKiotaClientEx
{
return new global::OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.PeopleItemRequestBuilder(rawUrl, RequestAdapter);
}
+
///
/// Retrieves an individual person by its identifier.
///
@@ -240,16 +200,10 @@ public RequestInformation ToPatchRequestInformation(global::OpenApiKiotaClientEx
public partial class PeopleItemRequestBuilderGetQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
@@ -257,16 +211,10 @@ public partial class PeopleItemRequestBuilderGetQueryParameters
public partial class PeopleItemRequestBuilderHeadQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
+
///
/// Updates an existing person.
///
@@ -274,16 +222,10 @@ public partial class PeopleItemRequestBuilderHeadQueryParameters
public partial class PeopleItemRequestBuilderPatchQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
}
}
#pragma warning restore CS0618
+
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs
index a41ec8fb1..55314870e 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
@@ -25,6 +27,7 @@ public partial class AssignedTodoItemsRequestBuilder : BaseRequestBuilder
public AssignedTodoItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/people/{id}/relationships/assignedTodoItems{?query*}", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -33,6 +36,7 @@ public AssignedTodoItemsRequestBuilder(Dictionary pathParameters
public AssignedTodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/people/{id}/relationships/assignedTodoItems{?query*}", rawUrl)
{
}
+
///
/// Removes existing todoItems from the assignedTodoItems relationship of an individual person.
///
@@ -42,15 +46,8 @@ public AssignedTodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAda
/// When receiving a 400 status code
/// When receiving a 404 status code
/// When receiving a 409 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task DeleteAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task DeleteAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = ToDeleteRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary>
@@ -61,6 +58,7 @@ public async Task DeleteAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mo
};
await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Retrieves the related todoItem identities of an individual person's assignedTodoItems relationship.
///
@@ -69,15 +67,8 @@ public async Task DeleteAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mo
/// Configuration for the request such as headers, query parameters, and middleware options.
/// When receiving a 400 status code
/// When receiving a 404 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task 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 errorMapping = new Dictionary>
{
@@ -86,23 +77,18 @@ public async Task DeleteAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mo
};
return await RequestAdapter.SendAsync(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
var requestInfo = ToHeadRequestInformation(requestConfiguration);
await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false);
}
+
///
/// Assigns existing todoItems to the assignedTodoItems relationship of an individual person.
///
@@ -112,15 +98,8 @@ public async Task HeadAsync(ActionWhen receiving a 400 status code
/// When receiving a 404 status code
/// When receiving a 409 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = ToPatchRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary>
@@ -131,6 +110,7 @@ public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mod
};
await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Adds existing todoItems to the assignedTodoItems relationship of an individual person.
///
@@ -140,15 +120,8 @@ public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mod
/// When receiving a 400 status code
/// When receiving a 404 status code
/// When receiving a 409 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task PostAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task PostAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = ToPostRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary>
@@ -159,21 +132,15 @@ public async Task PostAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mode
};
await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Removes existing todoItems from the assignedTodoItems relationship of an individual person.
///
/// 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 ToDeleteRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToDeleteRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
@@ -181,58 +148,40 @@ public RequestInformation ToDeleteRequestInformation(global::OpenApiKiotaClientE
requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body);
return requestInfo;
}
+
///
/// Retrieves the related todoItem identities of an individual person's assignedTodoItems relationship.
///
/// 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/vnd.api+json");
return requestInfo;
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 ToHeadRequestInformation(Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default)
- {
-#endif
var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
return requestInfo;
}
+
///
/// Assigns existing todoItems to the assignedTodoItems relationship of an individual person.
///
/// 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 ToPatchRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToPatchRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
@@ -240,21 +189,15 @@ public RequestInformation ToPatchRequestInformation(global::OpenApiKiotaClientEx
requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body);
return requestInfo;
}
+
///
/// Adds existing todoItems to the assignedTodoItems relationship of an individual person.
///
/// A
/// The request body
/// Configuration for the request such as headers, query parameters, and middleware options.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
@@ -262,6 +205,7 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+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.
///
@@ -271,6 +215,7 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
{
return new global::OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.AssignedTodoItems.AssignedTodoItemsRequestBuilder(rawUrl, RequestAdapter);
}
+
///
/// Retrieves the related todoItem identities of an individual person's assignedTodoItems relationship.
///
@@ -278,16 +223,10 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
public partial class AssignedTodoItemsRequestBuilderGetQueryParameters
{
/// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
@@ -295,16 +234,10 @@ public partial class AssignedTodoItemsRequestBuilderGetQueryParameters
public partial class AssignedTodoItemsRequestBuilderHeadQueryParameters
{
/// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
}
}
#pragma warning restore CS0618
+
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs
index 6325765d7..09988dfdf 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
@@ -25,6 +27,7 @@ public partial class OwnedTodoItemsRequestBuilder : BaseRequestBuilder
public OwnedTodoItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/people/{id}/relationships/ownedTodoItems{?query*}", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -33,6 +36,7 @@ public OwnedTodoItemsRequestBuilder(Dictionary pathParameters, I
public OwnedTodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/people/{id}/relationships/ownedTodoItems{?query*}", rawUrl)
{
}
+
///
/// Removes existing todoItems from the ownedTodoItems relationship of an individual person.
///
@@ -42,15 +46,8 @@ public OwnedTodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapte
/// When receiving a 400 status code
/// When receiving a 404 status code
/// When receiving a 409 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task DeleteAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task DeleteAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = ToDeleteRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary>
@@ -61,6 +58,7 @@ public async Task DeleteAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mo
};
await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Retrieves the related todoItem identities of an individual person's ownedTodoItems relationship.
///
@@ -69,15 +67,8 @@ public async Task DeleteAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mo
/// Configuration for the request such as headers, query parameters, and middleware options.
/// When receiving a 400 status code
/// When receiving a 404 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task 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 errorMapping = new Dictionary>
{
@@ -86,23 +77,18 @@ public async Task DeleteAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mo
};
return await RequestAdapter.SendAsync(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
var requestInfo = ToHeadRequestInformation(requestConfiguration);
await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false);
}
+
///
/// Assigns existing todoItems to the ownedTodoItems relationship of an individual person.
///
@@ -112,15 +98,8 @@ public async Task HeadAsync(ActionWhen receiving a 400 status code
/// When receiving a 404 status code
/// When receiving a 409 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = ToPatchRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary>
@@ -131,6 +110,7 @@ public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mod
};
await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Adds existing todoItems to the ownedTodoItems relationship of an individual person.
///
@@ -140,15 +120,8 @@ public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mod
/// When receiving a 400 status code
/// When receiving a 404 status code
/// When receiving a 409 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task PostAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task PostAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = ToPostRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary>
@@ -159,21 +132,15 @@ public async Task PostAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mode
};
await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Removes existing todoItems from the ownedTodoItems relationship of an individual person.
///
/// 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 ToDeleteRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToDeleteRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
@@ -181,58 +148,40 @@ public RequestInformation ToDeleteRequestInformation(global::OpenApiKiotaClientE
requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body);
return requestInfo;
}
+
///
/// Retrieves the related todoItem identities of an individual person's ownedTodoItems relationship.
///
/// 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/vnd.api+json");
return requestInfo;
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 ToHeadRequestInformation(Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default)
- {
-#endif
var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
return requestInfo;
}
+
///
/// Assigns existing todoItems to the ownedTodoItems relationship of an individual person.
///
/// 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 ToPatchRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToPatchRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
@@ -240,21 +189,15 @@ public RequestInformation ToPatchRequestInformation(global::OpenApiKiotaClientEx
requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body);
return requestInfo;
}
+
///
/// Adds existing todoItems to the ownedTodoItems relationship of an individual person.
///
/// A
/// The request body
/// Configuration for the request such as headers, query parameters, and middleware options.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
@@ -262,6 +205,7 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+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.
///
@@ -271,6 +215,7 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
{
return new global::OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.OwnedTodoItems.OwnedTodoItemsRequestBuilder(rawUrl, RequestAdapter);
}
+
///
/// Retrieves the related todoItem identities of an individual person's ownedTodoItems relationship.
///
@@ -278,16 +223,10 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
public partial class OwnedTodoItemsRequestBuilderGetQueryParameters
{
/// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
@@ -295,16 +234,10 @@ public partial class OwnedTodoItemsRequestBuilderGetQueryParameters
public partial class OwnedTodoItemsRequestBuilderHeadQueryParameters
{
/// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
}
}
#pragma warning restore CS0618
+
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/RelationshipsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/RelationshipsRequestBuilder.cs
index eadbc34e7..057fc3b3a 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/RelationshipsRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/RelationshipsRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions;
@@ -21,11 +23,13 @@ public partial class RelationshipsRequestBuilder : BaseRequestBuilder
{
get => new global::OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.AssignedTodoItems.AssignedTodoItemsRequestBuilder(PathParameters, RequestAdapter);
}
+
/// The ownedTodoItems property
public global::OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.OwnedTodoItems.OwnedTodoItemsRequestBuilder OwnedTodoItems
{
get => new global::OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.OwnedTodoItems.OwnedTodoItemsRequestBuilder(PathParameters, RequestAdapter);
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -34,6 +38,7 @@ public partial class RelationshipsRequestBuilder : BaseRequestBuilder
public RelationshipsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/people/{id}/relationships", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -45,3 +50,4 @@ public RelationshipsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter
}
}
#pragma warning restore CS0618
+
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/PeopleRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/PeopleRequestBuilder.cs
index 71d7b6d2d..00198dc00 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/PeopleRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/PeopleRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
@@ -30,6 +32,7 @@ public partial class PeopleRequestBuilder : BaseRequestBuilder
return new global::OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.PeopleItemRequestBuilder(urlTplParams, RequestAdapter);
}
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -38,6 +41,7 @@ public partial class PeopleRequestBuilder : BaseRequestBuilder
public PeopleRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/people{?query*}", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -46,6 +50,7 @@ public PeopleRequestBuilder(Dictionary pathParameters, IRequestA
public PeopleRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/people{?query*}", rawUrl)
{
}
+
///
/// Retrieves a collection of people.
///
@@ -53,15 +58,8 @@ public PeopleRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : bas
/// Cancellation token to use when cancelling requests
/// Configuration for the request such as headers, query parameters, and middleware options.
/// When receiving a 400 status code
-#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 errorMapping = new Dictionary>
{
@@ -69,23 +67,18 @@ public PeopleRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : bas
};
return await RequestAdapter.SendAsync(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.PersonCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
var requestInfo = ToHeadRequestInformation(requestConfiguration);
await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false);
}
+
///
/// Creates a new person.
///
@@ -98,15 +91,8 @@ public async Task HeadAsync(ActionWhen receiving a 404 status code
/// When receiving a 409 status code
/// When receiving a 422 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task PostAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.CreatePersonRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task PostAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.CreatePersonRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = ToPostRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary>
@@ -119,58 +105,40 @@ public async Task HeadAsync(Action(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Retrieves a collection of people.
///
/// 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/vnd.api+json");
return requestInfo;
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 ToHeadRequestInformation(Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default)
- {
-#endif
var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
return requestInfo;
}
+
///
/// Creates a new person.
///
/// A
/// The request body
/// Configuration for the request such as headers, query parameters, and middleware options.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.CreatePersonRequestDocument body, Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.CreatePersonRequestDocument body, Action> requestConfiguration = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
@@ -178,6 +146,7 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+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.
///
@@ -187,6 +156,7 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
{
return new global::OpenApiKiotaClientExample.GeneratedCode.Api.People.PeopleRequestBuilder(rawUrl, RequestAdapter);
}
+
///
/// Retrieves a collection of people.
///
@@ -194,16 +164,10 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
public partial class PeopleRequestBuilderGetQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
@@ -211,16 +175,10 @@ public partial class PeopleRequestBuilderGetQueryParameters
public partial class PeopleRequestBuilderHeadQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
+
///
/// Creates a new person.
///
@@ -228,16 +186,10 @@ public partial class PeopleRequestBuilderHeadQueryParameters
public partial class PeopleRequestBuilderPostQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
}
}
#pragma warning restore CS0618
+
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/RelationshipsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/RelationshipsRequestBuilder.cs
index 859c1bdbc..52a7577dc 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/RelationshipsRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/RelationshipsRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions;
@@ -20,6 +22,7 @@ public partial class RelationshipsRequestBuilder : BaseRequestBuilder
{
get => new global::OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.Relationships.TodoItems.TodoItemsRequestBuilder(PathParameters, RequestAdapter);
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -28,6 +31,7 @@ public partial class RelationshipsRequestBuilder : BaseRequestBuilder
public RelationshipsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/tags/{id}/relationships", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -39,3 +43,4 @@ public RelationshipsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter
}
}
#pragma warning restore CS0618
+
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/TodoItems/TodoItemsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/TodoItems/TodoItemsRequestBuilder.cs
index 3aa92b713..972561201 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/TodoItems/TodoItemsRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/TodoItems/TodoItemsRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
@@ -25,6 +27,7 @@ public partial class TodoItemsRequestBuilder : BaseRequestBuilder
public TodoItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/tags/{id}/relationships/todoItems{?query*}", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -33,6 +36,7 @@ public TodoItemsRequestBuilder(Dictionary pathParameters, IReque
public TodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/tags/{id}/relationships/todoItems{?query*}", rawUrl)
{
}
+
///
/// Removes existing todoItems from the todoItems relationship of an individual tag.
///
@@ -42,15 +46,8 @@ public TodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) :
/// When receiving a 400 status code
/// When receiving a 404 status code
/// When receiving a 409 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task DeleteAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task DeleteAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = ToDeleteRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary>
@@ -61,6 +58,7 @@ public async Task DeleteAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mo
};
await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Retrieves the related todoItem identities of an individual tag's todoItems relationship.
///
@@ -69,15 +67,8 @@ public async Task DeleteAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mo
/// Configuration for the request such as headers, query parameters, and middleware options.
/// When receiving a 400 status code
/// When receiving a 404 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task 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 errorMapping = new Dictionary>
{
@@ -86,23 +77,18 @@ public async Task DeleteAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mo
};
return await RequestAdapter.SendAsync(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
var requestInfo = ToHeadRequestInformation(requestConfiguration);
await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false);
}
+
///
/// Assigns existing todoItems to the todoItems relationship of an individual tag.
///
@@ -112,15 +98,8 @@ public async Task HeadAsync(ActionWhen receiving a 400 status code
/// When receiving a 404 status code
/// When receiving a 409 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = ToPatchRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary>
@@ -131,6 +110,7 @@ public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mod
};
await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Adds existing todoItems to the todoItems relationship of an individual tag.
///
@@ -140,15 +120,8 @@ public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mod
/// When receiving a 400 status code
/// When receiving a 404 status code
/// When receiving a 409 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task PostAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task PostAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = ToPostRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary>
@@ -159,21 +132,15 @@ public async Task PostAsync(global::OpenApiKiotaClientExample.GeneratedCode.Mode
};
await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Removes existing todoItems from the todoItems relationship of an individual tag.
///
/// 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 ToDeleteRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToDeleteRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
@@ -181,58 +148,40 @@ public RequestInformation ToDeleteRequestInformation(global::OpenApiKiotaClientE
requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body);
return requestInfo;
}
+
///
/// Retrieves the related todoItem identities of an individual tag's todoItems relationship.
///
/// 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/vnd.api+json");
return requestInfo;
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 ToHeadRequestInformation(Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default)
- {
-#endif
var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
return requestInfo;
}
+
///
/// Assigns existing todoItems to the todoItems relationship of an individual tag.
///
/// 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 ToPatchRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToPatchRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
@@ -240,21 +189,15 @@ public RequestInformation ToPatchRequestInformation(global::OpenApiKiotaClientEx
requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body);
return requestInfo;
}
+
///
/// Adds existing todoItems to the todoItems relationship of an individual tag.
///
/// A
/// The request body
/// Configuration for the request such as headers, query parameters, and middleware options.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
@@ -262,6 +205,7 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+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.
///
@@ -271,6 +215,7 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
{
return new global::OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.Relationships.TodoItems.TodoItemsRequestBuilder(rawUrl, RequestAdapter);
}
+
///
/// Retrieves the related todoItem identities of an individual tag's todoItems relationship.
///
@@ -278,16 +223,10 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
public partial class TodoItemsRequestBuilderGetQueryParameters
{
/// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
@@ -295,16 +234,10 @@ public partial class TodoItemsRequestBuilderGetQueryParameters
public partial class TodoItemsRequestBuilderHeadQueryParameters
{
/// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
}
}
#pragma warning restore CS0618
+
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TagsItemRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TagsItemRequestBuilder.cs
index 6bba9a4b6..489d04da9 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TagsItemRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TagsItemRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
@@ -24,11 +26,13 @@ public partial class TagsItemRequestBuilder : BaseRequestBuilder
{
get => new global::OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter);
}
+
/// The todoItems property
public global::OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.TodoItems.TodoItemsRequestBuilder TodoItems
{
get => new global::OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.TodoItems.TodoItemsRequestBuilder(PathParameters, RequestAdapter);
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -37,6 +41,7 @@ public partial class TagsItemRequestBuilder : BaseRequestBuilder
public TagsItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/tags/{id}{?query*}", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -45,21 +50,15 @@ public TagsItemRequestBuilder(Dictionary pathParameters, IReques
public TagsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/tags/{id}{?query*}", rawUrl)
{
}
+
///
/// Deletes an existing tag by its identifier.
///
/// Cancellation token to use when cancelling requests
/// Configuration for the request such as headers, query parameters, and middleware options.
/// When receiving a 404 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
var requestInfo = ToDeleteRequestInformation(requestConfiguration);
var errorMapping = new Dictionary>
{
@@ -67,6 +66,7 @@ public async Task DeleteAsync(Action
/// Retrieves an individual tag by its identifier.
///
@@ -75,15 +75,8 @@ public async Task DeleteAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options.
/// When receiving a 400 status code
/// When receiving a 404 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task 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 errorMapping = new Dictionary>
{
@@ -92,23 +85,18 @@ public async Task DeleteAsync(Action(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
var requestInfo = ToHeadRequestInformation(requestConfiguration);
await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false);
}
+
///
/// Updates an existing tag.
///
@@ -120,15 +108,8 @@ public async Task HeadAsync(ActionWhen receiving a 404 status code
/// When receiving a 409 status code
/// When receiving a 422 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task PatchAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = ToPatchRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary>
@@ -140,77 +121,53 @@ public async Task HeadAsync(Action(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Deletes an existing tag by its identifier.
///
/// A
/// Configuration for the request such as headers, query parameters, and middleware options.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default)
- {
-#endif
var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json");
return requestInfo;
}
+
///
/// Retrieves an individual tag by its identifier.
///
/// 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/vnd.api+json");
return requestInfo;
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 ToHeadRequestInformation(Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default)
- {
-#endif
var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
return requestInfo;
}
+
///
/// Updates an existing tag.
///
/// 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 ToPatchRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagRequestDocument body, Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToPatchRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagRequestDocument body, Action> requestConfiguration = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
@@ -218,6 +175,7 @@ public RequestInformation ToPatchRequestInformation(global::OpenApiKiotaClientEx
requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+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.
///
@@ -227,6 +185,7 @@ public RequestInformation ToPatchRequestInformation(global::OpenApiKiotaClientEx
{
return new global::OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.TagsItemRequestBuilder(rawUrl, RequestAdapter);
}
+
///
/// Retrieves an individual tag by its identifier.
///
@@ -234,16 +193,10 @@ public RequestInformation ToPatchRequestInformation(global::OpenApiKiotaClientEx
public partial class TagsItemRequestBuilderGetQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
@@ -251,16 +204,10 @@ public partial class TagsItemRequestBuilderGetQueryParameters
public partial class TagsItemRequestBuilderHeadQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
+
///
/// Updates an existing tag.
///
@@ -268,16 +215,10 @@ public partial class TagsItemRequestBuilderHeadQueryParameters
public partial class TagsItemRequestBuilderPatchQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
}
}
#pragma warning restore CS0618
+
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TodoItems/TodoItemsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TodoItems/TodoItemsRequestBuilder.cs
index bf4536f03..192652b0b 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TodoItems/TodoItemsRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TodoItems/TodoItemsRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
@@ -25,6 +27,7 @@ public partial class TodoItemsRequestBuilder : BaseRequestBuilder
public TodoItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/tags/{id}/todoItems{?query*}", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -33,6 +36,7 @@ public TodoItemsRequestBuilder(Dictionary pathParameters, IReque
public TodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/tags/{id}/todoItems{?query*}", rawUrl)
{
}
+
///
/// Retrieves the related todoItems of an individual tag's todoItems relationship.
///
@@ -41,15 +45,8 @@ public TodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) :
/// Configuration for the request such as headers, query parameters, and middleware options.
/// When receiving a 400 status code
/// When receiving a 404 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task 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 errorMapping = new Dictionary>
{
@@ -58,60 +55,43 @@ public TodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) :
};
return await RequestAdapter.SendAsync(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
var requestInfo = ToHeadRequestInformation(requestConfiguration);
await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false);
}
+
///
/// Retrieves the related todoItems of an individual tag's todoItems relationship.
///
/// 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/vnd.api+json");
return requestInfo;
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 ToHeadRequestInformation(Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default)
- {
-#endif
var requestInfo = new RequestInformation(Method.HEAD, 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.
///
@@ -121,6 +101,7 @@ public RequestInformation ToHeadRequestInformation(Action
/// Retrieves the related todoItems of an individual tag's todoItems relationship.
///
@@ -128,16 +109,10 @@ public RequestInformation ToHeadRequestInformation(ActionFor syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
@@ -145,16 +120,10 @@ public partial class TodoItemsRequestBuilderGetQueryParameters
public partial class TodoItemsRequestBuilderHeadQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
}
}
#pragma warning restore CS0618
+
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/TagsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/TagsRequestBuilder.cs
index 929ea0967..2ebee596c 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/TagsRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/TagsRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
@@ -30,6 +32,7 @@ public partial class TagsRequestBuilder : BaseRequestBuilder
return new global::OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.TagsItemRequestBuilder(urlTplParams, RequestAdapter);
}
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -38,6 +41,7 @@ public partial class TagsRequestBuilder : BaseRequestBuilder
public TagsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/tags{?query*}", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -46,6 +50,7 @@ public TagsRequestBuilder(Dictionary pathParameters, IRequestAda
public TagsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/tags{?query*}", rawUrl)
{
}
+
///
/// Retrieves a collection of tags.
///
@@ -53,15 +58,8 @@ public TagsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(
/// Cancellation token to use when cancelling requests
/// Configuration for the request such as headers, query parameters, and middleware options.
/// When receiving a 400 status code
-#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 errorMapping = new Dictionary>
{
@@ -69,23 +67,18 @@ public TagsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(
};
return await RequestAdapter.SendAsync(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.TagCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
var requestInfo = ToHeadRequestInformation(requestConfiguration);
await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false);
}
+
///
/// Creates a new tag.
///
@@ -98,15 +91,8 @@ public async Task HeadAsync(ActionWhen receiving a 404 status code
/// When receiving a 409 status code
/// When receiving a 422 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task PostAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.CreateTagRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task PostAsync(global::OpenApiKiotaClientExample.GeneratedCode.Models.CreateTagRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = ToPostRequestInformation(body, requestConfiguration);
var errorMapping = new Dictionary>
@@ -119,58 +105,40 @@ public async Task HeadAsync(Action(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Retrieves a collection of tags.
///
/// 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/vnd.api+json");
return requestInfo;
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 ToHeadRequestInformation(Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default)
- {
-#endif
var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
return requestInfo;
}
+
///
/// Creates a new tag.
///
/// A
/// The request body
/// Configuration for the request such as headers, query parameters, and middleware options.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.CreateTagRequestDocument body, Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExample.GeneratedCode.Models.CreateTagRequestDocument body, Action> requestConfiguration = default)
- {
-#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
@@ -178,6 +146,7 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+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.
///
@@ -187,6 +156,7 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
{
return new global::OpenApiKiotaClientExample.GeneratedCode.Api.Tags.TagsRequestBuilder(rawUrl, RequestAdapter);
}
+
///
/// Retrieves a collection of tags.
///
@@ -194,16 +164,10 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa
public partial class TagsRequestBuilderGetQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
@@ -211,16 +175,10 @@ public partial class TagsRequestBuilderGetQueryParameters
public partial class TagsRequestBuilderHeadQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
+
///
/// Creates a new tag.
///
@@ -228,16 +186,10 @@ public partial class TagsRequestBuilderHeadQueryParameters
public partial class TagsRequestBuilderPostQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
}
}
#pragma warning restore CS0618
+
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Assignee/AssigneeRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Assignee/AssigneeRequestBuilder.cs
index dd7103b4f..26e3f2173 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Assignee/AssigneeRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Assignee/AssigneeRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
@@ -25,6 +27,7 @@ public partial class AssigneeRequestBuilder : BaseRequestBuilder
public AssigneeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/todoItems/{id}/assignee{?query*}", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -33,6 +36,7 @@ public AssigneeRequestBuilder(Dictionary pathParameters, IReques
public AssigneeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/todoItems/{id}/assignee{?query*}", rawUrl)
{
}
+
///
/// Retrieves the related person of an individual todoItem's assignee relationship.
///
@@ -41,15 +45,8 @@ public AssigneeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : b
/// Configuration for the request such as headers, query parameters, and middleware options.
/// When receiving a 400 status code
/// When receiving a 404 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task 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 errorMapping = new Dictionary>
{
@@ -58,60 +55,43 @@ public AssigneeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : b
};
return await RequestAdapter.SendAsync(requestInfo, global::OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
-#nullable restore
-#else
- public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
- {
-#endif
var requestInfo = ToHeadRequestInformation(requestConfiguration);
await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false);
}
+
///
/// Retrieves the related person of an individual todoItem's assignee relationship.
///
/// 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/vnd.api+json");
return requestInfo;
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
/// 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 ToHeadRequestInformation(Action>? requestConfiguration = default)
{
-#nullable restore
-#else
- public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default)
- {
-#endif
var requestInfo = new RequestInformation(Method.HEAD, 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.
///
@@ -121,6 +101,7 @@ public RequestInformation ToHeadRequestInformation(Action
/// Retrieves the related person of an individual todoItem's assignee relationship.
///
@@ -128,16 +109,10 @@ public RequestInformation ToHeadRequestInformation(ActionFor syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
+
///
/// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
///
@@ -145,16 +120,10 @@ public partial class AssigneeRequestBuilderGetQueryParameters
public partial class AssigneeRequestBuilderHeadQueryParameters
{
/// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
[QueryParameter("query")]
public string? Query { get; set; }
-#nullable restore
-#else
- [QueryParameter("query")]
- public string Query { get; set; }
-#endif
}
}
}
#pragma warning restore CS0618
+
diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Owner/OwnerRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Owner/OwnerRequestBuilder.cs
index 546f762cd..c50054073 100644
--- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Owner/OwnerRequestBuilder.cs
+++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Owner/OwnerRequestBuilder.cs
@@ -1,4 +1,6 @@
//
+#nullable enable
+#pragma warning disable CS8625
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
@@ -25,6 +27,7 @@ public partial class OwnerRequestBuilder : BaseRequestBuilder
public OwnerRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/todoItems/{id}/owner{?query*}", pathParameters)
{
}
+
///
/// Instantiates a new and sets the default values.
///
@@ -33,6 +36,7 @@ public OwnerRequestBuilder(Dictionary pathParameters, IRequestAd
public OwnerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/todoItems/{id}/owner{?query*}", rawUrl)
{
}
+
///
/// Retrieves the related person of an individual todoItem's owner relationship.
///
@@ -41,15 +45,8 @@ public OwnerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base
/// Configuration for the request such as headers, query parameters, and middleware options.
/// When receiving a 400 status code
/// When receiving a 404 status code
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
-#nullable enable
public async Task GetAsync(Action