|
| 1 | +package com.microsoft.graph.devicemanagement.virtualendpoint.serviceplans; |
| 2 | + |
| 3 | +import com.microsoft.graph.devicemanagement.virtualendpoint.serviceplans.count.CountRequestBuilder; |
| 4 | +import com.microsoft.graph.devicemanagement.virtualendpoint.serviceplans.item.CloudPcServicePlanItemRequestBuilder; |
| 5 | +import com.microsoft.graph.models.CloudPcServicePlanCollectionResponse; |
| 6 | +import com.microsoft.graph.models.odataerrors.ODataError; |
| 7 | +import com.microsoft.kiota.BaseRequestBuilder; |
| 8 | +import com.microsoft.kiota.BaseRequestConfiguration; |
| 9 | +import com.microsoft.kiota.HttpMethod; |
| 10 | +import com.microsoft.kiota.QueryParameters; |
| 11 | +import com.microsoft.kiota.RequestAdapter; |
| 12 | +import com.microsoft.kiota.RequestInformation; |
| 13 | +import com.microsoft.kiota.RequestOption; |
| 14 | +import com.microsoft.kiota.serialization.Parsable; |
| 15 | +import com.microsoft.kiota.serialization.ParsableFactory; |
| 16 | +import java.util.Collection; |
| 17 | +import java.util.HashMap; |
| 18 | +import java.util.Map; |
| 19 | +import java.util.Objects; |
| 20 | +/** |
| 21 | + * Provides operations to manage the servicePlans property of the microsoft.graph.virtualEndpoint entity. |
| 22 | + */ |
| 23 | +@jakarta.annotation.Generated("com.microsoft.kiota") |
| 24 | +public class ServicePlansRequestBuilder extends BaseRequestBuilder { |
| 25 | + /** |
| 26 | + * Provides operations to count the resources in the collection. |
| 27 | + * @return a {@link CountRequestBuilder} |
| 28 | + */ |
| 29 | + @jakarta.annotation.Nonnull |
| 30 | + public CountRequestBuilder count() { |
| 31 | + return new CountRequestBuilder(pathParameters, requestAdapter); |
| 32 | + } |
| 33 | + /** |
| 34 | + * Provides operations to manage the servicePlans property of the microsoft.graph.virtualEndpoint entity. |
| 35 | + * @param cloudPcServicePlanId The unique identifier of cloudPcServicePlan |
| 36 | + * @return a {@link CloudPcServicePlanItemRequestBuilder} |
| 37 | + */ |
| 38 | + @jakarta.annotation.Nonnull |
| 39 | + public CloudPcServicePlanItemRequestBuilder byCloudPcServicePlanId(@jakarta.annotation.Nonnull final String cloudPcServicePlanId) { |
| 40 | + Objects.requireNonNull(cloudPcServicePlanId); |
| 41 | + final HashMap<String, Object> urlTplParams = new HashMap<String, Object>(this.pathParameters); |
| 42 | + urlTplParams.put("cloudPcServicePlan%2Did", cloudPcServicePlanId); |
| 43 | + return new CloudPcServicePlanItemRequestBuilder(urlTplParams, requestAdapter); |
| 44 | + } |
| 45 | + /** |
| 46 | + * Instantiates a new {@link ServicePlansRequestBuilder} and sets the default values. |
| 47 | + * @param pathParameters Path parameters for the request |
| 48 | + * @param requestAdapter The request adapter to use to execute the requests. |
| 49 | + */ |
| 50 | + public ServicePlansRequestBuilder(@jakarta.annotation.Nonnull final HashMap<String, Object> pathParameters, @jakarta.annotation.Nonnull final RequestAdapter requestAdapter) { |
| 51 | + super(requestAdapter, "{+baseurl}/deviceManagement/virtualEndpoint/servicePlans{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters); |
| 52 | + } |
| 53 | + /** |
| 54 | + * Instantiates a new {@link ServicePlansRequestBuilder} and sets the default values. |
| 55 | + * @param rawUrl The raw URL to use for the request builder. |
| 56 | + * @param requestAdapter The request adapter to use to execute the requests. |
| 57 | + */ |
| 58 | + public ServicePlansRequestBuilder(@jakarta.annotation.Nonnull final String rawUrl, @jakarta.annotation.Nonnull final RequestAdapter requestAdapter) { |
| 59 | + super(requestAdapter, "{+baseurl}/deviceManagement/virtualEndpoint/servicePlans{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl); |
| 60 | + } |
| 61 | + /** |
| 62 | + * List the currently available service plans that an organization can purchase for their Cloud PCs. For examples of currently available service plans, see Windows 365 compare plans and pricing. Currently, the Microsoft Graph API is available for Windows 365 Enterprise. |
| 63 | + * @return a {@link CloudPcServicePlanCollectionResponse} |
| 64 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 65 | + * @see <a href="https://learn.microsoft.com/graph/api/virtualendpoint-list-serviceplans?view=graph-rest-1.0">Find more info here</a> |
| 66 | + */ |
| 67 | + @jakarta.annotation.Nullable |
| 68 | + public CloudPcServicePlanCollectionResponse get() { |
| 69 | + return get(null); |
| 70 | + } |
| 71 | + /** |
| 72 | + * List the currently available service plans that an organization can purchase for their Cloud PCs. For examples of currently available service plans, see Windows 365 compare plans and pricing. Currently, the Microsoft Graph API is available for Windows 365 Enterprise. |
| 73 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 74 | + * @return a {@link CloudPcServicePlanCollectionResponse} |
| 75 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 76 | + * @see <a href="https://learn.microsoft.com/graph/api/virtualendpoint-list-serviceplans?view=graph-rest-1.0">Find more info here</a> |
| 77 | + */ |
| 78 | + @jakarta.annotation.Nullable |
| 79 | + public CloudPcServicePlanCollectionResponse get(@jakarta.annotation.Nullable final java.util.function.Consumer<GetRequestConfiguration> requestConfiguration) { |
| 80 | + final RequestInformation requestInfo = toGetRequestInformation(requestConfiguration); |
| 81 | + final HashMap<String, ParsableFactory<? extends Parsable>> errorMapping = new HashMap<String, ParsableFactory<? extends Parsable>>(); |
| 82 | + errorMapping.put("XXX", ODataError::createFromDiscriminatorValue); |
| 83 | + return this.requestAdapter.send(requestInfo, errorMapping, CloudPcServicePlanCollectionResponse::createFromDiscriminatorValue); |
| 84 | + } |
| 85 | + /** |
| 86 | + * List the currently available service plans that an organization can purchase for their Cloud PCs. For examples of currently available service plans, see Windows 365 compare plans and pricing. Currently, the Microsoft Graph API is available for Windows 365 Enterprise. |
| 87 | + * @return a {@link RequestInformation} |
| 88 | + */ |
| 89 | + @jakarta.annotation.Nonnull |
| 90 | + public RequestInformation toGetRequestInformation() { |
| 91 | + return toGetRequestInformation(null); |
| 92 | + } |
| 93 | + /** |
| 94 | + * List the currently available service plans that an organization can purchase for their Cloud PCs. For examples of currently available service plans, see Windows 365 compare plans and pricing. Currently, the Microsoft Graph API is available for Windows 365 Enterprise. |
| 95 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 96 | + * @return a {@link RequestInformation} |
| 97 | + */ |
| 98 | + @jakarta.annotation.Nonnull |
| 99 | + public RequestInformation toGetRequestInformation(@jakarta.annotation.Nullable final java.util.function.Consumer<GetRequestConfiguration> requestConfiguration) { |
| 100 | + final RequestInformation requestInfo = new RequestInformation(HttpMethod.GET, urlTemplate, pathParameters); |
| 101 | + requestInfo.configure(requestConfiguration, GetRequestConfiguration::new, x -> x.queryParameters); |
| 102 | + requestInfo.headers.tryAdd("Accept", "application/json"); |
| 103 | + return requestInfo; |
| 104 | + } |
| 105 | + /** |
| 106 | + * Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. |
| 107 | + * @param rawUrl The raw URL to use for the request builder. |
| 108 | + * @return a {@link ServicePlansRequestBuilder} |
| 109 | + */ |
| 110 | + @jakarta.annotation.Nonnull |
| 111 | + public ServicePlansRequestBuilder withUrl(@jakarta.annotation.Nonnull final String rawUrl) { |
| 112 | + Objects.requireNonNull(rawUrl); |
| 113 | + return new ServicePlansRequestBuilder(rawUrl, requestAdapter); |
| 114 | + } |
| 115 | + /** |
| 116 | + * List the currently available service plans that an organization can purchase for their Cloud PCs. For examples of currently available service plans, see Windows 365 compare plans and pricing. Currently, the Microsoft Graph API is available for Windows 365 Enterprise. |
| 117 | + */ |
| 118 | + @jakarta.annotation.Generated("com.microsoft.kiota") |
| 119 | + public class GetQueryParameters implements QueryParameters { |
| 120 | + /** |
| 121 | + * Include count of items |
| 122 | + */ |
| 123 | + @jakarta.annotation.Nullable |
| 124 | + public Boolean count; |
| 125 | + /** |
| 126 | + * Expand related entities |
| 127 | + */ |
| 128 | + @jakarta.annotation.Nullable |
| 129 | + public String[] expand; |
| 130 | + /** |
| 131 | + * Filter items by property values |
| 132 | + */ |
| 133 | + @jakarta.annotation.Nullable |
| 134 | + public String filter; |
| 135 | + /** |
| 136 | + * Order items by property values |
| 137 | + */ |
| 138 | + @jakarta.annotation.Nullable |
| 139 | + public String[] orderby; |
| 140 | + /** |
| 141 | + * Search items by search phrases |
| 142 | + */ |
| 143 | + @jakarta.annotation.Nullable |
| 144 | + public String search; |
| 145 | + /** |
| 146 | + * Select properties to be returned |
| 147 | + */ |
| 148 | + @jakarta.annotation.Nullable |
| 149 | + public String[] select; |
| 150 | + /** |
| 151 | + * Skip the first n items |
| 152 | + */ |
| 153 | + @jakarta.annotation.Nullable |
| 154 | + public Integer skip; |
| 155 | + /** |
| 156 | + * Show only the first n items |
| 157 | + */ |
| 158 | + @jakarta.annotation.Nullable |
| 159 | + public Integer top; |
| 160 | + /** |
| 161 | + * Extracts the query parameters into a map for the URI template parsing. |
| 162 | + * @return a {@link Map<String, Object>} |
| 163 | + */ |
| 164 | + @jakarta.annotation.Nonnull |
| 165 | + public Map<String, Object> toQueryParameters() { |
| 166 | + final Map<String, Object> allQueryParams = new HashMap(); |
| 167 | + allQueryParams.put("%24count", count); |
| 168 | + allQueryParams.put("%24filter", filter); |
| 169 | + allQueryParams.put("%24search", search); |
| 170 | + allQueryParams.put("%24skip", skip); |
| 171 | + allQueryParams.put("%24top", top); |
| 172 | + allQueryParams.put("%24expand", expand); |
| 173 | + allQueryParams.put("%24orderby", orderby); |
| 174 | + allQueryParams.put("%24select", select); |
| 175 | + return allQueryParams; |
| 176 | + } |
| 177 | + } |
| 178 | + /** |
| 179 | + * Configuration for the request such as headers, query parameters, and middleware options. |
| 180 | + */ |
| 181 | + @jakarta.annotation.Generated("com.microsoft.kiota") |
| 182 | + public class GetRequestConfiguration extends BaseRequestConfiguration { |
| 183 | + /** |
| 184 | + * Request query parameters |
| 185 | + */ |
| 186 | + @jakarta.annotation.Nullable |
| 187 | + public GetQueryParameters queryParameters = new GetQueryParameters(); |
| 188 | + } |
| 189 | +} |
0 commit comments