|
| 1 | +package com.microsoft.graph.education.classes.item.assignments.item.gradingscheme; |
| 2 | + |
| 3 | +import com.microsoft.graph.models.EducationGradingScheme; |
| 4 | +import com.microsoft.graph.models.odataerrors.ODataError; |
| 5 | +import com.microsoft.kiota.BaseRequestBuilder; |
| 6 | +import com.microsoft.kiota.BaseRequestConfiguration; |
| 7 | +import com.microsoft.kiota.HttpMethod; |
| 8 | +import com.microsoft.kiota.QueryParameters; |
| 9 | +import com.microsoft.kiota.RequestAdapter; |
| 10 | +import com.microsoft.kiota.RequestInformation; |
| 11 | +import com.microsoft.kiota.RequestOption; |
| 12 | +import com.microsoft.kiota.serialization.Parsable; |
| 13 | +import com.microsoft.kiota.serialization.ParsableFactory; |
| 14 | +import java.util.Collection; |
| 15 | +import java.util.HashMap; |
| 16 | +import java.util.Map; |
| 17 | +import java.util.Objects; |
| 18 | +/** |
| 19 | + * Provides operations to manage the gradingScheme property of the microsoft.graph.educationAssignment entity. |
| 20 | + */ |
| 21 | +@jakarta.annotation.Generated("com.microsoft.kiota") |
| 22 | +public class GradingSchemeRequestBuilder extends BaseRequestBuilder { |
| 23 | + /** |
| 24 | + * Instantiates a new {@link GradingSchemeRequestBuilder} and sets the default values. |
| 25 | + * @param pathParameters Path parameters for the request |
| 26 | + * @param requestAdapter The request adapter to use to execute the requests. |
| 27 | + */ |
| 28 | + public GradingSchemeRequestBuilder(@jakarta.annotation.Nonnull final HashMap<String, Object> pathParameters, @jakarta.annotation.Nonnull final RequestAdapter requestAdapter) { |
| 29 | + super(requestAdapter, "{+baseurl}/education/classes/{educationClass%2Did}/assignments/{educationAssignment%2Did}/gradingScheme{?%24expand,%24select}", pathParameters); |
| 30 | + } |
| 31 | + /** |
| 32 | + * Instantiates a new {@link GradingSchemeRequestBuilder} and sets the default values. |
| 33 | + * @param rawUrl The raw URL to use for the request builder. |
| 34 | + * @param requestAdapter The request adapter to use to execute the requests. |
| 35 | + */ |
| 36 | + public GradingSchemeRequestBuilder(@jakarta.annotation.Nonnull final String rawUrl, @jakarta.annotation.Nonnull final RequestAdapter requestAdapter) { |
| 37 | + super(requestAdapter, "{+baseurl}/education/classes/{educationClass%2Did}/assignments/{educationAssignment%2Did}/gradingScheme{?%24expand,%24select}", rawUrl); |
| 38 | + } |
| 39 | + /** |
| 40 | + * When set, enables users to configure custom string grades based on the percentage of total points earned on this assignment. |
| 41 | + * @return a {@link EducationGradingScheme} |
| 42 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 43 | + */ |
| 44 | + @jakarta.annotation.Nullable |
| 45 | + public EducationGradingScheme get() { |
| 46 | + return get(null); |
| 47 | + } |
| 48 | + /** |
| 49 | + * When set, enables users to configure custom string grades based on the percentage of total points earned on this assignment. |
| 50 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 51 | + * @return a {@link EducationGradingScheme} |
| 52 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 53 | + */ |
| 54 | + @jakarta.annotation.Nullable |
| 55 | + public EducationGradingScheme get(@jakarta.annotation.Nullable final java.util.function.Consumer<GetRequestConfiguration> requestConfiguration) { |
| 56 | + final RequestInformation requestInfo = toGetRequestInformation(requestConfiguration); |
| 57 | + final HashMap<String, ParsableFactory<? extends Parsable>> errorMapping = new HashMap<String, ParsableFactory<? extends Parsable>>(); |
| 58 | + errorMapping.put("XXX", ODataError::createFromDiscriminatorValue); |
| 59 | + return this.requestAdapter.send(requestInfo, errorMapping, EducationGradingScheme::createFromDiscriminatorValue); |
| 60 | + } |
| 61 | + /** |
| 62 | + * When set, enables users to configure custom string grades based on the percentage of total points earned on this assignment. |
| 63 | + * @return a {@link RequestInformation} |
| 64 | + */ |
| 65 | + @jakarta.annotation.Nonnull |
| 66 | + public RequestInformation toGetRequestInformation() { |
| 67 | + return toGetRequestInformation(null); |
| 68 | + } |
| 69 | + /** |
| 70 | + * When set, enables users to configure custom string grades based on the percentage of total points earned on this assignment. |
| 71 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 72 | + * @return a {@link RequestInformation} |
| 73 | + */ |
| 74 | + @jakarta.annotation.Nonnull |
| 75 | + public RequestInformation toGetRequestInformation(@jakarta.annotation.Nullable final java.util.function.Consumer<GetRequestConfiguration> requestConfiguration) { |
| 76 | + final RequestInformation requestInfo = new RequestInformation(HttpMethod.GET, urlTemplate, pathParameters); |
| 77 | + requestInfo.configure(requestConfiguration, GetRequestConfiguration::new, x -> x.queryParameters); |
| 78 | + requestInfo.headers.tryAdd("Accept", "application/json"); |
| 79 | + return requestInfo; |
| 80 | + } |
| 81 | + /** |
| 82 | + * Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. |
| 83 | + * @param rawUrl The raw URL to use for the request builder. |
| 84 | + * @return a {@link GradingSchemeRequestBuilder} |
| 85 | + */ |
| 86 | + @jakarta.annotation.Nonnull |
| 87 | + public GradingSchemeRequestBuilder withUrl(@jakarta.annotation.Nonnull final String rawUrl) { |
| 88 | + Objects.requireNonNull(rawUrl); |
| 89 | + return new GradingSchemeRequestBuilder(rawUrl, requestAdapter); |
| 90 | + } |
| 91 | + /** |
| 92 | + * When set, enables users to configure custom string grades based on the percentage of total points earned on this assignment. |
| 93 | + */ |
| 94 | + @jakarta.annotation.Generated("com.microsoft.kiota") |
| 95 | + public class GetQueryParameters implements QueryParameters { |
| 96 | + /** |
| 97 | + * Expand related entities |
| 98 | + */ |
| 99 | + @jakarta.annotation.Nullable |
| 100 | + public String[] expand; |
| 101 | + /** |
| 102 | + * Select properties to be returned |
| 103 | + */ |
| 104 | + @jakarta.annotation.Nullable |
| 105 | + public String[] select; |
| 106 | + /** |
| 107 | + * Extracts the query parameters into a map for the URI template parsing. |
| 108 | + * @return a {@link Map<String, Object>} |
| 109 | + */ |
| 110 | + @jakarta.annotation.Nonnull |
| 111 | + public Map<String, Object> toQueryParameters() { |
| 112 | + final Map<String, Object> allQueryParams = new HashMap(); |
| 113 | + allQueryParams.put("%24expand", expand); |
| 114 | + allQueryParams.put("%24select", select); |
| 115 | + return allQueryParams; |
| 116 | + } |
| 117 | + } |
| 118 | + /** |
| 119 | + * Configuration for the request such as headers, query parameters, and middleware options. |
| 120 | + */ |
| 121 | + @jakarta.annotation.Generated("com.microsoft.kiota") |
| 122 | + public class GetRequestConfiguration extends BaseRequestConfiguration { |
| 123 | + /** |
| 124 | + * Request query parameters |
| 125 | + */ |
| 126 | + @jakarta.annotation.Nullable |
| 127 | + public GetQueryParameters queryParameters = new GetQueryParameters(); |
| 128 | + } |
| 129 | +} |
0 commit comments