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