|
| 1 | +// <auto-generated/> |
| 2 | +#pragma warning disable CS0618 |
| 3 | +using Microsoft.Graph.Models.ODataErrors; |
| 4 | +using Microsoft.Graph.Models; |
| 5 | +using Microsoft.Kiota.Abstractions.Extensions; |
| 6 | +using Microsoft.Kiota.Abstractions.Serialization; |
| 7 | +using Microsoft.Kiota.Abstractions; |
| 8 | +using System.Collections.Generic; |
| 9 | +using System.IO; |
| 10 | +using System.Threading.Tasks; |
| 11 | +using System.Threading; |
| 12 | +using System; |
| 13 | +namespace Microsoft.Graph.Devices.Provision |
| 14 | +{ |
| 15 | + /// <summary> |
| 16 | + /// Provides operations to call the provision method. |
| 17 | + /// </summary> |
| 18 | + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] |
| 19 | + public partial class ProvisionRequestBuilder : BaseRequestBuilder |
| 20 | + { |
| 21 | + /// <summary> |
| 22 | + /// Instantiates a new <see cref="global::Microsoft.Graph.Devices.Provision.ProvisionRequestBuilder"/> and sets the default values. |
| 23 | + /// </summary> |
| 24 | + /// <param name="pathParameters">Path parameters for the request</param> |
| 25 | + /// <param name="requestAdapter">The request adapter to use to execute the requests.</param> |
| 26 | + public ProvisionRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/devices/provision", pathParameters) |
| 27 | + { |
| 28 | + } |
| 29 | + /// <summary> |
| 30 | + /// Instantiates a new <see cref="global::Microsoft.Graph.Devices.Provision.ProvisionRequestBuilder"/> and sets the default values. |
| 31 | + /// </summary> |
| 32 | + /// <param name="rawUrl">The raw URL to use for the request builder.</param> |
| 33 | + /// <param name="requestAdapter">The request adapter to use to execute the requests.</param> |
| 34 | + public ProvisionRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/devices/provision", rawUrl) |
| 35 | + { |
| 36 | + } |
| 37 | + /// <summary> |
| 38 | + /// Provision a device on behalf of an approved Virtual Desktop Infrastructure (VDI) provider. This action wraps the Zero Touch Deployment (ZTD) protocol to create a device in a pending state in the customer's directory. The device can't be used for authentication until it completes its registration. The created device is stamped with a system label that identifies the approved VDI provider. Only VDI applications on Microsoft's approved list of VDI providers can successfully call this action. Calls from other applications are blocked even when the application is granted the required permission. |
| 39 | + /// Find more info here <see href="https://learn.microsoft.com/graph/api/device-provision?view=graph-rest-1.0" /> |
| 40 | + /// </summary> |
| 41 | + /// <returns>A <see cref="global::Microsoft.Graph.Models.ProvisionResponse"/></returns> |
| 42 | + /// <param name="body">The request body</param> |
| 43 | + /// <param name="cancellationToken">Cancellation token to use when cancelling requests</param> |
| 44 | + /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> |
| 45 | + /// <exception cref="global::Microsoft.Graph.Models.ODataErrors.ODataError">When receiving a 4XX or 5XX status code</exception> |
| 46 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 47 | +#nullable enable |
| 48 | + public async Task<global::Microsoft.Graph.Models.ProvisionResponse?> PostAsync(global::Microsoft.Graph.Devices.Provision.ProvisionPostRequestBody body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default) |
| 49 | + { |
| 50 | +#nullable restore |
| 51 | +#else |
| 52 | + public async Task<global::Microsoft.Graph.Models.ProvisionResponse> PostAsync(global::Microsoft.Graph.Devices.Provision.ProvisionPostRequestBody body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default) |
| 53 | + { |
| 54 | +#endif |
| 55 | + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); |
| 56 | + var requestInfo = ToPostRequestInformation(body, requestConfiguration); |
| 57 | + var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> |
| 58 | + { |
| 59 | + { "XXX", global::Microsoft.Graph.Models.ODataErrors.ODataError.CreateFromDiscriminatorValue }, |
| 60 | + }; |
| 61 | + return await RequestAdapter.SendAsync<global::Microsoft.Graph.Models.ProvisionResponse>(requestInfo, global::Microsoft.Graph.Models.ProvisionResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); |
| 62 | + } |
| 63 | + /// <summary> |
| 64 | + /// Provision a device on behalf of an approved Virtual Desktop Infrastructure (VDI) provider. This action wraps the Zero Touch Deployment (ZTD) protocol to create a device in a pending state in the customer's directory. The device can't be used for authentication until it completes its registration. The created device is stamped with a system label that identifies the approved VDI provider. Only VDI applications on Microsoft's approved list of VDI providers can successfully call this action. Calls from other applications are blocked even when the application is granted the required permission. |
| 65 | + /// </summary> |
| 66 | + /// <returns>A <see cref="RequestInformation"/></returns> |
| 67 | + /// <param name="body">The request body</param> |
| 68 | + /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> |
| 69 | +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER |
| 70 | +#nullable enable |
| 71 | + public RequestInformation ToPostRequestInformation(global::Microsoft.Graph.Devices.Provision.ProvisionPostRequestBody body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default) |
| 72 | + { |
| 73 | +#nullable restore |
| 74 | +#else |
| 75 | + public RequestInformation ToPostRequestInformation(global::Microsoft.Graph.Devices.Provision.ProvisionPostRequestBody body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default) |
| 76 | + { |
| 77 | +#endif |
| 78 | + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); |
| 79 | + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); |
| 80 | + requestInfo.Configure(requestConfiguration); |
| 81 | + requestInfo.Headers.TryAdd("Accept", "application/json"); |
| 82 | + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); |
| 83 | + return requestInfo; |
| 84 | + } |
| 85 | + /// <summary> |
| 86 | + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. |
| 87 | + /// </summary> |
| 88 | + /// <returns>A <see cref="global::Microsoft.Graph.Devices.Provision.ProvisionRequestBuilder"/></returns> |
| 89 | + /// <param name="rawUrl">The raw URL to use for the request builder.</param> |
| 90 | + public global::Microsoft.Graph.Devices.Provision.ProvisionRequestBuilder WithUrl(string rawUrl) |
| 91 | + { |
| 92 | + return new global::Microsoft.Graph.Devices.Provision.ProvisionRequestBuilder(rawUrl, RequestAdapter); |
| 93 | + } |
| 94 | + /// <summary> |
| 95 | + /// Configuration for the request such as headers, query parameters, and middleware options. |
| 96 | + /// </summary> |
| 97 | + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] |
| 98 | + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] |
| 99 | + public partial class ProvisionRequestBuilderPostRequestConfiguration : RequestConfiguration<DefaultQueryParameters> |
| 100 | + { |
| 101 | + } |
| 102 | + } |
| 103 | +} |
| 104 | +#pragma warning restore CS0618 |
0 commit comments