|
| 1 | +// Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | +// Licensed under the MIT License. |
| 3 | +// Code generated by Microsoft (R) TypeSpec Code Generator. |
| 4 | + |
| 5 | +package com.type.model.inheritance.enumnesteddiscriminator; |
| 6 | + |
| 7 | +import com.azure.core.annotation.Generated; |
| 8 | +import com.azure.core.annotation.ReturnType; |
| 9 | +import com.azure.core.annotation.ServiceClient; |
| 10 | +import com.azure.core.annotation.ServiceMethod; |
| 11 | +import com.azure.core.exception.ClientAuthenticationException; |
| 12 | +import com.azure.core.exception.HttpResponseException; |
| 13 | +import com.azure.core.exception.ResourceModifiedException; |
| 14 | +import com.azure.core.exception.ResourceNotFoundException; |
| 15 | +import com.azure.core.http.rest.RequestOptions; |
| 16 | +import com.azure.core.http.rest.Response; |
| 17 | +import com.azure.core.util.BinaryData; |
| 18 | +import com.azure.core.util.FluxUtil; |
| 19 | +import com.type.model.inheritance.enumnesteddiscriminator.implementation.EnumNestedDiscriminatorClientImpl; |
| 20 | +import com.type.model.inheritance.enumnesteddiscriminator.models.Fish; |
| 21 | +import reactor.core.publisher.Mono; |
| 22 | + |
| 23 | +/** |
| 24 | + * Initializes a new instance of the asynchronous EnumNestedDiscriminatorClient type. |
| 25 | + */ |
| 26 | +@ServiceClient(builder = EnumNestedDiscriminatorClientBuilder.class, isAsync = true) |
| 27 | +public final class EnumNestedDiscriminatorAsyncClient { |
| 28 | + @Generated |
| 29 | + private final EnumNestedDiscriminatorClientImpl serviceClient; |
| 30 | + |
| 31 | + /** |
| 32 | + * Initializes an instance of EnumNestedDiscriminatorAsyncClient class. |
| 33 | + * |
| 34 | + * @param serviceClient the service client implementation. |
| 35 | + */ |
| 36 | + @Generated |
| 37 | + EnumNestedDiscriminatorAsyncClient(EnumNestedDiscriminatorClientImpl serviceClient) { |
| 38 | + this.serviceClient = serviceClient; |
| 39 | + } |
| 40 | + |
| 41 | + /** |
| 42 | + * The getModel operation. |
| 43 | + * <p><strong>Response Body Schema</strong></p> |
| 44 | + * |
| 45 | + * <pre>{@code |
| 46 | + * { |
| 47 | + * kind: String(shark/salmon) (Required) |
| 48 | + * age: int (Required) |
| 49 | + * } |
| 50 | + * }</pre> |
| 51 | + * |
| 52 | + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. |
| 53 | + * @throws HttpResponseException thrown if the request is rejected by server. |
| 54 | + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. |
| 55 | + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. |
| 56 | + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. |
| 57 | + * @return this is base model for polymorphic multiple levels inheritance with a discriminator along with |
| 58 | + * {@link Response} on successful completion of {@link Mono}. |
| 59 | + */ |
| 60 | + @Generated |
| 61 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 62 | + public Mono<Response<BinaryData>> getModelWithResponse(RequestOptions requestOptions) { |
| 63 | + return this.serviceClient.getModelWithResponseAsync(requestOptions); |
| 64 | + } |
| 65 | + |
| 66 | + /** |
| 67 | + * The putModel operation. |
| 68 | + * <p><strong>Request Body Schema</strong></p> |
| 69 | + * |
| 70 | + * <pre>{@code |
| 71 | + * { |
| 72 | + * kind: String(shark/salmon) (Required) |
| 73 | + * age: int (Required) |
| 74 | + * } |
| 75 | + * }</pre> |
| 76 | + * |
| 77 | + * @param input The input parameter. |
| 78 | + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. |
| 79 | + * @throws HttpResponseException thrown if the request is rejected by server. |
| 80 | + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. |
| 81 | + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. |
| 82 | + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. |
| 83 | + * @return the {@link Response} on successful completion of {@link Mono}. |
| 84 | + */ |
| 85 | + @Generated |
| 86 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 87 | + public Mono<Response<Void>> putModelWithResponse(BinaryData input, RequestOptions requestOptions) { |
| 88 | + return this.serviceClient.putModelWithResponseAsync(input, requestOptions); |
| 89 | + } |
| 90 | + |
| 91 | + /** |
| 92 | + * The getRecursiveModel operation. |
| 93 | + * <p><strong>Response Body Schema</strong></p> |
| 94 | + * |
| 95 | + * <pre>{@code |
| 96 | + * { |
| 97 | + * kind: String(shark/salmon) (Required) |
| 98 | + * age: int (Required) |
| 99 | + * } |
| 100 | + * }</pre> |
| 101 | + * |
| 102 | + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. |
| 103 | + * @throws HttpResponseException thrown if the request is rejected by server. |
| 104 | + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. |
| 105 | + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. |
| 106 | + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. |
| 107 | + * @return this is base model for polymorphic multiple levels inheritance with a discriminator along with |
| 108 | + * {@link Response} on successful completion of {@link Mono}. |
| 109 | + */ |
| 110 | + @Generated |
| 111 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 112 | + public Mono<Response<BinaryData>> getRecursiveModelWithResponse(RequestOptions requestOptions) { |
| 113 | + return this.serviceClient.getRecursiveModelWithResponseAsync(requestOptions); |
| 114 | + } |
| 115 | + |
| 116 | + /** |
| 117 | + * The putRecursiveModel operation. |
| 118 | + * <p><strong>Request Body Schema</strong></p> |
| 119 | + * |
| 120 | + * <pre>{@code |
| 121 | + * { |
| 122 | + * kind: String(shark/salmon) (Required) |
| 123 | + * age: int (Required) |
| 124 | + * } |
| 125 | + * }</pre> |
| 126 | + * |
| 127 | + * @param input The input parameter. |
| 128 | + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. |
| 129 | + * @throws HttpResponseException thrown if the request is rejected by server. |
| 130 | + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. |
| 131 | + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. |
| 132 | + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. |
| 133 | + * @return the {@link Response} on successful completion of {@link Mono}. |
| 134 | + */ |
| 135 | + @Generated |
| 136 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 137 | + public Mono<Response<Void>> putRecursiveModelWithResponse(BinaryData input, RequestOptions requestOptions) { |
| 138 | + return this.serviceClient.putRecursiveModelWithResponseAsync(input, requestOptions); |
| 139 | + } |
| 140 | + |
| 141 | + /** |
| 142 | + * The getMissingDiscriminator operation. |
| 143 | + * <p><strong>Response Body Schema</strong></p> |
| 144 | + * |
| 145 | + * <pre>{@code |
| 146 | + * { |
| 147 | + * kind: String(shark/salmon) (Required) |
| 148 | + * age: int (Required) |
| 149 | + * } |
| 150 | + * }</pre> |
| 151 | + * |
| 152 | + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. |
| 153 | + * @throws HttpResponseException thrown if the request is rejected by server. |
| 154 | + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. |
| 155 | + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. |
| 156 | + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. |
| 157 | + * @return this is base model for polymorphic multiple levels inheritance with a discriminator along with |
| 158 | + * {@link Response} on successful completion of {@link Mono}. |
| 159 | + */ |
| 160 | + @Generated |
| 161 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 162 | + public Mono<Response<BinaryData>> getMissingDiscriminatorWithResponse(RequestOptions requestOptions) { |
| 163 | + return this.serviceClient.getMissingDiscriminatorWithResponseAsync(requestOptions); |
| 164 | + } |
| 165 | + |
| 166 | + /** |
| 167 | + * The getWrongDiscriminator operation. |
| 168 | + * <p><strong>Response Body Schema</strong></p> |
| 169 | + * |
| 170 | + * <pre>{@code |
| 171 | + * { |
| 172 | + * kind: String(shark/salmon) (Required) |
| 173 | + * age: int (Required) |
| 174 | + * } |
| 175 | + * }</pre> |
| 176 | + * |
| 177 | + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. |
| 178 | + * @throws HttpResponseException thrown if the request is rejected by server. |
| 179 | + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. |
| 180 | + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. |
| 181 | + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. |
| 182 | + * @return this is base model for polymorphic multiple levels inheritance with a discriminator along with |
| 183 | + * {@link Response} on successful completion of {@link Mono}. |
| 184 | + */ |
| 185 | + @Generated |
| 186 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 187 | + public Mono<Response<BinaryData>> getWrongDiscriminatorWithResponse(RequestOptions requestOptions) { |
| 188 | + return this.serviceClient.getWrongDiscriminatorWithResponseAsync(requestOptions); |
| 189 | + } |
| 190 | + |
| 191 | + /** |
| 192 | + * The getModel operation. |
| 193 | + * |
| 194 | + * @throws HttpResponseException thrown if the request is rejected by server. |
| 195 | + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. |
| 196 | + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. |
| 197 | + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. |
| 198 | + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. |
| 199 | + * @return this is base model for polymorphic multiple levels inheritance with a discriminator on successful |
| 200 | + * completion of {@link Mono}. |
| 201 | + */ |
| 202 | + @Generated |
| 203 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 204 | + public Mono<Fish> getModel() { |
| 205 | + // Generated convenience method for getModelWithResponse |
| 206 | + RequestOptions requestOptions = new RequestOptions(); |
| 207 | + return getModelWithResponse(requestOptions).flatMap(FluxUtil::toMono) |
| 208 | + .map(protocolMethodData -> protocolMethodData.toObject(Fish.class)); |
| 209 | + } |
| 210 | + |
| 211 | + /** |
| 212 | + * The putModel operation. |
| 213 | + * |
| 214 | + * @param input The input parameter. |
| 215 | + * @throws IllegalArgumentException thrown if parameters fail the validation. |
| 216 | + * @throws HttpResponseException thrown if the request is rejected by server. |
| 217 | + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. |
| 218 | + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. |
| 219 | + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. |
| 220 | + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. |
| 221 | + * @return A {@link Mono} that completes when a successful response is received. |
| 222 | + */ |
| 223 | + @Generated |
| 224 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 225 | + public Mono<Void> putModel(Fish input) { |
| 226 | + // Generated convenience method for putModelWithResponse |
| 227 | + RequestOptions requestOptions = new RequestOptions(); |
| 228 | + return putModelWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); |
| 229 | + } |
| 230 | + |
| 231 | + /** |
| 232 | + * The getRecursiveModel operation. |
| 233 | + * |
| 234 | + * @throws HttpResponseException thrown if the request is rejected by server. |
| 235 | + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. |
| 236 | + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. |
| 237 | + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. |
| 238 | + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. |
| 239 | + * @return this is base model for polymorphic multiple levels inheritance with a discriminator on successful |
| 240 | + * completion of {@link Mono}. |
| 241 | + */ |
| 242 | + @Generated |
| 243 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 244 | + public Mono<Fish> getRecursiveModel() { |
| 245 | + // Generated convenience method for getRecursiveModelWithResponse |
| 246 | + RequestOptions requestOptions = new RequestOptions(); |
| 247 | + return getRecursiveModelWithResponse(requestOptions).flatMap(FluxUtil::toMono) |
| 248 | + .map(protocolMethodData -> protocolMethodData.toObject(Fish.class)); |
| 249 | + } |
| 250 | + |
| 251 | + /** |
| 252 | + * The putRecursiveModel operation. |
| 253 | + * |
| 254 | + * @param input The input parameter. |
| 255 | + * @throws IllegalArgumentException thrown if parameters fail the validation. |
| 256 | + * @throws HttpResponseException thrown if the request is rejected by server. |
| 257 | + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. |
| 258 | + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. |
| 259 | + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. |
| 260 | + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. |
| 261 | + * @return A {@link Mono} that completes when a successful response is received. |
| 262 | + */ |
| 263 | + @Generated |
| 264 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 265 | + public Mono<Void> putRecursiveModel(Fish input) { |
| 266 | + // Generated convenience method for putRecursiveModelWithResponse |
| 267 | + RequestOptions requestOptions = new RequestOptions(); |
| 268 | + return putRecursiveModelWithResponse(BinaryData.fromObject(input), requestOptions).flatMap(FluxUtil::toMono); |
| 269 | + } |
| 270 | + |
| 271 | + /** |
| 272 | + * The getMissingDiscriminator operation. |
| 273 | + * |
| 274 | + * @throws HttpResponseException thrown if the request is rejected by server. |
| 275 | + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. |
| 276 | + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. |
| 277 | + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. |
| 278 | + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. |
| 279 | + * @return this is base model for polymorphic multiple levels inheritance with a discriminator on successful |
| 280 | + * completion of {@link Mono}. |
| 281 | + */ |
| 282 | + @Generated |
| 283 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 284 | + public Mono<Fish> getMissingDiscriminator() { |
| 285 | + // Generated convenience method for getMissingDiscriminatorWithResponse |
| 286 | + RequestOptions requestOptions = new RequestOptions(); |
| 287 | + return getMissingDiscriminatorWithResponse(requestOptions).flatMap(FluxUtil::toMono) |
| 288 | + .map(protocolMethodData -> protocolMethodData.toObject(Fish.class)); |
| 289 | + } |
| 290 | + |
| 291 | + /** |
| 292 | + * The getWrongDiscriminator operation. |
| 293 | + * |
| 294 | + * @throws HttpResponseException thrown if the request is rejected by server. |
| 295 | + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. |
| 296 | + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. |
| 297 | + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. |
| 298 | + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. |
| 299 | + * @return this is base model for polymorphic multiple levels inheritance with a discriminator on successful |
| 300 | + * completion of {@link Mono}. |
| 301 | + */ |
| 302 | + @Generated |
| 303 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 304 | + public Mono<Fish> getWrongDiscriminator() { |
| 305 | + // Generated convenience method for getWrongDiscriminatorWithResponse |
| 306 | + RequestOptions requestOptions = new RequestOptions(); |
| 307 | + return getWrongDiscriminatorWithResponse(requestOptions).flatMap(FluxUtil::toMono) |
| 308 | + .map(protocolMethodData -> protocolMethodData.toObject(Fish.class)); |
| 309 | + } |
| 310 | +} |
0 commit comments