|
| 1 | +// <auto-generated/> |
| 2 | +#pragma warning disable CS0618 |
| 3 | +using Microsoft.Graph.Models.ODataErrors; |
| 4 | +using Microsoft.Kiota.Abstractions.Extensions; |
| 5 | +using Microsoft.Kiota.Abstractions.Serialization; |
| 6 | +using Microsoft.Kiota.Abstractions; |
| 7 | +using System.Collections.Generic; |
| 8 | +using System.IO; |
| 9 | +using System.Threading.Tasks; |
| 10 | +using System.Threading; |
| 11 | +using System; |
| 12 | +namespace Microsoft.Graph.Chats.Item.Members.Remove |
| 13 | +{ |
| 14 | + /// <summary> |
| 15 | + /// Provides operations to call the remove method. |
| 16 | + /// </summary> |
| 17 | + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] |
| 18 | + public partial class RemoveRequestBuilder : BaseRequestBuilder |
| 19 | + { |
| 20 | + /// <summary> |
| 21 | + /// Instantiates a new <see cref="global::Microsoft.Graph.Chats.Item.Members.Remove.RemoveRequestBuilder"/> and sets the default values. |
| 22 | + /// </summary> |
| 23 | + /// <param name="pathParameters">Path parameters for the request</param> |
| 24 | + /// <param name="requestAdapter">The request adapter to use to execute the requests.</param> |
| 25 | + public RemoveRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/chats/{chat%2Did}/members/remove", pathParameters) |
| 26 | + { |
| 27 | + } |
| 28 | + /// <summary> |
| 29 | + /// Instantiates a new <see cref="global::Microsoft.Graph.Chats.Item.Members.Remove.RemoveRequestBuilder"/> and sets the default values. |
| 30 | + /// </summary> |
| 31 | + /// <param name="rawUrl">The raw URL to use for the request builder.</param> |
| 32 | + /// <param name="requestAdapter">The request adapter to use to execute the requests.</param> |
| 33 | + public RemoveRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/chats/{chat%2Did}/members/remove", rawUrl) |
| 34 | + { |
| 35 | + } |
| 36 | + /// <summary> |
| 37 | + /// Remove multiple members from a team in a single request. The response provides details about which memberships could and couldn't be removed. |
| 38 | + /// Find more info here <see href="https://learn.microsoft.com/graph/api/conversationmember-remove?view=graph-rest-1.0" /> |
| 39 | + /// </summary> |
| 40 | + /// <returns>A <see cref="global::Microsoft.Graph.Chats.Item.Members.Remove.RemovePostResponse"/></returns> |
| 41 | + /// <param name="body">The request body</param> |
| 42 | + /// <param name="cancellationToken">Cancellation token to use when cancelling requests</param> |
| 43 | + /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> |
| 44 | + /// <exception cref="global::Microsoft.Graph.Models.ODataErrors.ODataError">When receiving a 4XX or 5XX status code</exception> |
| 45 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 46 | +#nullable enable |
| 47 | + public async Task<global::Microsoft.Graph.Chats.Item.Members.Remove.RemovePostResponse?> PostAsRemovePostResponseAsync(global::Microsoft.Graph.Chats.Item.Members.Remove.RemovePostRequestBody body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default) |
| 48 | + { |
| 49 | +#nullable restore |
| 50 | +#else |
| 51 | + public async Task<global::Microsoft.Graph.Chats.Item.Members.Remove.RemovePostResponse> PostAsRemovePostResponseAsync(global::Microsoft.Graph.Chats.Item.Members.Remove.RemovePostRequestBody body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default) |
| 52 | + { |
| 53 | +#endif |
| 54 | + _ = body ?? throw new ArgumentNullException(nameof(body)); |
| 55 | + var requestInfo = ToPostRequestInformation(body, requestConfiguration); |
| 56 | + var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> |
| 57 | + { |
| 58 | + { "XXX", global::Microsoft.Graph.Models.ODataErrors.ODataError.CreateFromDiscriminatorValue }, |
| 59 | + }; |
| 60 | + return await RequestAdapter.SendAsync<global::Microsoft.Graph.Chats.Item.Members.Remove.RemovePostResponse>(requestInfo, global::Microsoft.Graph.Chats.Item.Members.Remove.RemovePostResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); |
| 61 | + } |
| 62 | + /// <summary> |
| 63 | + /// Remove multiple members from a team in a single request. The response provides details about which memberships could and couldn't be removed. |
| 64 | + /// Find more info here <see href="https://learn.microsoft.com/graph/api/conversationmember-remove?view=graph-rest-1.0" /> |
| 65 | + /// </summary> |
| 66 | + /// <returns>A <see cref="global::Microsoft.Graph.Chats.Item.Members.Remove.RemoveResponse"/></returns> |
| 67 | + /// <param name="body">The request body</param> |
| 68 | + /// <param name="cancellationToken">Cancellation token to use when cancelling requests</param> |
| 69 | + /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> |
| 70 | + /// <exception cref="global::Microsoft.Graph.Models.ODataErrors.ODataError">When receiving a 4XX or 5XX status code</exception> |
| 71 | + [Obsolete("This method is obsolete. Use PostAsRemovePostResponseAsync instead.")] |
| 72 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 73 | +#nullable enable |
| 74 | + public async Task<global::Microsoft.Graph.Chats.Item.Members.Remove.RemoveResponse?> PostAsync(global::Microsoft.Graph.Chats.Item.Members.Remove.RemovePostRequestBody body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default) |
| 75 | + { |
| 76 | +#nullable restore |
| 77 | +#else |
| 78 | + public async Task<global::Microsoft.Graph.Chats.Item.Members.Remove.RemoveResponse> PostAsync(global::Microsoft.Graph.Chats.Item.Members.Remove.RemovePostRequestBody body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default) |
| 79 | + { |
| 80 | +#endif |
| 81 | + _ = body ?? throw new ArgumentNullException(nameof(body)); |
| 82 | + var requestInfo = ToPostRequestInformation(body, requestConfiguration); |
| 83 | + var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> |
| 84 | + { |
| 85 | + { "XXX", global::Microsoft.Graph.Models.ODataErrors.ODataError.CreateFromDiscriminatorValue }, |
| 86 | + }; |
| 87 | + return await RequestAdapter.SendAsync<global::Microsoft.Graph.Chats.Item.Members.Remove.RemoveResponse>(requestInfo, global::Microsoft.Graph.Chats.Item.Members.Remove.RemoveResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); |
| 88 | + } |
| 89 | + /// <summary> |
| 90 | + /// Remove multiple members from a team in a single request. The response provides details about which memberships could and couldn't be removed. |
| 91 | + /// </summary> |
| 92 | + /// <returns>A <see cref="RequestInformation"/></returns> |
| 93 | + /// <param name="body">The request body</param> |
| 94 | + /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> |
| 95 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 96 | +#nullable enable |
| 97 | + public RequestInformation ToPostRequestInformation(global::Microsoft.Graph.Chats.Item.Members.Remove.RemovePostRequestBody body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default) |
| 98 | + { |
| 99 | +#nullable restore |
| 100 | +#else |
| 101 | + public RequestInformation ToPostRequestInformation(global::Microsoft.Graph.Chats.Item.Members.Remove.RemovePostRequestBody body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default) |
| 102 | + { |
| 103 | +#endif |
| 104 | + _ = body ?? throw new ArgumentNullException(nameof(body)); |
| 105 | + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); |
| 106 | + requestInfo.Configure(requestConfiguration); |
| 107 | + requestInfo.Headers.TryAdd("Accept", "application/json"); |
| 108 | + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); |
| 109 | + return requestInfo; |
| 110 | + } |
| 111 | + /// <summary> |
| 112 | + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. |
| 113 | + /// </summary> |
| 114 | + /// <returns>A <see cref="global::Microsoft.Graph.Chats.Item.Members.Remove.RemoveRequestBuilder"/></returns> |
| 115 | + /// <param name="rawUrl">The raw URL to use for the request builder.</param> |
| 116 | + public global::Microsoft.Graph.Chats.Item.Members.Remove.RemoveRequestBuilder WithUrl(string rawUrl) |
| 117 | + { |
| 118 | + return new global::Microsoft.Graph.Chats.Item.Members.Remove.RemoveRequestBuilder(rawUrl, RequestAdapter); |
| 119 | + } |
| 120 | + /// <summary> |
| 121 | + /// Configuration for the request such as headers, query parameters, and middleware options. |
| 122 | + /// </summary> |
| 123 | + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] |
| 124 | + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] |
| 125 | + public partial class RemoveRequestBuilderPostRequestConfiguration : RequestConfiguration<DefaultQueryParameters> |
| 126 | + { |
| 127 | + } |
| 128 | + } |
| 129 | +} |
| 130 | +#pragma warning restore CS0618 |
0 commit comments