|
| 1 | +// <auto-generated/> |
| 2 | +#pragma warning disable CS0618 |
| 3 | +using Microsoft.Agents.M365Copilot.Copilot.Admin.Settings; |
| 4 | +using Microsoft.Agents.M365Copilot.Models.ODataErrors; |
| 5 | +using Microsoft.Agents.M365Copilot.Models; |
| 6 | +using Microsoft.Kiota.Abstractions.Extensions; |
| 7 | +using Microsoft.Kiota.Abstractions.Serialization; |
| 8 | +using Microsoft.Kiota.Abstractions; |
| 9 | +using System.Collections.Generic; |
| 10 | +using System.IO; |
| 11 | +using System.Threading.Tasks; |
| 12 | +using System.Threading; |
| 13 | +using System; |
| 14 | +namespace Microsoft.Agents.M365Copilot.Copilot.Admin |
| 15 | +{ |
| 16 | + /// <summary> |
| 17 | + /// Provides operations to manage the admin property of the microsoft.graph.copilotRoot entity. |
| 18 | + /// </summary> |
| 19 | + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] |
| 20 | + public partial class AdminRequestBuilder : BaseRequestBuilder |
| 21 | + { |
| 22 | + /// <summary>Provides operations to manage the settings property of the microsoft.graph.copilotAdmin entity.</summary> |
| 23 | + public global::Microsoft.Agents.M365Copilot.Copilot.Admin.Settings.SettingsRequestBuilder Settings |
| 24 | + { |
| 25 | + get => new global::Microsoft.Agents.M365Copilot.Copilot.Admin.Settings.SettingsRequestBuilder(PathParameters, RequestAdapter); |
| 26 | + } |
| 27 | + /// <summary> |
| 28 | + /// Instantiates a new <see cref="global::Microsoft.Agents.M365Copilot.Copilot.Admin.AdminRequestBuilder"/> and sets the default values. |
| 29 | + /// </summary> |
| 30 | + /// <param name="pathParameters">Path parameters for the request</param> |
| 31 | + /// <param name="requestAdapter">The request adapter to use to execute the requests.</param> |
| 32 | + public AdminRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/copilot/admin{?%24expand,%24select}", pathParameters) |
| 33 | + { |
| 34 | + } |
| 35 | + /// <summary> |
| 36 | + /// Instantiates a new <see cref="global::Microsoft.Agents.M365Copilot.Copilot.Admin.AdminRequestBuilder"/> and sets the default values. |
| 37 | + /// </summary> |
| 38 | + /// <param name="rawUrl">The raw URL to use for the request builder.</param> |
| 39 | + /// <param name="requestAdapter">The request adapter to use to execute the requests.</param> |
| 40 | + public AdminRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/copilot/admin{?%24expand,%24select}", rawUrl) |
| 41 | + { |
| 42 | + } |
| 43 | + /// <summary> |
| 44 | + /// Delete navigation property admin for copilot |
| 45 | + /// </summary> |
| 46 | + /// <param name="cancellationToken">Cancellation token to use when cancelling requests</param> |
| 47 | + /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> |
| 48 | + /// <exception cref="global::Microsoft.Agents.M365Copilot.Models.ODataErrors.ODataError">When receiving a 4XX or 5XX status code</exception> |
| 49 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 50 | +#nullable enable |
| 51 | + public async Task DeleteAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default) |
| 52 | + { |
| 53 | +#nullable restore |
| 54 | +#else |
| 55 | + public async Task DeleteAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default) |
| 56 | + { |
| 57 | +#endif |
| 58 | + var requestInfo = ToDeleteRequestInformation(requestConfiguration); |
| 59 | + var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> |
| 60 | + { |
| 61 | + { "XXX", global::Microsoft.Agents.M365Copilot.Models.ODataErrors.ODataError.CreateFromDiscriminatorValue }, |
| 62 | + }; |
| 63 | + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); |
| 64 | + } |
| 65 | + /// <summary> |
| 66 | + /// Get admin from copilot |
| 67 | + /// </summary> |
| 68 | + /// <returns>A <see cref="global::Microsoft.Agents.M365Copilot.Models.CopilotAdmin"/></returns> |
| 69 | + /// <param name="cancellationToken">Cancellation token to use when cancelling requests</param> |
| 70 | + /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> |
| 71 | + /// <exception cref="global::Microsoft.Agents.M365Copilot.Models.ODataErrors.ODataError">When receiving a 4XX or 5XX status code</exception> |
| 72 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 73 | +#nullable enable |
| 74 | + public async Task<global::Microsoft.Agents.M365Copilot.Models.CopilotAdmin?> GetAsync(Action<RequestConfiguration<global::Microsoft.Agents.M365Copilot.Copilot.Admin.AdminRequestBuilder.AdminRequestBuilderGetQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default) |
| 75 | + { |
| 76 | +#nullable restore |
| 77 | +#else |
| 78 | + public async Task<global::Microsoft.Agents.M365Copilot.Models.CopilotAdmin> GetAsync(Action<RequestConfiguration<global::Microsoft.Agents.M365Copilot.Copilot.Admin.AdminRequestBuilder.AdminRequestBuilderGetQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default) |
| 79 | + { |
| 80 | +#endif |
| 81 | + var requestInfo = ToGetRequestInformation(requestConfiguration); |
| 82 | + var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> |
| 83 | + { |
| 84 | + { "XXX", global::Microsoft.Agents.M365Copilot.Models.ODataErrors.ODataError.CreateFromDiscriminatorValue }, |
| 85 | + }; |
| 86 | + return await RequestAdapter.SendAsync<global::Microsoft.Agents.M365Copilot.Models.CopilotAdmin>(requestInfo, global::Microsoft.Agents.M365Copilot.Models.CopilotAdmin.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); |
| 87 | + } |
| 88 | + /// <summary> |
| 89 | + /// Update the navigation property admin in copilot |
| 90 | + /// </summary> |
| 91 | + /// <returns>A <see cref="global::Microsoft.Agents.M365Copilot.Models.CopilotAdmin"/></returns> |
| 92 | + /// <param name="body">The request body</param> |
| 93 | + /// <param name="cancellationToken">Cancellation token to use when cancelling requests</param> |
| 94 | + /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> |
| 95 | + /// <exception cref="global::Microsoft.Agents.M365Copilot.Models.ODataErrors.ODataError">When receiving a 4XX or 5XX status code</exception> |
| 96 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 97 | +#nullable enable |
| 98 | + public async Task<global::Microsoft.Agents.M365Copilot.Models.CopilotAdmin?> PatchAsync(global::Microsoft.Agents.M365Copilot.Models.CopilotAdmin body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default) |
| 99 | + { |
| 100 | +#nullable restore |
| 101 | +#else |
| 102 | + public async Task<global::Microsoft.Agents.M365Copilot.Models.CopilotAdmin> PatchAsync(global::Microsoft.Agents.M365Copilot.Models.CopilotAdmin body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default) |
| 103 | + { |
| 104 | +#endif |
| 105 | + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); |
| 106 | + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); |
| 107 | + var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> |
| 108 | + { |
| 109 | + { "XXX", global::Microsoft.Agents.M365Copilot.Models.ODataErrors.ODataError.CreateFromDiscriminatorValue }, |
| 110 | + }; |
| 111 | + return await RequestAdapter.SendAsync<global::Microsoft.Agents.M365Copilot.Models.CopilotAdmin>(requestInfo, global::Microsoft.Agents.M365Copilot.Models.CopilotAdmin.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); |
| 112 | + } |
| 113 | + /// <summary> |
| 114 | + /// Delete navigation property admin for copilot |
| 115 | + /// </summary> |
| 116 | + /// <returns>A <see cref="RequestInformation"/></returns> |
| 117 | + /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> |
| 118 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 119 | +#nullable enable |
| 120 | + public RequestInformation ToDeleteRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default) |
| 121 | + { |
| 122 | +#nullable restore |
| 123 | +#else |
| 124 | + public RequestInformation ToDeleteRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default) |
| 125 | + { |
| 126 | +#endif |
| 127 | + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); |
| 128 | + requestInfo.Configure(requestConfiguration); |
| 129 | + requestInfo.Headers.TryAdd("Accept", "application/json"); |
| 130 | + return requestInfo; |
| 131 | + } |
| 132 | + /// <summary> |
| 133 | + /// Get admin from copilot |
| 134 | + /// </summary> |
| 135 | + /// <returns>A <see cref="RequestInformation"/></returns> |
| 136 | + /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> |
| 137 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 138 | +#nullable enable |
| 139 | + public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::Microsoft.Agents.M365Copilot.Copilot.Admin.AdminRequestBuilder.AdminRequestBuilderGetQueryParameters>>? requestConfiguration = default) |
| 140 | + { |
| 141 | +#nullable restore |
| 142 | +#else |
| 143 | + public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::Microsoft.Agents.M365Copilot.Copilot.Admin.AdminRequestBuilder.AdminRequestBuilderGetQueryParameters>> requestConfiguration = default) |
| 144 | + { |
| 145 | +#endif |
| 146 | + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); |
| 147 | + requestInfo.Configure(requestConfiguration); |
| 148 | + requestInfo.Headers.TryAdd("Accept", "application/json"); |
| 149 | + return requestInfo; |
| 150 | + } |
| 151 | + /// <summary> |
| 152 | + /// Update the navigation property admin in copilot |
| 153 | + /// </summary> |
| 154 | + /// <returns>A <see cref="RequestInformation"/></returns> |
| 155 | + /// <param name="body">The request body</param> |
| 156 | + /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> |
| 157 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 158 | +#nullable enable |
| 159 | + public RequestInformation ToPatchRequestInformation(global::Microsoft.Agents.M365Copilot.Models.CopilotAdmin body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default) |
| 160 | + { |
| 161 | +#nullable restore |
| 162 | +#else |
| 163 | + public RequestInformation ToPatchRequestInformation(global::Microsoft.Agents.M365Copilot.Models.CopilotAdmin body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default) |
| 164 | + { |
| 165 | +#endif |
| 166 | + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); |
| 167 | + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); |
| 168 | + requestInfo.Configure(requestConfiguration); |
| 169 | + requestInfo.Headers.TryAdd("Accept", "application/json"); |
| 170 | + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); |
| 171 | + return requestInfo; |
| 172 | + } |
| 173 | + /// <summary> |
| 174 | + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. |
| 175 | + /// </summary> |
| 176 | + /// <returns>A <see cref="global::Microsoft.Agents.M365Copilot.Copilot.Admin.AdminRequestBuilder"/></returns> |
| 177 | + /// <param name="rawUrl">The raw URL to use for the request builder.</param> |
| 178 | + public global::Microsoft.Agents.M365Copilot.Copilot.Admin.AdminRequestBuilder WithUrl(string rawUrl) |
| 179 | + { |
| 180 | + return new global::Microsoft.Agents.M365Copilot.Copilot.Admin.AdminRequestBuilder(rawUrl, RequestAdapter); |
| 181 | + } |
| 182 | + /// <summary> |
| 183 | + /// Configuration for the request such as headers, query parameters, and middleware options. |
| 184 | + /// </summary> |
| 185 | + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] |
| 186 | + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] |
| 187 | + public partial class AdminRequestBuilderDeleteRequestConfiguration : RequestConfiguration<DefaultQueryParameters> |
| 188 | + { |
| 189 | + } |
| 190 | + /// <summary> |
| 191 | + /// Get admin from copilot |
| 192 | + /// </summary> |
| 193 | + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] |
| 194 | + public partial class AdminRequestBuilderGetQueryParameters |
| 195 | + { |
| 196 | + /// <summary>Expand related entities</summary> |
| 197 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 198 | +#nullable enable |
| 199 | + [QueryParameter("%24expand")] |
| 200 | + public string[]? Expand { get; set; } |
| 201 | +#nullable restore |
| 202 | +#else |
| 203 | + [QueryParameter("%24expand")] |
| 204 | + public string[] Expand { get; set; } |
| 205 | +#endif |
| 206 | + /// <summary>Select properties to be returned</summary> |
| 207 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 208 | +#nullable enable |
| 209 | + [QueryParameter("%24select")] |
| 210 | + public string[]? Select { get; set; } |
| 211 | +#nullable restore |
| 212 | +#else |
| 213 | + [QueryParameter("%24select")] |
| 214 | + public string[] Select { get; set; } |
| 215 | +#endif |
| 216 | + } |
| 217 | + /// <summary> |
| 218 | + /// Configuration for the request such as headers, query parameters, and middleware options. |
| 219 | + /// </summary> |
| 220 | + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] |
| 221 | + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] |
| 222 | + public partial class AdminRequestBuilderGetRequestConfiguration : RequestConfiguration<global::Microsoft.Agents.M365Copilot.Copilot.Admin.AdminRequestBuilder.AdminRequestBuilderGetQueryParameters> |
| 223 | + { |
| 224 | + } |
| 225 | + /// <summary> |
| 226 | + /// Configuration for the request such as headers, query parameters, and middleware options. |
| 227 | + /// </summary> |
| 228 | + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] |
| 229 | + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] |
| 230 | + public partial class AdminRequestBuilderPatchRequestConfiguration : RequestConfiguration<DefaultQueryParameters> |
| 231 | + { |
| 232 | + } |
| 233 | + } |
| 234 | +} |
| 235 | +#pragma warning restore CS0618 |
0 commit comments