|
| 1 | +package com.microsoft.graph.beta.devicemanagement.androidmanagedstoreaccountenterprisesettings.requestenterpriseupgradeurl; |
| 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 requestEnterpriseUpgradeUrl method. |
| 18 | + */ |
| 19 | +@jakarta.annotation.Generated("com.microsoft.kiota") |
| 20 | +public class RequestEnterpriseUpgradeUrlRequestBuilder extends BaseRequestBuilder { |
| 21 | + /** |
| 22 | + * Instantiates a new {@link RequestEnterpriseUpgradeUrlRequestBuilder} 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 RequestEnterpriseUpgradeUrlRequestBuilder(@jakarta.annotation.Nonnull final HashMap<String, Object> pathParameters, @jakarta.annotation.Nonnull final RequestAdapter requestAdapter) { |
| 27 | + super(requestAdapter, "{+baseurl}/deviceManagement/androidManagedStoreAccountEnterpriseSettings/requestEnterpriseUpgradeUrl", pathParameters); |
| 28 | + } |
| 29 | + /** |
| 30 | + * Instantiates a new {@link RequestEnterpriseUpgradeUrlRequestBuilder} 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 RequestEnterpriseUpgradeUrlRequestBuilder(@jakarta.annotation.Nonnull final String rawUrl, @jakarta.annotation.Nonnull final RequestAdapter requestAdapter) { |
| 35 | + super(requestAdapter, "{+baseurl}/deviceManagement/androidManagedStoreAccountEnterpriseSettings/requestEnterpriseUpgradeUrl", rawUrl); |
| 36 | + } |
| 37 | + /** |
| 38 | + * Invoke action requestEnterpriseUpgradeUrl |
| 39 | + * @return a {@link RequestEnterpriseUpgradeUrlPostResponse} |
| 40 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 41 | + */ |
| 42 | + @jakarta.annotation.Nullable |
| 43 | + public RequestEnterpriseUpgradeUrlPostResponse post() { |
| 44 | + return post(null); |
| 45 | + } |
| 46 | + /** |
| 47 | + * Invoke action requestEnterpriseUpgradeUrl |
| 48 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 49 | + * @return a {@link RequestEnterpriseUpgradeUrlPostResponse} |
| 50 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 51 | + */ |
| 52 | + @jakarta.annotation.Nullable |
| 53 | + public RequestEnterpriseUpgradeUrlPostResponse post(@jakarta.annotation.Nullable final java.util.function.Consumer<PostRequestConfiguration> requestConfiguration) { |
| 54 | + final RequestInformation requestInfo = toPostRequestInformation(requestConfiguration); |
| 55 | + final HashMap<String, ParsableFactory<? extends Parsable>> errorMapping = new HashMap<String, ParsableFactory<? extends Parsable>>(); |
| 56 | + errorMapping.put("XXX", ODataError::createFromDiscriminatorValue); |
| 57 | + return this.requestAdapter.send(requestInfo, errorMapping, RequestEnterpriseUpgradeUrlPostResponse::createFromDiscriminatorValue); |
| 58 | + } |
| 59 | + /** |
| 60 | + * Invoke action requestEnterpriseUpgradeUrl |
| 61 | + * @return a {@link RequestInformation} |
| 62 | + */ |
| 63 | + @jakarta.annotation.Nonnull |
| 64 | + public RequestInformation toPostRequestInformation() { |
| 65 | + return toPostRequestInformation(null); |
| 66 | + } |
| 67 | + /** |
| 68 | + * Invoke action requestEnterpriseUpgradeUrl |
| 69 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 70 | + * @return a {@link RequestInformation} |
| 71 | + */ |
| 72 | + @jakarta.annotation.Nonnull |
| 73 | + public RequestInformation toPostRequestInformation(@jakarta.annotation.Nullable final java.util.function.Consumer<PostRequestConfiguration> requestConfiguration) { |
| 74 | + final RequestInformation requestInfo = new RequestInformation(HttpMethod.POST, urlTemplate, pathParameters); |
| 75 | + requestInfo.configure(requestConfiguration, PostRequestConfiguration::new); |
| 76 | + requestInfo.headers.tryAdd("Accept", "application/json"); |
| 77 | + return requestInfo; |
| 78 | + } |
| 79 | + /** |
| 80 | + * Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. |
| 81 | + * @param rawUrl The raw URL to use for the request builder. |
| 82 | + * @return a {@link RequestEnterpriseUpgradeUrlRequestBuilder} |
| 83 | + */ |
| 84 | + @jakarta.annotation.Nonnull |
| 85 | + public RequestEnterpriseUpgradeUrlRequestBuilder withUrl(@jakarta.annotation.Nonnull final String rawUrl) { |
| 86 | + Objects.requireNonNull(rawUrl); |
| 87 | + return new RequestEnterpriseUpgradeUrlRequestBuilder(rawUrl, requestAdapter); |
| 88 | + } |
| 89 | + /** |
| 90 | + * Configuration for the request such as headers, query parameters, and middleware options. |
| 91 | + */ |
| 92 | + @jakarta.annotation.Generated("com.microsoft.kiota") |
| 93 | + public class PostRequestConfiguration extends BaseRequestConfiguration { |
| 94 | + } |
| 95 | +} |
0 commit comments