|
| 1 | +package com.microsoft.graph.beta.devicemanagement.virtualendpoint.deviceimages.item.retryupload; |
| 2 | + |
| 3 | +import com.microsoft.graph.beta.models.odataerrors.ODataError; |
| 4 | +import com.microsoft.kiota.BaseRequestBuilder; |
| 5 | +import com.microsoft.kiota.BaseRequestConfiguration; |
| 6 | +import com.microsoft.kiota.HttpMethod; |
| 7 | +import com.microsoft.kiota.RequestAdapter; |
| 8 | +import com.microsoft.kiota.RequestInformation; |
| 9 | +import com.microsoft.kiota.RequestOption; |
| 10 | +import com.microsoft.kiota.serialization.Parsable; |
| 11 | +import com.microsoft.kiota.serialization.ParsableFactory; |
| 12 | +import java.util.Collection; |
| 13 | +import java.util.HashMap; |
| 14 | +import java.util.Map; |
| 15 | +import java.util.Objects; |
| 16 | +/** |
| 17 | + * Provides operations to call the retryUpload method. |
| 18 | + */ |
| 19 | +@jakarta.annotation.Generated("com.microsoft.kiota") |
| 20 | +public class RetryUploadRequestBuilder extends BaseRequestBuilder { |
| 21 | + /** |
| 22 | + * Instantiates a new {@link RetryUploadRequestBuilder} and sets the default values. |
| 23 | + * @param pathParameters Path parameters for the request |
| 24 | + * @param requestAdapter The request adapter to use to execute the requests. |
| 25 | + */ |
| 26 | + public RetryUploadRequestBuilder(@jakarta.annotation.Nonnull final HashMap<String, Object> pathParameters, @jakarta.annotation.Nonnull final RequestAdapter requestAdapter) { |
| 27 | + super(requestAdapter, "{+baseurl}/deviceManagement/virtualEndpoint/deviceImages/{cloudPcDeviceImage%2Did}/retryUpload", pathParameters); |
| 28 | + } |
| 29 | + /** |
| 30 | + * Instantiates a new {@link RetryUploadRequestBuilder} and sets the default values. |
| 31 | + * @param rawUrl The raw URL to use for the request builder. |
| 32 | + * @param requestAdapter The request adapter to use to execute the requests. |
| 33 | + */ |
| 34 | + public RetryUploadRequestBuilder(@jakarta.annotation.Nonnull final String rawUrl, @jakarta.annotation.Nonnull final RequestAdapter requestAdapter) { |
| 35 | + super(requestAdapter, "{+baseurl}/deviceManagement/virtualEndpoint/deviceImages/{cloudPcDeviceImage%2Did}/retryUpload", rawUrl); |
| 36 | + } |
| 37 | + /** |
| 38 | + * Retry the upload of a cloudPcDeviceImage object that previously failed. |
| 39 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 40 | + * @see <a href="https://learn.microsoft.com/graph/api/cloudpcdeviceimage-retryupload?view=graph-rest-beta">Find more info here</a> |
| 41 | + */ |
| 42 | + public void post() { |
| 43 | + post(null); |
| 44 | + } |
| 45 | + /** |
| 46 | + * Retry the upload of a cloudPcDeviceImage object that previously failed. |
| 47 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 48 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 49 | + * @see <a href="https://learn.microsoft.com/graph/api/cloudpcdeviceimage-retryupload?view=graph-rest-beta">Find more info here</a> |
| 50 | + */ |
| 51 | + public void post(@jakarta.annotation.Nullable final java.util.function.Consumer<PostRequestConfiguration> requestConfiguration) { |
| 52 | + final RequestInformation requestInfo = toPostRequestInformation(requestConfiguration); |
| 53 | + final HashMap<String, ParsableFactory<? extends Parsable>> errorMapping = new HashMap<String, ParsableFactory<? extends Parsable>>(); |
| 54 | + errorMapping.put("XXX", ODataError::createFromDiscriminatorValue); |
| 55 | + this.requestAdapter.sendPrimitive(requestInfo, errorMapping, Void.class); |
| 56 | + } |
| 57 | + /** |
| 58 | + * Retry the upload of a cloudPcDeviceImage object that previously failed. |
| 59 | + * @return a {@link RequestInformation} |
| 60 | + */ |
| 61 | + @jakarta.annotation.Nonnull |
| 62 | + public RequestInformation toPostRequestInformation() { |
| 63 | + return toPostRequestInformation(null); |
| 64 | + } |
| 65 | + /** |
| 66 | + * Retry the upload of a cloudPcDeviceImage object that previously failed. |
| 67 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 68 | + * @return a {@link RequestInformation} |
| 69 | + */ |
| 70 | + @jakarta.annotation.Nonnull |
| 71 | + public RequestInformation toPostRequestInformation(@jakarta.annotation.Nullable final java.util.function.Consumer<PostRequestConfiguration> requestConfiguration) { |
| 72 | + final RequestInformation requestInfo = new RequestInformation(HttpMethod.POST, urlTemplate, pathParameters); |
| 73 | + requestInfo.configure(requestConfiguration, PostRequestConfiguration::new); |
| 74 | + requestInfo.headers.tryAdd("Accept", "application/json"); |
| 75 | + return requestInfo; |
| 76 | + } |
| 77 | + /** |
| 78 | + * Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. |
| 79 | + * @param rawUrl The raw URL to use for the request builder. |
| 80 | + * @return a {@link RetryUploadRequestBuilder} |
| 81 | + */ |
| 82 | + @jakarta.annotation.Nonnull |
| 83 | + public RetryUploadRequestBuilder withUrl(@jakarta.annotation.Nonnull final String rawUrl) { |
| 84 | + Objects.requireNonNull(rawUrl); |
| 85 | + return new RetryUploadRequestBuilder(rawUrl, requestAdapter); |
| 86 | + } |
| 87 | + /** |
| 88 | + * Configuration for the request such as headers, query parameters, and middleware options. |
| 89 | + */ |
| 90 | + @jakarta.annotation.Generated("com.microsoft.kiota") |
| 91 | + public class PostRequestConfiguration extends BaseRequestConfiguration { |
| 92 | + } |
| 93 | +} |
0 commit comments