|
| 1 | +package com.microsoft.graph.beta.admin.people.profilepropertysettings; |
| 2 | + |
| 3 | +import com.microsoft.graph.beta.admin.people.profilepropertysettings.count.CountRequestBuilder; |
| 4 | +import com.microsoft.graph.beta.admin.people.profilepropertysettings.item.ProfilePropertySettingItemRequestBuilder; |
| 5 | +import com.microsoft.graph.beta.models.odataerrors.ODataError; |
| 6 | +import com.microsoft.graph.beta.models.ProfilePropertySetting; |
| 7 | +import com.microsoft.graph.beta.models.ProfilePropertySettingCollectionResponse; |
| 8 | +import com.microsoft.kiota.BaseRequestBuilder; |
| 9 | +import com.microsoft.kiota.BaseRequestConfiguration; |
| 10 | +import com.microsoft.kiota.HttpMethod; |
| 11 | +import com.microsoft.kiota.QueryParameters; |
| 12 | +import com.microsoft.kiota.RequestAdapter; |
| 13 | +import com.microsoft.kiota.RequestInformation; |
| 14 | +import com.microsoft.kiota.RequestOption; |
| 15 | +import com.microsoft.kiota.serialization.Parsable; |
| 16 | +import com.microsoft.kiota.serialization.ParsableFactory; |
| 17 | +import java.util.Collection; |
| 18 | +import java.util.HashMap; |
| 19 | +import java.util.Map; |
| 20 | +import java.util.Objects; |
| 21 | +/** |
| 22 | + * Provides operations to manage the profilePropertySettings property of the microsoft.graph.peopleAdminSettings entity. |
| 23 | + */ |
| 24 | +@jakarta.annotation.Generated("com.microsoft.kiota") |
| 25 | +public class ProfilePropertySettingsRequestBuilder extends BaseRequestBuilder { |
| 26 | + /** |
| 27 | + * Provides operations to count the resources in the collection. |
| 28 | + * @return a {@link CountRequestBuilder} |
| 29 | + */ |
| 30 | + @jakarta.annotation.Nonnull |
| 31 | + public CountRequestBuilder count() { |
| 32 | + return new CountRequestBuilder(pathParameters, requestAdapter); |
| 33 | + } |
| 34 | + /** |
| 35 | + * Provides operations to manage the profilePropertySettings property of the microsoft.graph.peopleAdminSettings entity. |
| 36 | + * @param profilePropertySettingId The unique identifier of profilePropertySetting |
| 37 | + * @return a {@link ProfilePropertySettingItemRequestBuilder} |
| 38 | + */ |
| 39 | + @jakarta.annotation.Nonnull |
| 40 | + public ProfilePropertySettingItemRequestBuilder byProfilePropertySettingId(@jakarta.annotation.Nonnull final String profilePropertySettingId) { |
| 41 | + Objects.requireNonNull(profilePropertySettingId); |
| 42 | + final HashMap<String, Object> urlTplParams = new HashMap<String, Object>(this.pathParameters); |
| 43 | + urlTplParams.put("profilePropertySetting%2Did", profilePropertySettingId); |
| 44 | + return new ProfilePropertySettingItemRequestBuilder(urlTplParams, requestAdapter); |
| 45 | + } |
| 46 | + /** |
| 47 | + * Instantiates a new {@link ProfilePropertySettingsRequestBuilder} and sets the default values. |
| 48 | + * @param pathParameters Path parameters for the request |
| 49 | + * @param requestAdapter The request adapter to use to execute the requests. |
| 50 | + */ |
| 51 | + public ProfilePropertySettingsRequestBuilder(@jakarta.annotation.Nonnull final HashMap<String, Object> pathParameters, @jakarta.annotation.Nonnull final RequestAdapter requestAdapter) { |
| 52 | + super(requestAdapter, "{+baseurl}/admin/people/profilePropertySettings{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters); |
| 53 | + } |
| 54 | + /** |
| 55 | + * Instantiates a new {@link ProfilePropertySettingsRequestBuilder} and sets the default values. |
| 56 | + * @param rawUrl The raw URL to use for the request builder. |
| 57 | + * @param requestAdapter The request adapter to use to execute the requests. |
| 58 | + */ |
| 59 | + public ProfilePropertySettingsRequestBuilder(@jakarta.annotation.Nonnull final String rawUrl, @jakarta.annotation.Nonnull final RequestAdapter requestAdapter) { |
| 60 | + super(requestAdapter, "{+baseurl}/admin/people/profilePropertySettings{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl); |
| 61 | + } |
| 62 | + /** |
| 63 | + * Get a collection of profilePropertySetting objects that define the configuration for user profile properties in an organization. The id property identifies each resource object uniquely. |
| 64 | + * @return a {@link ProfilePropertySettingCollectionResponse} |
| 65 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 66 | + * @see <a href="https://learn.microsoft.com/graph/api/peopleadminsettings-list-profilepropertysettings?view=graph-rest-beta">Find more info here</a> |
| 67 | + */ |
| 68 | + @jakarta.annotation.Nullable |
| 69 | + public ProfilePropertySettingCollectionResponse get() { |
| 70 | + return get(null); |
| 71 | + } |
| 72 | + /** |
| 73 | + * Get a collection of profilePropertySetting objects that define the configuration for user profile properties in an organization. The id property identifies each resource object uniquely. |
| 74 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 75 | + * @return a {@link ProfilePropertySettingCollectionResponse} |
| 76 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 77 | + * @see <a href="https://learn.microsoft.com/graph/api/peopleadminsettings-list-profilepropertysettings?view=graph-rest-beta">Find more info here</a> |
| 78 | + */ |
| 79 | + @jakarta.annotation.Nullable |
| 80 | + public ProfilePropertySettingCollectionResponse get(@jakarta.annotation.Nullable final java.util.function.Consumer<GetRequestConfiguration> requestConfiguration) { |
| 81 | + final RequestInformation requestInfo = toGetRequestInformation(requestConfiguration); |
| 82 | + final HashMap<String, ParsableFactory<? extends Parsable>> errorMapping = new HashMap<String, ParsableFactory<? extends Parsable>>(); |
| 83 | + errorMapping.put("XXX", ODataError::createFromDiscriminatorValue); |
| 84 | + return this.requestAdapter.send(requestInfo, errorMapping, ProfilePropertySettingCollectionResponse::createFromDiscriminatorValue); |
| 85 | + } |
| 86 | + /** |
| 87 | + * Create a new profilePropertySetting object. |
| 88 | + * @param body The request body |
| 89 | + * @return a {@link ProfilePropertySetting} |
| 90 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 91 | + * @see <a href="https://learn.microsoft.com/graph/api/peopleadminsettings-post-profilepropertysettings?view=graph-rest-beta">Find more info here</a> |
| 92 | + */ |
| 93 | + @jakarta.annotation.Nullable |
| 94 | + public ProfilePropertySetting post(@jakarta.annotation.Nonnull final ProfilePropertySetting body) { |
| 95 | + return post(body, null); |
| 96 | + } |
| 97 | + /** |
| 98 | + * Create a new profilePropertySetting object. |
| 99 | + * @param body The request body |
| 100 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 101 | + * @return a {@link ProfilePropertySetting} |
| 102 | + * @throws ODataError When receiving a 4XX or 5XX status code |
| 103 | + * @see <a href="https://learn.microsoft.com/graph/api/peopleadminsettings-post-profilepropertysettings?view=graph-rest-beta">Find more info here</a> |
| 104 | + */ |
| 105 | + @jakarta.annotation.Nullable |
| 106 | + public ProfilePropertySetting post(@jakarta.annotation.Nonnull final ProfilePropertySetting body, @jakarta.annotation.Nullable final java.util.function.Consumer<PostRequestConfiguration> requestConfiguration) { |
| 107 | + Objects.requireNonNull(body); |
| 108 | + final RequestInformation requestInfo = toPostRequestInformation(body, requestConfiguration); |
| 109 | + final HashMap<String, ParsableFactory<? extends Parsable>> errorMapping = new HashMap<String, ParsableFactory<? extends Parsable>>(); |
| 110 | + errorMapping.put("XXX", ODataError::createFromDiscriminatorValue); |
| 111 | + return this.requestAdapter.send(requestInfo, errorMapping, ProfilePropertySetting::createFromDiscriminatorValue); |
| 112 | + } |
| 113 | + /** |
| 114 | + * Get a collection of profilePropertySetting objects that define the configuration for user profile properties in an organization. The id property identifies each resource object uniquely. |
| 115 | + * @return a {@link RequestInformation} |
| 116 | + */ |
| 117 | + @jakarta.annotation.Nonnull |
| 118 | + public RequestInformation toGetRequestInformation() { |
| 119 | + return toGetRequestInformation(null); |
| 120 | + } |
| 121 | + /** |
| 122 | + * Get a collection of profilePropertySetting objects that define the configuration for user profile properties in an organization. The id property identifies each resource object uniquely. |
| 123 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 124 | + * @return a {@link RequestInformation} |
| 125 | + */ |
| 126 | + @jakarta.annotation.Nonnull |
| 127 | + public RequestInformation toGetRequestInformation(@jakarta.annotation.Nullable final java.util.function.Consumer<GetRequestConfiguration> requestConfiguration) { |
| 128 | + final RequestInformation requestInfo = new RequestInformation(HttpMethod.GET, urlTemplate, pathParameters); |
| 129 | + requestInfo.configure(requestConfiguration, GetRequestConfiguration::new, x -> x.queryParameters); |
| 130 | + requestInfo.headers.tryAdd("Accept", "application/json"); |
| 131 | + return requestInfo; |
| 132 | + } |
| 133 | + /** |
| 134 | + * Create a new profilePropertySetting object. |
| 135 | + * @param body The request body |
| 136 | + * @return a {@link RequestInformation} |
| 137 | + */ |
| 138 | + @jakarta.annotation.Nonnull |
| 139 | + public RequestInformation toPostRequestInformation(@jakarta.annotation.Nonnull final ProfilePropertySetting body) { |
| 140 | + return toPostRequestInformation(body, null); |
| 141 | + } |
| 142 | + /** |
| 143 | + * Create a new profilePropertySetting object. |
| 144 | + * @param body The request body |
| 145 | + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. |
| 146 | + * @return a {@link RequestInformation} |
| 147 | + */ |
| 148 | + @jakarta.annotation.Nonnull |
| 149 | + public RequestInformation toPostRequestInformation(@jakarta.annotation.Nonnull final ProfilePropertySetting body, @jakarta.annotation.Nullable final java.util.function.Consumer<PostRequestConfiguration> requestConfiguration) { |
| 150 | + Objects.requireNonNull(body); |
| 151 | + final RequestInformation requestInfo = new RequestInformation(HttpMethod.POST, urlTemplate, pathParameters); |
| 152 | + requestInfo.configure(requestConfiguration, PostRequestConfiguration::new); |
| 153 | + requestInfo.headers.tryAdd("Accept", "application/json"); |
| 154 | + requestInfo.setContentFromParsable(requestAdapter, "application/json", body); |
| 155 | + return requestInfo; |
| 156 | + } |
| 157 | + /** |
| 158 | + * Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. |
| 159 | + * @param rawUrl The raw URL to use for the request builder. |
| 160 | + * @return a {@link ProfilePropertySettingsRequestBuilder} |
| 161 | + */ |
| 162 | + @jakarta.annotation.Nonnull |
| 163 | + public ProfilePropertySettingsRequestBuilder withUrl(@jakarta.annotation.Nonnull final String rawUrl) { |
| 164 | + Objects.requireNonNull(rawUrl); |
| 165 | + return new ProfilePropertySettingsRequestBuilder(rawUrl, requestAdapter); |
| 166 | + } |
| 167 | + /** |
| 168 | + * Get a collection of profilePropertySetting objects that define the configuration for user profile properties in an organization. The id property identifies each resource object uniquely. |
| 169 | + */ |
| 170 | + @jakarta.annotation.Generated("com.microsoft.kiota") |
| 171 | + public class GetQueryParameters implements QueryParameters { |
| 172 | + /** |
| 173 | + * Include count of items |
| 174 | + */ |
| 175 | + @jakarta.annotation.Nullable |
| 176 | + public Boolean count; |
| 177 | + /** |
| 178 | + * Expand related entities |
| 179 | + */ |
| 180 | + @jakarta.annotation.Nullable |
| 181 | + public String[] expand; |
| 182 | + /** |
| 183 | + * Filter items by property values |
| 184 | + */ |
| 185 | + @jakarta.annotation.Nullable |
| 186 | + public String filter; |
| 187 | + /** |
| 188 | + * Order items by property values |
| 189 | + */ |
| 190 | + @jakarta.annotation.Nullable |
| 191 | + public String[] orderby; |
| 192 | + /** |
| 193 | + * Search items by search phrases |
| 194 | + */ |
| 195 | + @jakarta.annotation.Nullable |
| 196 | + public String search; |
| 197 | + /** |
| 198 | + * Select properties to be returned |
| 199 | + */ |
| 200 | + @jakarta.annotation.Nullable |
| 201 | + public String[] select; |
| 202 | + /** |
| 203 | + * Skip the first n items |
| 204 | + */ |
| 205 | + @jakarta.annotation.Nullable |
| 206 | + public Integer skip; |
| 207 | + /** |
| 208 | + * Show only the first n items |
| 209 | + */ |
| 210 | + @jakarta.annotation.Nullable |
| 211 | + public Integer top; |
| 212 | + /** |
| 213 | + * Extracts the query parameters into a map for the URI template parsing. |
| 214 | + * @return a {@link Map<String, Object>} |
| 215 | + */ |
| 216 | + @jakarta.annotation.Nonnull |
| 217 | + public Map<String, Object> toQueryParameters() { |
| 218 | + final Map<String, Object> allQueryParams = new HashMap(); |
| 219 | + allQueryParams.put("%24count", count); |
| 220 | + allQueryParams.put("%24filter", filter); |
| 221 | + allQueryParams.put("%24search", search); |
| 222 | + allQueryParams.put("%24skip", skip); |
| 223 | + allQueryParams.put("%24top", top); |
| 224 | + allQueryParams.put("%24expand", expand); |
| 225 | + allQueryParams.put("%24orderby", orderby); |
| 226 | + allQueryParams.put("%24select", select); |
| 227 | + return allQueryParams; |
| 228 | + } |
| 229 | + } |
| 230 | + /** |
| 231 | + * Configuration for the request such as headers, query parameters, and middleware options. |
| 232 | + */ |
| 233 | + @jakarta.annotation.Generated("com.microsoft.kiota") |
| 234 | + public class GetRequestConfiguration extends BaseRequestConfiguration { |
| 235 | + /** |
| 236 | + * Request query parameters |
| 237 | + */ |
| 238 | + @jakarta.annotation.Nullable |
| 239 | + public GetQueryParameters queryParameters = new GetQueryParameters(); |
| 240 | + } |
| 241 | + /** |
| 242 | + * Configuration for the request such as headers, query parameters, and middleware options. |
| 243 | + */ |
| 244 | + @jakarta.annotation.Generated("com.microsoft.kiota") |
| 245 | + public class PostRequestConfiguration extends BaseRequestConfiguration { |
| 246 | + } |
| 247 | +} |
0 commit comments