|
| 1 | +// <auto-generated/> |
| 2 | +using Microsoft.Kiota.Abstractions.Serialization; |
| 3 | +using Microsoft.Kiota.Abstractions; |
| 4 | +using OpenApiKiotaClientExample.GeneratedCode.Models; |
| 5 | +using System.Collections.Generic; |
| 6 | +using System.IO; |
| 7 | +using System.Linq; |
| 8 | +using System.Threading.Tasks; |
| 9 | +using System.Threading; |
| 10 | +using System; |
| 11 | +namespace OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.AssignedTodoItems { |
| 12 | + /// <summary> |
| 13 | + /// Builds and executes requests for operations under \api\people\{id}\assignedTodoItems |
| 14 | + /// </summary> |
| 15 | + public class AssignedTodoItemsRequestBuilder : BaseRequestBuilder { |
| 16 | + /// <summary> |
| 17 | + /// Instantiates a new AssignedTodoItemsRequestBuilder and sets the default values. |
| 18 | + /// </summary> |
| 19 | + /// <param name="pathParameters">Path parameters for the request</param> |
| 20 | + /// <param name="requestAdapter">The request adapter to use to execute the requests.</param> |
| 21 | + public AssignedTodoItemsRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/people/{id}/assignedTodoItems{?query*}", pathParameters) { |
| 22 | + } |
| 23 | + /// <summary> |
| 24 | + /// Instantiates a new AssignedTodoItemsRequestBuilder and sets the default values. |
| 25 | + /// </summary> |
| 26 | + /// <param name="rawUrl">The raw URL to use for the request builder.</param> |
| 27 | + /// <param name="requestAdapter">The request adapter to use to execute the requests.</param> |
| 28 | + public AssignedTodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/people/{id}/assignedTodoItems{?query*}", rawUrl) { |
| 29 | + } |
| 30 | + /// <summary> |
| 31 | + /// Retrieves the related todoItems of an individual person's assignedTodoItems relationship. |
| 32 | + /// </summary> |
| 33 | + /// <param name="cancellationToken">Cancellation token to use when cancelling requests</param> |
| 34 | + /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> |
| 35 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 36 | +#nullable enable |
| 37 | + public async Task<TodoItemCollectionResponseDocument?> GetAsync(Action<RequestConfiguration<AssignedTodoItemsRequestBuilderGetQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default) { |
| 38 | +#nullable restore |
| 39 | +#else |
| 40 | + public async Task<TodoItemCollectionResponseDocument> GetAsync(Action<RequestConfiguration<AssignedTodoItemsRequestBuilderGetQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default) { |
| 41 | +#endif |
| 42 | + var requestInfo = ToGetRequestInformation(requestConfiguration); |
| 43 | + var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> { |
| 44 | + {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, |
| 45 | + {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, |
| 46 | + }; |
| 47 | + return await RequestAdapter.SendAsync<TodoItemCollectionResponseDocument>(requestInfo, TodoItemCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); |
| 48 | + } |
| 49 | + /// <summary> |
| 50 | + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. |
| 51 | + /// </summary> |
| 52 | + /// <param name="cancellationToken">Cancellation token to use when cancelling requests</param> |
| 53 | + /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> |
| 54 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 55 | +#nullable enable |
| 56 | + public async Task<Stream?> HeadAsync(Action<RequestConfiguration<AssignedTodoItemsRequestBuilderHeadQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default) { |
| 57 | +#nullable restore |
| 58 | +#else |
| 59 | + public async Task<Stream> HeadAsync(Action<RequestConfiguration<AssignedTodoItemsRequestBuilderHeadQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default) { |
| 60 | +#endif |
| 61 | + var requestInfo = ToHeadRequestInformation(requestConfiguration); |
| 62 | + return await RequestAdapter.SendPrimitiveAsync<Stream>(requestInfo, default, cancellationToken).ConfigureAwait(false); |
| 63 | + } |
| 64 | + /// <summary> |
| 65 | + /// Retrieves the related todoItems of an individual person's assignedTodoItems relationship. |
| 66 | + /// </summary> |
| 67 | + /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> |
| 68 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 69 | +#nullable enable |
| 70 | + public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<AssignedTodoItemsRequestBuilderGetQueryParameters>>? requestConfiguration = default) { |
| 71 | +#nullable restore |
| 72 | +#else |
| 73 | + public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<AssignedTodoItemsRequestBuilderGetQueryParameters>> requestConfiguration = default) { |
| 74 | +#endif |
| 75 | + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); |
| 76 | + requestInfo.Configure(requestConfiguration); |
| 77 | + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); |
| 78 | + return requestInfo; |
| 79 | + } |
| 80 | + /// <summary> |
| 81 | + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. |
| 82 | + /// </summary> |
| 83 | + /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> |
| 84 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 85 | +#nullable enable |
| 86 | + public RequestInformation ToHeadRequestInformation(Action<RequestConfiguration<AssignedTodoItemsRequestBuilderHeadQueryParameters>>? requestConfiguration = default) { |
| 87 | +#nullable restore |
| 88 | +#else |
| 89 | + public RequestInformation ToHeadRequestInformation(Action<RequestConfiguration<AssignedTodoItemsRequestBuilderHeadQueryParameters>> requestConfiguration = default) { |
| 90 | +#endif |
| 91 | + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); |
| 92 | + requestInfo.Configure(requestConfiguration); |
| 93 | + return requestInfo; |
| 94 | + } |
| 95 | + /// <summary> |
| 96 | + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. |
| 97 | + /// </summary> |
| 98 | + /// <param name="rawUrl">The raw URL to use for the request builder.</param> |
| 99 | + public AssignedTodoItemsRequestBuilder WithUrl(string rawUrl) { |
| 100 | + return new AssignedTodoItemsRequestBuilder(rawUrl, RequestAdapter); |
| 101 | + } |
| 102 | + /// <summary> |
| 103 | + /// Retrieves the related todoItems of an individual person's assignedTodoItems relationship. |
| 104 | + /// </summary> |
| 105 | + public class AssignedTodoItemsRequestBuilderGetQueryParameters { |
| 106 | + /// <summary>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.</summary> |
| 107 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 108 | +#nullable enable |
| 109 | + [QueryParameter("query")] |
| 110 | + public string? Query { get; set; } |
| 111 | +#nullable restore |
| 112 | +#else |
| 113 | + [QueryParameter("query")] |
| 114 | + public string Query { get; set; } |
| 115 | +#endif |
| 116 | + } |
| 117 | + /// <summary> |
| 118 | + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. |
| 119 | + /// </summary> |
| 120 | + public class AssignedTodoItemsRequestBuilderHeadQueryParameters { |
| 121 | + /// <summary>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.</summary> |
| 122 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 123 | +#nullable enable |
| 124 | + [QueryParameter("query")] |
| 125 | + public string? Query { get; set; } |
| 126 | +#nullable restore |
| 127 | +#else |
| 128 | + [QueryParameter("query")] |
| 129 | + public string Query { get; set; } |
| 130 | +#endif |
| 131 | + } |
| 132 | + } |
| 133 | +} |
0 commit comments