|
| 1 | +package com.microsoft.graph.beta.admin.people.photoupdatesettings; |
| 2 | + |
| 3 | +import com.microsoft.graph.beta.models.odataerrors.ODataError; |
| 4 | +import com.microsoft.graph.beta.models.PhotoUpdateSettings; |
| 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 photoUpdateSettings property of the microsoft.graph.peopleAdminSettings entity. |
| 20 | + */ |
| 21 | +@jakarta.annotation.Generated("com.microsoft.kiota") |
| 22 | +public class PhotoUpdateSettingsRequestBuilder extends BaseRequestBuilder { |
| 23 | + /** |
| 24 | + * Instantiates a new {@link PhotoUpdateSettingsRequestBuilder} 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 PhotoUpdateSettingsRequestBuilder(@jakarta.annotation.Nonnull final HashMap<String, Object> pathParameters, @jakarta.annotation.Nonnull final RequestAdapter requestAdapter) { |
| 29 | + super(requestAdapter, "{+baseurl}/admin/people/photoUpdateSettings{?%24expand,%24select}", pathParameters); |
| 30 | + } |
| 31 | + /** |
| 32 | + * Instantiates a new {@link PhotoUpdateSettingsRequestBuilder} 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 PhotoUpdateSettingsRequestBuilder(@jakarta.annotation.Nonnull final String rawUrl, @jakarta.annotation.Nonnull final RequestAdapter requestAdapter) { |
| 37 | + super(requestAdapter, "{+baseurl}/admin/people/photoUpdateSettings{?%24expand,%24select}", rawUrl); |
| 38 | + } |
| 39 | + /** |
| 40 | + * Delete a photoUpdateSettings object. |
| 41 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 42 | + * @see <a href="https://learn.microsoft.com/graph/api/peopleadminsettings-delete-photoupdatesettings?view=graph-rest-beta">Find more info here</a> |
| 43 | + */ |
| 44 | + public void delete() { |
| 45 | + delete(null); |
| 46 | + } |
| 47 | + /** |
| 48 | + * Delete a photoUpdateSettings object. |
| 49 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 50 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 51 | + * @see <a href="https://learn.microsoft.com/graph/api/peopleadminsettings-delete-photoupdatesettings?view=graph-rest-beta">Find more info here</a> |
| 52 | + */ |
| 53 | + public void delete(@jakarta.annotation.Nullable final java.util.function.Consumer<DeleteRequestConfiguration> requestConfiguration) { |
| 54 | + final RequestInformation requestInfo = toDeleteRequestInformation(requestConfiguration); |
| 55 | + final HashMap<String, ParsableFactory<? extends Parsable>> errorMapping = new HashMap<String, ParsableFactory<? extends Parsable>>(); |
| 56 | + errorMapping.put("XXX", ODataError::createFromDiscriminatorValue); |
| 57 | + this.requestAdapter.sendPrimitive(requestInfo, errorMapping, Void.class); |
| 58 | + } |
| 59 | + /** |
| 60 | + * Read the properties and relationships of a photoUpdateSettings object. |
| 61 | + * @return a {@link PhotoUpdateSettings} |
| 62 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 63 | + * @see <a href="https://learn.microsoft.com/graph/api/photoupdatesettings-get?view=graph-rest-beta">Find more info here</a> |
| 64 | + */ |
| 65 | + @jakarta.annotation.Nullable |
| 66 | + public PhotoUpdateSettings get() { |
| 67 | + return get(null); |
| 68 | + } |
| 69 | + /** |
| 70 | + * Read the properties and relationships of a photoUpdateSettings object. |
| 71 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 72 | + * @return a {@link PhotoUpdateSettings} |
| 73 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 74 | + * @see <a href="https://learn.microsoft.com/graph/api/photoupdatesettings-get?view=graph-rest-beta">Find more info here</a> |
| 75 | + */ |
| 76 | + @jakarta.annotation.Nullable |
| 77 | + public PhotoUpdateSettings get(@jakarta.annotation.Nullable final java.util.function.Consumer<GetRequestConfiguration> requestConfiguration) { |
| 78 | + final RequestInformation requestInfo = toGetRequestInformation(requestConfiguration); |
| 79 | + final HashMap<String, ParsableFactory<? extends Parsable>> errorMapping = new HashMap<String, ParsableFactory<? extends Parsable>>(); |
| 80 | + errorMapping.put("XXX", ODataError::createFromDiscriminatorValue); |
| 81 | + return this.requestAdapter.send(requestInfo, errorMapping, PhotoUpdateSettings::createFromDiscriminatorValue); |
| 82 | + } |
| 83 | + /** |
| 84 | + * Update the properties of a photoUpdateSettings object. |
| 85 | + * @param body The request body |
| 86 | + * @return a {@link PhotoUpdateSettings} |
| 87 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 88 | + * @see <a href="https://learn.microsoft.com/graph/api/photoupdatesettings-update?view=graph-rest-beta">Find more info here</a> |
| 89 | + */ |
| 90 | + @jakarta.annotation.Nullable |
| 91 | + public PhotoUpdateSettings patch(@jakarta.annotation.Nonnull final PhotoUpdateSettings body) { |
| 92 | + return patch(body, null); |
| 93 | + } |
| 94 | + /** |
| 95 | + * Update the properties of a photoUpdateSettings object. |
| 96 | + * @param body The request body |
| 97 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 98 | + * @return a {@link PhotoUpdateSettings} |
| 99 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 100 | + * @see <a href="https://learn.microsoft.com/graph/api/photoupdatesettings-update?view=graph-rest-beta">Find more info here</a> |
| 101 | + */ |
| 102 | + @jakarta.annotation.Nullable |
| 103 | + public PhotoUpdateSettings patch(@jakarta.annotation.Nonnull final PhotoUpdateSettings body, @jakarta.annotation.Nullable final java.util.function.Consumer<PatchRequestConfiguration> requestConfiguration) { |
| 104 | + Objects.requireNonNull(body); |
| 105 | + final RequestInformation requestInfo = toPatchRequestInformation(body, requestConfiguration); |
| 106 | + final HashMap<String, ParsableFactory<? extends Parsable>> errorMapping = new HashMap<String, ParsableFactory<? extends Parsable>>(); |
| 107 | + errorMapping.put("XXX", ODataError::createFromDiscriminatorValue); |
| 108 | + return this.requestAdapter.send(requestInfo, errorMapping, PhotoUpdateSettings::createFromDiscriminatorValue); |
| 109 | + } |
| 110 | + /** |
| 111 | + * Delete a photoUpdateSettings object. |
| 112 | + * @return a {@link RequestInformation} |
| 113 | + */ |
| 114 | + @jakarta.annotation.Nonnull |
| 115 | + public RequestInformation toDeleteRequestInformation() { |
| 116 | + return toDeleteRequestInformation(null); |
| 117 | + } |
| 118 | + /** |
| 119 | + * Delete a photoUpdateSettings object. |
| 120 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 121 | + * @return a {@link RequestInformation} |
| 122 | + */ |
| 123 | + @jakarta.annotation.Nonnull |
| 124 | + public RequestInformation toDeleteRequestInformation(@jakarta.annotation.Nullable final java.util.function.Consumer<DeleteRequestConfiguration> requestConfiguration) { |
| 125 | + final RequestInformation requestInfo = new RequestInformation(HttpMethod.DELETE, urlTemplate, pathParameters); |
| 126 | + requestInfo.configure(requestConfiguration, DeleteRequestConfiguration::new); |
| 127 | + requestInfo.headers.tryAdd("Accept", "application/json"); |
| 128 | + return requestInfo; |
| 129 | + } |
| 130 | + /** |
| 131 | + * Read the properties and relationships of a photoUpdateSettings object. |
| 132 | + * @return a {@link RequestInformation} |
| 133 | + */ |
| 134 | + @jakarta.annotation.Nonnull |
| 135 | + public RequestInformation toGetRequestInformation() { |
| 136 | + return toGetRequestInformation(null); |
| 137 | + } |
| 138 | + /** |
| 139 | + * Read the properties and relationships of a photoUpdateSettings object. |
| 140 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 141 | + * @return a {@link RequestInformation} |
| 142 | + */ |
| 143 | + @jakarta.annotation.Nonnull |
| 144 | + public RequestInformation toGetRequestInformation(@jakarta.annotation.Nullable final java.util.function.Consumer<GetRequestConfiguration> requestConfiguration) { |
| 145 | + final RequestInformation requestInfo = new RequestInformation(HttpMethod.GET, urlTemplate, pathParameters); |
| 146 | + requestInfo.configure(requestConfiguration, GetRequestConfiguration::new, x -> x.queryParameters); |
| 147 | + requestInfo.headers.tryAdd("Accept", "application/json"); |
| 148 | + return requestInfo; |
| 149 | + } |
| 150 | + /** |
| 151 | + * Update the properties of a photoUpdateSettings object. |
| 152 | + * @param body The request body |
| 153 | + * @return a {@link RequestInformation} |
| 154 | + */ |
| 155 | + @jakarta.annotation.Nonnull |
| 156 | + public RequestInformation toPatchRequestInformation(@jakarta.annotation.Nonnull final PhotoUpdateSettings body) { |
| 157 | + return toPatchRequestInformation(body, null); |
| 158 | + } |
| 159 | + /** |
| 160 | + * Update the properties of a photoUpdateSettings object. |
| 161 | + * @param body The request body |
| 162 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 163 | + * @return a {@link RequestInformation} |
| 164 | + */ |
| 165 | + @jakarta.annotation.Nonnull |
| 166 | + public RequestInformation toPatchRequestInformation(@jakarta.annotation.Nonnull final PhotoUpdateSettings body, @jakarta.annotation.Nullable final java.util.function.Consumer<PatchRequestConfiguration> requestConfiguration) { |
| 167 | + Objects.requireNonNull(body); |
| 168 | + final RequestInformation requestInfo = new RequestInformation(HttpMethod.PATCH, urlTemplate, pathParameters); |
| 169 | + requestInfo.configure(requestConfiguration, PatchRequestConfiguration::new); |
| 170 | + requestInfo.headers.tryAdd("Accept", "application/json"); |
| 171 | + requestInfo.setContentFromParsable(requestAdapter, "application/json", body); |
| 172 | + return requestInfo; |
| 173 | + } |
| 174 | + /** |
| 175 | + * Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. |
| 176 | + * @param rawUrl The raw URL to use for the request builder. |
| 177 | + * @return a {@link PhotoUpdateSettingsRequestBuilder} |
| 178 | + */ |
| 179 | + @jakarta.annotation.Nonnull |
| 180 | + public PhotoUpdateSettingsRequestBuilder withUrl(@jakarta.annotation.Nonnull final String rawUrl) { |
| 181 | + Objects.requireNonNull(rawUrl); |
| 182 | + return new PhotoUpdateSettingsRequestBuilder(rawUrl, requestAdapter); |
| 183 | + } |
| 184 | + /** |
| 185 | + * Configuration for the request such as headers, query parameters, and middleware options. |
| 186 | + */ |
| 187 | + @jakarta.annotation.Generated("com.microsoft.kiota") |
| 188 | + public class DeleteRequestConfiguration extends BaseRequestConfiguration { |
| 189 | + } |
| 190 | + /** |
| 191 | + * Read the properties and relationships of a photoUpdateSettings object. |
| 192 | + */ |
| 193 | + @jakarta.annotation.Generated("com.microsoft.kiota") |
| 194 | + public class GetQueryParameters implements QueryParameters { |
| 195 | + /** |
| 196 | + * Expand related entities |
| 197 | + */ |
| 198 | + @jakarta.annotation.Nullable |
| 199 | + public String[] expand; |
| 200 | + /** |
| 201 | + * Select properties to be returned |
| 202 | + */ |
| 203 | + @jakarta.annotation.Nullable |
| 204 | + public String[] select; |
| 205 | + /** |
| 206 | + * Extracts the query parameters into a map for the URI template parsing. |
| 207 | + * @return a {@link Map<String, Object>} |
| 208 | + */ |
| 209 | + @jakarta.annotation.Nonnull |
| 210 | + public Map<String, Object> toQueryParameters() { |
| 211 | + final Map<String, Object> allQueryParams = new HashMap(); |
| 212 | + allQueryParams.put("%24expand", expand); |
| 213 | + allQueryParams.put("%24select", select); |
| 214 | + return allQueryParams; |
| 215 | + } |
| 216 | + } |
| 217 | + /** |
| 218 | + * Configuration for the request such as headers, query parameters, and middleware options. |
| 219 | + */ |
| 220 | + @jakarta.annotation.Generated("com.microsoft.kiota") |
| 221 | + public class GetRequestConfiguration extends BaseRequestConfiguration { |
| 222 | + /** |
| 223 | + * Request query parameters |
| 224 | + */ |
| 225 | + @jakarta.annotation.Nullable |
| 226 | + public GetQueryParameters queryParameters = new GetQueryParameters(); |
| 227 | + } |
| 228 | + /** |
| 229 | + * Configuration for the request such as headers, query parameters, and middleware options. |
| 230 | + */ |
| 231 | + @jakarta.annotation.Generated("com.microsoft.kiota") |
| 232 | + public class PatchRequestConfiguration extends BaseRequestConfiguration { |
| 233 | + } |
| 234 | +} |
0 commit comments